1*0a6a1f1dSLionel Sambuc /*
2*0a6a1f1dSLionel Sambuc * This file generated automatically from dri3.xml by c_client.py.
3*0a6a1f1dSLionel Sambuc * Edit at your peril.
4*0a6a1f1dSLionel Sambuc */
5*0a6a1f1dSLionel Sambuc
6*0a6a1f1dSLionel Sambuc #ifdef HAVE_CONFIG_H
7*0a6a1f1dSLionel Sambuc #include "config.h"
8*0a6a1f1dSLionel Sambuc #endif
9*0a6a1f1dSLionel Sambuc #include <stdlib.h>
10*0a6a1f1dSLionel Sambuc #include <string.h>
11*0a6a1f1dSLionel Sambuc #include <assert.h>
12*0a6a1f1dSLionel Sambuc #include <stddef.h> /* for offsetof() */
13*0a6a1f1dSLionel Sambuc #include "xcbext.h"
14*0a6a1f1dSLionel Sambuc #include "dri3.h"
15*0a6a1f1dSLionel Sambuc
16*0a6a1f1dSLionel Sambuc #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17*0a6a1f1dSLionel Sambuc #include "xproto.h"
18*0a6a1f1dSLionel Sambuc
19*0a6a1f1dSLionel Sambuc xcb_extension_t xcb_dri3_id = { "DRI3", 0 };
20*0a6a1f1dSLionel Sambuc
21*0a6a1f1dSLionel Sambuc xcb_dri3_query_version_cookie_t
xcb_dri3_query_version(xcb_connection_t * c,uint32_t major_version,uint32_t minor_version)22*0a6a1f1dSLionel Sambuc xcb_dri3_query_version (xcb_connection_t *c /**< */,
23*0a6a1f1dSLionel Sambuc uint32_t major_version /**< */,
24*0a6a1f1dSLionel Sambuc uint32_t minor_version /**< */)
25*0a6a1f1dSLionel Sambuc {
26*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
27*0a6a1f1dSLionel Sambuc /* count */ 2,
28*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
29*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_QUERY_VERSION,
30*0a6a1f1dSLionel Sambuc /* isvoid */ 0
31*0a6a1f1dSLionel Sambuc };
32*0a6a1f1dSLionel Sambuc
33*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
34*0a6a1f1dSLionel Sambuc xcb_dri3_query_version_cookie_t xcb_ret;
35*0a6a1f1dSLionel Sambuc xcb_dri3_query_version_request_t xcb_out;
36*0a6a1f1dSLionel Sambuc
37*0a6a1f1dSLionel Sambuc xcb_out.major_version = major_version;
38*0a6a1f1dSLionel Sambuc xcb_out.minor_version = minor_version;
39*0a6a1f1dSLionel Sambuc
40*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
41*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
42*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
43*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
44*0a6a1f1dSLionel Sambuc
45*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
46*0a6a1f1dSLionel Sambuc return xcb_ret;
47*0a6a1f1dSLionel Sambuc }
48*0a6a1f1dSLionel Sambuc
49*0a6a1f1dSLionel Sambuc xcb_dri3_query_version_cookie_t
xcb_dri3_query_version_unchecked(xcb_connection_t * c,uint32_t major_version,uint32_t minor_version)50*0a6a1f1dSLionel Sambuc xcb_dri3_query_version_unchecked (xcb_connection_t *c /**< */,
51*0a6a1f1dSLionel Sambuc uint32_t major_version /**< */,
52*0a6a1f1dSLionel Sambuc uint32_t minor_version /**< */)
53*0a6a1f1dSLionel Sambuc {
54*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
55*0a6a1f1dSLionel Sambuc /* count */ 2,
56*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
57*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_QUERY_VERSION,
58*0a6a1f1dSLionel Sambuc /* isvoid */ 0
59*0a6a1f1dSLionel Sambuc };
60*0a6a1f1dSLionel Sambuc
61*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
62*0a6a1f1dSLionel Sambuc xcb_dri3_query_version_cookie_t xcb_ret;
63*0a6a1f1dSLionel Sambuc xcb_dri3_query_version_request_t xcb_out;
64*0a6a1f1dSLionel Sambuc
65*0a6a1f1dSLionel Sambuc xcb_out.major_version = major_version;
66*0a6a1f1dSLionel Sambuc xcb_out.minor_version = minor_version;
67*0a6a1f1dSLionel Sambuc
68*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
69*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
70*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
71*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
72*0a6a1f1dSLionel Sambuc
73*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
74*0a6a1f1dSLionel Sambuc return xcb_ret;
75*0a6a1f1dSLionel Sambuc }
76*0a6a1f1dSLionel Sambuc
77*0a6a1f1dSLionel Sambuc xcb_dri3_query_version_reply_t *
xcb_dri3_query_version_reply(xcb_connection_t * c,xcb_dri3_query_version_cookie_t cookie,xcb_generic_error_t ** e)78*0a6a1f1dSLionel Sambuc xcb_dri3_query_version_reply (xcb_connection_t *c /**< */,
79*0a6a1f1dSLionel Sambuc xcb_dri3_query_version_cookie_t cookie /**< */,
80*0a6a1f1dSLionel Sambuc xcb_generic_error_t **e /**< */)
81*0a6a1f1dSLionel Sambuc {
82*0a6a1f1dSLionel Sambuc return (xcb_dri3_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
83*0a6a1f1dSLionel Sambuc }
84*0a6a1f1dSLionel Sambuc
85*0a6a1f1dSLionel Sambuc xcb_dri3_open_cookie_t
xcb_dri3_open(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t provider)86*0a6a1f1dSLionel Sambuc xcb_dri3_open (xcb_connection_t *c /**< */,
87*0a6a1f1dSLionel Sambuc xcb_drawable_t drawable /**< */,
88*0a6a1f1dSLionel Sambuc uint32_t provider /**< */)
89*0a6a1f1dSLionel Sambuc {
90*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
91*0a6a1f1dSLionel Sambuc /* count */ 2,
92*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
93*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_OPEN,
94*0a6a1f1dSLionel Sambuc /* isvoid */ 0
95*0a6a1f1dSLionel Sambuc };
96*0a6a1f1dSLionel Sambuc
97*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
98*0a6a1f1dSLionel Sambuc xcb_dri3_open_cookie_t xcb_ret;
99*0a6a1f1dSLionel Sambuc xcb_dri3_open_request_t xcb_out;
100*0a6a1f1dSLionel Sambuc
101*0a6a1f1dSLionel Sambuc xcb_out.drawable = drawable;
102*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
103*0a6a1f1dSLionel Sambuc
104*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
105*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
106*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
107*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
108*0a6a1f1dSLionel Sambuc
109*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED|XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
110*0a6a1f1dSLionel Sambuc return xcb_ret;
111*0a6a1f1dSLionel Sambuc }
112*0a6a1f1dSLionel Sambuc
113*0a6a1f1dSLionel Sambuc xcb_dri3_open_cookie_t
xcb_dri3_open_unchecked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t provider)114*0a6a1f1dSLionel Sambuc xcb_dri3_open_unchecked (xcb_connection_t *c /**< */,
115*0a6a1f1dSLionel Sambuc xcb_drawable_t drawable /**< */,
116*0a6a1f1dSLionel Sambuc uint32_t provider /**< */)
117*0a6a1f1dSLionel Sambuc {
118*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
119*0a6a1f1dSLionel Sambuc /* count */ 2,
120*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
121*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_OPEN,
122*0a6a1f1dSLionel Sambuc /* isvoid */ 0
123*0a6a1f1dSLionel Sambuc };
124*0a6a1f1dSLionel Sambuc
125*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
126*0a6a1f1dSLionel Sambuc xcb_dri3_open_cookie_t xcb_ret;
127*0a6a1f1dSLionel Sambuc xcb_dri3_open_request_t xcb_out;
128*0a6a1f1dSLionel Sambuc
129*0a6a1f1dSLionel Sambuc xcb_out.drawable = drawable;
130*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
131*0a6a1f1dSLionel Sambuc
132*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
133*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
134*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
135*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
136*0a6a1f1dSLionel Sambuc
137*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
138*0a6a1f1dSLionel Sambuc return xcb_ret;
139*0a6a1f1dSLionel Sambuc }
140*0a6a1f1dSLionel Sambuc
141*0a6a1f1dSLionel Sambuc xcb_dri3_open_reply_t *
xcb_dri3_open_reply(xcb_connection_t * c,xcb_dri3_open_cookie_t cookie,xcb_generic_error_t ** e)142*0a6a1f1dSLionel Sambuc xcb_dri3_open_reply (xcb_connection_t *c /**< */,
143*0a6a1f1dSLionel Sambuc xcb_dri3_open_cookie_t cookie /**< */,
144*0a6a1f1dSLionel Sambuc xcb_generic_error_t **e /**< */)
145*0a6a1f1dSLionel Sambuc {
146*0a6a1f1dSLionel Sambuc return (xcb_dri3_open_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
147*0a6a1f1dSLionel Sambuc }
148*0a6a1f1dSLionel Sambuc
149*0a6a1f1dSLionel Sambuc int *
xcb_dri3_open_reply_fds(xcb_connection_t * c,xcb_dri3_open_reply_t * reply)150*0a6a1f1dSLionel Sambuc xcb_dri3_open_reply_fds (xcb_connection_t *c /**< */,
151*0a6a1f1dSLionel Sambuc xcb_dri3_open_reply_t *reply /**< */)
152*0a6a1f1dSLionel Sambuc {
153*0a6a1f1dSLionel Sambuc return xcb_get_reply_fds(c, reply, sizeof(xcb_dri3_open_reply_t) + 4 * reply->length);
154*0a6a1f1dSLionel Sambuc }
155*0a6a1f1dSLionel Sambuc
156*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_dri3_pixmap_from_buffer_checked(xcb_connection_t * c,xcb_pixmap_t pixmap,xcb_drawable_t drawable,uint32_t size,uint16_t width,uint16_t height,uint16_t stride,uint8_t depth,uint8_t bpp,int32_t pixmap_fd)157*0a6a1f1dSLionel Sambuc xcb_dri3_pixmap_from_buffer_checked (xcb_connection_t *c /**< */,
158*0a6a1f1dSLionel Sambuc xcb_pixmap_t pixmap /**< */,
159*0a6a1f1dSLionel Sambuc xcb_drawable_t drawable /**< */,
160*0a6a1f1dSLionel Sambuc uint32_t size /**< */,
161*0a6a1f1dSLionel Sambuc uint16_t width /**< */,
162*0a6a1f1dSLionel Sambuc uint16_t height /**< */,
163*0a6a1f1dSLionel Sambuc uint16_t stride /**< */,
164*0a6a1f1dSLionel Sambuc uint8_t depth /**< */,
165*0a6a1f1dSLionel Sambuc uint8_t bpp /**< */,
166*0a6a1f1dSLionel Sambuc int32_t pixmap_fd /**< */)
167*0a6a1f1dSLionel Sambuc {
168*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
169*0a6a1f1dSLionel Sambuc /* count */ 2,
170*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
171*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_PIXMAP_FROM_BUFFER,
172*0a6a1f1dSLionel Sambuc /* isvoid */ 1
173*0a6a1f1dSLionel Sambuc };
174*0a6a1f1dSLionel Sambuc
175*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
176*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
177*0a6a1f1dSLionel Sambuc xcb_dri3_pixmap_from_buffer_request_t xcb_out;
178*0a6a1f1dSLionel Sambuc
179*0a6a1f1dSLionel Sambuc xcb_out.pixmap = pixmap;
180*0a6a1f1dSLionel Sambuc xcb_out.drawable = drawable;
181*0a6a1f1dSLionel Sambuc xcb_out.size = size;
182*0a6a1f1dSLionel Sambuc xcb_out.width = width;
183*0a6a1f1dSLionel Sambuc xcb_out.height = height;
184*0a6a1f1dSLionel Sambuc xcb_out.stride = stride;
185*0a6a1f1dSLionel Sambuc xcb_out.depth = depth;
186*0a6a1f1dSLionel Sambuc xcb_out.bpp = bpp;
187*0a6a1f1dSLionel Sambuc
188*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
189*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
190*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
191*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
192*0a6a1f1dSLionel Sambuc
193*0a6a1f1dSLionel Sambuc xcb_send_fd(c, pixmap_fd);
194*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
195*0a6a1f1dSLionel Sambuc return xcb_ret;
196*0a6a1f1dSLionel Sambuc }
197*0a6a1f1dSLionel Sambuc
198*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_dri3_pixmap_from_buffer(xcb_connection_t * c,xcb_pixmap_t pixmap,xcb_drawable_t drawable,uint32_t size,uint16_t width,uint16_t height,uint16_t stride,uint8_t depth,uint8_t bpp,int32_t pixmap_fd)199*0a6a1f1dSLionel Sambuc xcb_dri3_pixmap_from_buffer (xcb_connection_t *c /**< */,
200*0a6a1f1dSLionel Sambuc xcb_pixmap_t pixmap /**< */,
201*0a6a1f1dSLionel Sambuc xcb_drawable_t drawable /**< */,
202*0a6a1f1dSLionel Sambuc uint32_t size /**< */,
203*0a6a1f1dSLionel Sambuc uint16_t width /**< */,
204*0a6a1f1dSLionel Sambuc uint16_t height /**< */,
205*0a6a1f1dSLionel Sambuc uint16_t stride /**< */,
206*0a6a1f1dSLionel Sambuc uint8_t depth /**< */,
207*0a6a1f1dSLionel Sambuc uint8_t bpp /**< */,
208*0a6a1f1dSLionel Sambuc int32_t pixmap_fd /**< */)
209*0a6a1f1dSLionel Sambuc {
210*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
211*0a6a1f1dSLionel Sambuc /* count */ 2,
212*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
213*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_PIXMAP_FROM_BUFFER,
214*0a6a1f1dSLionel Sambuc /* isvoid */ 1
215*0a6a1f1dSLionel Sambuc };
216*0a6a1f1dSLionel Sambuc
217*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
218*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
219*0a6a1f1dSLionel Sambuc xcb_dri3_pixmap_from_buffer_request_t xcb_out;
220*0a6a1f1dSLionel Sambuc
221*0a6a1f1dSLionel Sambuc xcb_out.pixmap = pixmap;
222*0a6a1f1dSLionel Sambuc xcb_out.drawable = drawable;
223*0a6a1f1dSLionel Sambuc xcb_out.size = size;
224*0a6a1f1dSLionel Sambuc xcb_out.width = width;
225*0a6a1f1dSLionel Sambuc xcb_out.height = height;
226*0a6a1f1dSLionel Sambuc xcb_out.stride = stride;
227*0a6a1f1dSLionel Sambuc xcb_out.depth = depth;
228*0a6a1f1dSLionel Sambuc xcb_out.bpp = bpp;
229*0a6a1f1dSLionel Sambuc
230*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
231*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
232*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
233*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
234*0a6a1f1dSLionel Sambuc
235*0a6a1f1dSLionel Sambuc xcb_send_fd(c, pixmap_fd);
236*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
237*0a6a1f1dSLionel Sambuc return xcb_ret;
238*0a6a1f1dSLionel Sambuc }
239*0a6a1f1dSLionel Sambuc
240*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_cookie_t
xcb_dri3_buffer_from_pixmap(xcb_connection_t * c,xcb_pixmap_t pixmap)241*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap (xcb_connection_t *c /**< */,
242*0a6a1f1dSLionel Sambuc xcb_pixmap_t pixmap /**< */)
243*0a6a1f1dSLionel Sambuc {
244*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
245*0a6a1f1dSLionel Sambuc /* count */ 2,
246*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
247*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_BUFFER_FROM_PIXMAP,
248*0a6a1f1dSLionel Sambuc /* isvoid */ 0
249*0a6a1f1dSLionel Sambuc };
250*0a6a1f1dSLionel Sambuc
251*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
252*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_cookie_t xcb_ret;
253*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_request_t xcb_out;
254*0a6a1f1dSLionel Sambuc
255*0a6a1f1dSLionel Sambuc xcb_out.pixmap = pixmap;
256*0a6a1f1dSLionel Sambuc
257*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
258*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
259*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
260*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
261*0a6a1f1dSLionel Sambuc
262*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED|XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
263*0a6a1f1dSLionel Sambuc return xcb_ret;
264*0a6a1f1dSLionel Sambuc }
265*0a6a1f1dSLionel Sambuc
266*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_cookie_t
xcb_dri3_buffer_from_pixmap_unchecked(xcb_connection_t * c,xcb_pixmap_t pixmap)267*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_unchecked (xcb_connection_t *c /**< */,
268*0a6a1f1dSLionel Sambuc xcb_pixmap_t pixmap /**< */)
269*0a6a1f1dSLionel Sambuc {
270*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
271*0a6a1f1dSLionel Sambuc /* count */ 2,
272*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
273*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_BUFFER_FROM_PIXMAP,
274*0a6a1f1dSLionel Sambuc /* isvoid */ 0
275*0a6a1f1dSLionel Sambuc };
276*0a6a1f1dSLionel Sambuc
277*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
278*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_cookie_t xcb_ret;
279*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_request_t xcb_out;
280*0a6a1f1dSLionel Sambuc
281*0a6a1f1dSLionel Sambuc xcb_out.pixmap = pixmap;
282*0a6a1f1dSLionel Sambuc
283*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
284*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
285*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
286*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
287*0a6a1f1dSLionel Sambuc
288*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
289*0a6a1f1dSLionel Sambuc return xcb_ret;
290*0a6a1f1dSLionel Sambuc }
291*0a6a1f1dSLionel Sambuc
292*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_reply_t *
xcb_dri3_buffer_from_pixmap_reply(xcb_connection_t * c,xcb_dri3_buffer_from_pixmap_cookie_t cookie,xcb_generic_error_t ** e)293*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_reply (xcb_connection_t *c /**< */,
294*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_cookie_t cookie /**< */,
295*0a6a1f1dSLionel Sambuc xcb_generic_error_t **e /**< */)
296*0a6a1f1dSLionel Sambuc {
297*0a6a1f1dSLionel Sambuc return (xcb_dri3_buffer_from_pixmap_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
298*0a6a1f1dSLionel Sambuc }
299*0a6a1f1dSLionel Sambuc
300*0a6a1f1dSLionel Sambuc int *
xcb_dri3_buffer_from_pixmap_reply_fds(xcb_connection_t * c,xcb_dri3_buffer_from_pixmap_reply_t * reply)301*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_reply_fds (xcb_connection_t *c /**< */,
302*0a6a1f1dSLionel Sambuc xcb_dri3_buffer_from_pixmap_reply_t *reply /**< */)
303*0a6a1f1dSLionel Sambuc {
304*0a6a1f1dSLionel Sambuc return xcb_get_reply_fds(c, reply, sizeof(xcb_dri3_buffer_from_pixmap_reply_t) + 4 * reply->length);
305*0a6a1f1dSLionel Sambuc }
306*0a6a1f1dSLionel Sambuc
307*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_dri3_fence_from_fd_checked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t fence,uint8_t initially_triggered,int32_t fence_fd)308*0a6a1f1dSLionel Sambuc xcb_dri3_fence_from_fd_checked (xcb_connection_t *c /**< */,
309*0a6a1f1dSLionel Sambuc xcb_drawable_t drawable /**< */,
310*0a6a1f1dSLionel Sambuc uint32_t fence /**< */,
311*0a6a1f1dSLionel Sambuc uint8_t initially_triggered /**< */,
312*0a6a1f1dSLionel Sambuc int32_t fence_fd /**< */)
313*0a6a1f1dSLionel Sambuc {
314*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
315*0a6a1f1dSLionel Sambuc /* count */ 2,
316*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
317*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_FENCE_FROM_FD,
318*0a6a1f1dSLionel Sambuc /* isvoid */ 1
319*0a6a1f1dSLionel Sambuc };
320*0a6a1f1dSLionel Sambuc
321*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
322*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
323*0a6a1f1dSLionel Sambuc xcb_dri3_fence_from_fd_request_t xcb_out;
324*0a6a1f1dSLionel Sambuc
325*0a6a1f1dSLionel Sambuc xcb_out.drawable = drawable;
326*0a6a1f1dSLionel Sambuc xcb_out.fence = fence;
327*0a6a1f1dSLionel Sambuc xcb_out.initially_triggered = initially_triggered;
328*0a6a1f1dSLionel Sambuc memset(xcb_out.pad0, 0, 3);
329*0a6a1f1dSLionel Sambuc
330*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
331*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
332*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
333*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
334*0a6a1f1dSLionel Sambuc
335*0a6a1f1dSLionel Sambuc xcb_send_fd(c, fence_fd);
336*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
337*0a6a1f1dSLionel Sambuc return xcb_ret;
338*0a6a1f1dSLionel Sambuc }
339*0a6a1f1dSLionel Sambuc
340*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_dri3_fence_from_fd(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t fence,uint8_t initially_triggered,int32_t fence_fd)341*0a6a1f1dSLionel Sambuc xcb_dri3_fence_from_fd (xcb_connection_t *c /**< */,
342*0a6a1f1dSLionel Sambuc xcb_drawable_t drawable /**< */,
343*0a6a1f1dSLionel Sambuc uint32_t fence /**< */,
344*0a6a1f1dSLionel Sambuc uint8_t initially_triggered /**< */,
345*0a6a1f1dSLionel Sambuc int32_t fence_fd /**< */)
346*0a6a1f1dSLionel Sambuc {
347*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
348*0a6a1f1dSLionel Sambuc /* count */ 2,
349*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
350*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_FENCE_FROM_FD,
351*0a6a1f1dSLionel Sambuc /* isvoid */ 1
352*0a6a1f1dSLionel Sambuc };
353*0a6a1f1dSLionel Sambuc
354*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
355*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
356*0a6a1f1dSLionel Sambuc xcb_dri3_fence_from_fd_request_t xcb_out;
357*0a6a1f1dSLionel Sambuc
358*0a6a1f1dSLionel Sambuc xcb_out.drawable = drawable;
359*0a6a1f1dSLionel Sambuc xcb_out.fence = fence;
360*0a6a1f1dSLionel Sambuc xcb_out.initially_triggered = initially_triggered;
361*0a6a1f1dSLionel Sambuc memset(xcb_out.pad0, 0, 3);
362*0a6a1f1dSLionel Sambuc
363*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
364*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
365*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
366*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
367*0a6a1f1dSLionel Sambuc
368*0a6a1f1dSLionel Sambuc xcb_send_fd(c, fence_fd);
369*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
370*0a6a1f1dSLionel Sambuc return xcb_ret;
371*0a6a1f1dSLionel Sambuc }
372*0a6a1f1dSLionel Sambuc
373*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_cookie_t
xcb_dri3_fd_from_fence(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t fence)374*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence (xcb_connection_t *c /**< */,
375*0a6a1f1dSLionel Sambuc xcb_drawable_t drawable /**< */,
376*0a6a1f1dSLionel Sambuc uint32_t fence /**< */)
377*0a6a1f1dSLionel Sambuc {
378*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
379*0a6a1f1dSLionel Sambuc /* count */ 2,
380*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
381*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_FD_FROM_FENCE,
382*0a6a1f1dSLionel Sambuc /* isvoid */ 0
383*0a6a1f1dSLionel Sambuc };
384*0a6a1f1dSLionel Sambuc
385*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
386*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_cookie_t xcb_ret;
387*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_request_t xcb_out;
388*0a6a1f1dSLionel Sambuc
389*0a6a1f1dSLionel Sambuc xcb_out.drawable = drawable;
390*0a6a1f1dSLionel Sambuc xcb_out.fence = fence;
391*0a6a1f1dSLionel Sambuc
392*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
393*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
394*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
395*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
396*0a6a1f1dSLionel Sambuc
397*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED|XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
398*0a6a1f1dSLionel Sambuc return xcb_ret;
399*0a6a1f1dSLionel Sambuc }
400*0a6a1f1dSLionel Sambuc
401*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_cookie_t
xcb_dri3_fd_from_fence_unchecked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t fence)402*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_unchecked (xcb_connection_t *c /**< */,
403*0a6a1f1dSLionel Sambuc xcb_drawable_t drawable /**< */,
404*0a6a1f1dSLionel Sambuc uint32_t fence /**< */)
405*0a6a1f1dSLionel Sambuc {
406*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
407*0a6a1f1dSLionel Sambuc /* count */ 2,
408*0a6a1f1dSLionel Sambuc /* ext */ &xcb_dri3_id,
409*0a6a1f1dSLionel Sambuc /* opcode */ XCB_DRI3_FD_FROM_FENCE,
410*0a6a1f1dSLionel Sambuc /* isvoid */ 0
411*0a6a1f1dSLionel Sambuc };
412*0a6a1f1dSLionel Sambuc
413*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
414*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_cookie_t xcb_ret;
415*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_request_t xcb_out;
416*0a6a1f1dSLionel Sambuc
417*0a6a1f1dSLionel Sambuc xcb_out.drawable = drawable;
418*0a6a1f1dSLionel Sambuc xcb_out.fence = fence;
419*0a6a1f1dSLionel Sambuc
420*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
421*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
422*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
423*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
424*0a6a1f1dSLionel Sambuc
425*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
426*0a6a1f1dSLionel Sambuc return xcb_ret;
427*0a6a1f1dSLionel Sambuc }
428*0a6a1f1dSLionel Sambuc
429*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_reply_t *
xcb_dri3_fd_from_fence_reply(xcb_connection_t * c,xcb_dri3_fd_from_fence_cookie_t cookie,xcb_generic_error_t ** e)430*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_reply (xcb_connection_t *c /**< */,
431*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_cookie_t cookie /**< */,
432*0a6a1f1dSLionel Sambuc xcb_generic_error_t **e /**< */)
433*0a6a1f1dSLionel Sambuc {
434*0a6a1f1dSLionel Sambuc return (xcb_dri3_fd_from_fence_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
435*0a6a1f1dSLionel Sambuc }
436*0a6a1f1dSLionel Sambuc
437*0a6a1f1dSLionel Sambuc int *
xcb_dri3_fd_from_fence_reply_fds(xcb_connection_t * c,xcb_dri3_fd_from_fence_reply_t * reply)438*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_reply_fds (xcb_connection_t *c /**< */,
439*0a6a1f1dSLionel Sambuc xcb_dri3_fd_from_fence_reply_t *reply /**< */)
440*0a6a1f1dSLionel Sambuc {
441*0a6a1f1dSLionel Sambuc return xcb_get_reply_fds(c, reply, sizeof(xcb_dri3_fd_from_fence_reply_t) + 4 * reply->length);
442*0a6a1f1dSLionel Sambuc }
443*0a6a1f1dSLionel Sambuc
444