etc/protocols - sync with NetBSD-8
[minix.git] / external / mit / xorg / lib / libxcb / files / dri3.c
blob10f2df409ac7069f9f8aee7a762035ce888fbe6e
1 /*
2 * This file generated automatically from dri3.xml by c_client.py.
3 * Edit at your peril.
4 */
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9 #include <stdlib.h>
10 #include <string.h>
11 #include <assert.h>
12 #include <stddef.h> /* for offsetof() */
13 #include "xcbext.h"
14 #include "dri3.h"
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
19 xcb_extension_t xcb_dri3_id = { "DRI3", 0 };
21 xcb_dri3_query_version_cookie_t
22 xcb_dri3_query_version (xcb_connection_t *c /**< */,
23 uint32_t major_version /**< */,
24 uint32_t minor_version /**< */)
26 static const xcb_protocol_request_t xcb_req = {
27 /* count */ 2,
28 /* ext */ &xcb_dri3_id,
29 /* opcode */ XCB_DRI3_QUERY_VERSION,
30 /* isvoid */ 0
33 struct iovec xcb_parts[4];
34 xcb_dri3_query_version_cookie_t xcb_ret;
35 xcb_dri3_query_version_request_t xcb_out;
37 xcb_out.major_version = major_version;
38 xcb_out.minor_version = minor_version;
40 xcb_parts[2].iov_base = (char *) &xcb_out;
41 xcb_parts[2].iov_len = sizeof(xcb_out);
42 xcb_parts[3].iov_base = 0;
43 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
45 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
46 return xcb_ret;
49 xcb_dri3_query_version_cookie_t
50 xcb_dri3_query_version_unchecked (xcb_connection_t *c /**< */,
51 uint32_t major_version /**< */,
52 uint32_t minor_version /**< */)
54 static const xcb_protocol_request_t xcb_req = {
55 /* count */ 2,
56 /* ext */ &xcb_dri3_id,
57 /* opcode */ XCB_DRI3_QUERY_VERSION,
58 /* isvoid */ 0
61 struct iovec xcb_parts[4];
62 xcb_dri3_query_version_cookie_t xcb_ret;
63 xcb_dri3_query_version_request_t xcb_out;
65 xcb_out.major_version = major_version;
66 xcb_out.minor_version = minor_version;
68 xcb_parts[2].iov_base = (char *) &xcb_out;
69 xcb_parts[2].iov_len = sizeof(xcb_out);
70 xcb_parts[3].iov_base = 0;
71 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
73 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
74 return xcb_ret;
77 xcb_dri3_query_version_reply_t *
78 xcb_dri3_query_version_reply (xcb_connection_t *c /**< */,
79 xcb_dri3_query_version_cookie_t cookie /**< */,
80 xcb_generic_error_t **e /**< */)
82 return (xcb_dri3_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
85 xcb_dri3_open_cookie_t
86 xcb_dri3_open (xcb_connection_t *c /**< */,
87 xcb_drawable_t drawable /**< */,
88 uint32_t provider /**< */)
90 static const xcb_protocol_request_t xcb_req = {
91 /* count */ 2,
92 /* ext */ &xcb_dri3_id,
93 /* opcode */ XCB_DRI3_OPEN,
94 /* isvoid */ 0
97 struct iovec xcb_parts[4];
98 xcb_dri3_open_cookie_t xcb_ret;
99 xcb_dri3_open_request_t xcb_out;
101 xcb_out.drawable = drawable;
102 xcb_out.provider = provider;
104 xcb_parts[2].iov_base = (char *) &xcb_out;
105 xcb_parts[2].iov_len = sizeof(xcb_out);
106 xcb_parts[3].iov_base = 0;
107 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
109 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED|XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
110 return xcb_ret;
113 xcb_dri3_open_cookie_t
114 xcb_dri3_open_unchecked (xcb_connection_t *c /**< */,
115 xcb_drawable_t drawable /**< */,
116 uint32_t provider /**< */)
118 static const xcb_protocol_request_t xcb_req = {
119 /* count */ 2,
120 /* ext */ &xcb_dri3_id,
121 /* opcode */ XCB_DRI3_OPEN,
122 /* isvoid */ 0
125 struct iovec xcb_parts[4];
126 xcb_dri3_open_cookie_t xcb_ret;
127 xcb_dri3_open_request_t xcb_out;
129 xcb_out.drawable = drawable;
130 xcb_out.provider = provider;
132 xcb_parts[2].iov_base = (char *) &xcb_out;
133 xcb_parts[2].iov_len = sizeof(xcb_out);
134 xcb_parts[3].iov_base = 0;
135 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
137 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
138 return xcb_ret;
141 xcb_dri3_open_reply_t *
142 xcb_dri3_open_reply (xcb_connection_t *c /**< */,
143 xcb_dri3_open_cookie_t cookie /**< */,
144 xcb_generic_error_t **e /**< */)
146 return (xcb_dri3_open_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
149 int *
150 xcb_dri3_open_reply_fds (xcb_connection_t *c /**< */,
151 xcb_dri3_open_reply_t *reply /**< */)
153 return xcb_get_reply_fds(c, reply, sizeof(xcb_dri3_open_reply_t) + 4 * reply->length);
156 xcb_void_cookie_t
157 xcb_dri3_pixmap_from_buffer_checked (xcb_connection_t *c /**< */,
158 xcb_pixmap_t pixmap /**< */,
159 xcb_drawable_t drawable /**< */,
160 uint32_t size /**< */,
161 uint16_t width /**< */,
162 uint16_t height /**< */,
163 uint16_t stride /**< */,
164 uint8_t depth /**< */,
165 uint8_t bpp /**< */,
166 int32_t pixmap_fd /**< */)
168 static const xcb_protocol_request_t xcb_req = {
169 /* count */ 2,
170 /* ext */ &xcb_dri3_id,
171 /* opcode */ XCB_DRI3_PIXMAP_FROM_BUFFER,
172 /* isvoid */ 1
175 struct iovec xcb_parts[4];
176 xcb_void_cookie_t xcb_ret;
177 xcb_dri3_pixmap_from_buffer_request_t xcb_out;
179 xcb_out.pixmap = pixmap;
180 xcb_out.drawable = drawable;
181 xcb_out.size = size;
182 xcb_out.width = width;
183 xcb_out.height = height;
184 xcb_out.stride = stride;
185 xcb_out.depth = depth;
186 xcb_out.bpp = bpp;
188 xcb_parts[2].iov_base = (char *) &xcb_out;
189 xcb_parts[2].iov_len = sizeof(xcb_out);
190 xcb_parts[3].iov_base = 0;
191 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
193 xcb_send_fd(c, pixmap_fd);
194 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
195 return xcb_ret;
198 xcb_void_cookie_t
199 xcb_dri3_pixmap_from_buffer (xcb_connection_t *c /**< */,
200 xcb_pixmap_t pixmap /**< */,
201 xcb_drawable_t drawable /**< */,
202 uint32_t size /**< */,
203 uint16_t width /**< */,
204 uint16_t height /**< */,
205 uint16_t stride /**< */,
206 uint8_t depth /**< */,
207 uint8_t bpp /**< */,
208 int32_t pixmap_fd /**< */)
210 static const xcb_protocol_request_t xcb_req = {
211 /* count */ 2,
212 /* ext */ &xcb_dri3_id,
213 /* opcode */ XCB_DRI3_PIXMAP_FROM_BUFFER,
214 /* isvoid */ 1
217 struct iovec xcb_parts[4];
218 xcb_void_cookie_t xcb_ret;
219 xcb_dri3_pixmap_from_buffer_request_t xcb_out;
221 xcb_out.pixmap = pixmap;
222 xcb_out.drawable = drawable;
223 xcb_out.size = size;
224 xcb_out.width = width;
225 xcb_out.height = height;
226 xcb_out.stride = stride;
227 xcb_out.depth = depth;
228 xcb_out.bpp = bpp;
230 xcb_parts[2].iov_base = (char *) &xcb_out;
231 xcb_parts[2].iov_len = sizeof(xcb_out);
232 xcb_parts[3].iov_base = 0;
233 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
235 xcb_send_fd(c, pixmap_fd);
236 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
237 return xcb_ret;
240 xcb_dri3_buffer_from_pixmap_cookie_t
241 xcb_dri3_buffer_from_pixmap (xcb_connection_t *c /**< */,
242 xcb_pixmap_t pixmap /**< */)
244 static const xcb_protocol_request_t xcb_req = {
245 /* count */ 2,
246 /* ext */ &xcb_dri3_id,
247 /* opcode */ XCB_DRI3_BUFFER_FROM_PIXMAP,
248 /* isvoid */ 0
251 struct iovec xcb_parts[4];
252 xcb_dri3_buffer_from_pixmap_cookie_t xcb_ret;
253 xcb_dri3_buffer_from_pixmap_request_t xcb_out;
255 xcb_out.pixmap = pixmap;
257 xcb_parts[2].iov_base = (char *) &xcb_out;
258 xcb_parts[2].iov_len = sizeof(xcb_out);
259 xcb_parts[3].iov_base = 0;
260 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
262 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED|XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
263 return xcb_ret;
266 xcb_dri3_buffer_from_pixmap_cookie_t
267 xcb_dri3_buffer_from_pixmap_unchecked (xcb_connection_t *c /**< */,
268 xcb_pixmap_t pixmap /**< */)
270 static const xcb_protocol_request_t xcb_req = {
271 /* count */ 2,
272 /* ext */ &xcb_dri3_id,
273 /* opcode */ XCB_DRI3_BUFFER_FROM_PIXMAP,
274 /* isvoid */ 0
277 struct iovec xcb_parts[4];
278 xcb_dri3_buffer_from_pixmap_cookie_t xcb_ret;
279 xcb_dri3_buffer_from_pixmap_request_t xcb_out;
281 xcb_out.pixmap = pixmap;
283 xcb_parts[2].iov_base = (char *) &xcb_out;
284 xcb_parts[2].iov_len = sizeof(xcb_out);
285 xcb_parts[3].iov_base = 0;
286 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
288 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
289 return xcb_ret;
292 xcb_dri3_buffer_from_pixmap_reply_t *
293 xcb_dri3_buffer_from_pixmap_reply (xcb_connection_t *c /**< */,
294 xcb_dri3_buffer_from_pixmap_cookie_t cookie /**< */,
295 xcb_generic_error_t **e /**< */)
297 return (xcb_dri3_buffer_from_pixmap_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
300 int *
301 xcb_dri3_buffer_from_pixmap_reply_fds (xcb_connection_t *c /**< */,
302 xcb_dri3_buffer_from_pixmap_reply_t *reply /**< */)
304 return xcb_get_reply_fds(c, reply, sizeof(xcb_dri3_buffer_from_pixmap_reply_t) + 4 * reply->length);
307 xcb_void_cookie_t
308 xcb_dri3_fence_from_fd_checked (xcb_connection_t *c /**< */,
309 xcb_drawable_t drawable /**< */,
310 uint32_t fence /**< */,
311 uint8_t initially_triggered /**< */,
312 int32_t fence_fd /**< */)
314 static const xcb_protocol_request_t xcb_req = {
315 /* count */ 2,
316 /* ext */ &xcb_dri3_id,
317 /* opcode */ XCB_DRI3_FENCE_FROM_FD,
318 /* isvoid */ 1
321 struct iovec xcb_parts[4];
322 xcb_void_cookie_t xcb_ret;
323 xcb_dri3_fence_from_fd_request_t xcb_out;
325 xcb_out.drawable = drawable;
326 xcb_out.fence = fence;
327 xcb_out.initially_triggered = initially_triggered;
328 memset(xcb_out.pad0, 0, 3);
330 xcb_parts[2].iov_base = (char *) &xcb_out;
331 xcb_parts[2].iov_len = sizeof(xcb_out);
332 xcb_parts[3].iov_base = 0;
333 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
335 xcb_send_fd(c, fence_fd);
336 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
337 return xcb_ret;
340 xcb_void_cookie_t
341 xcb_dri3_fence_from_fd (xcb_connection_t *c /**< */,
342 xcb_drawable_t drawable /**< */,
343 uint32_t fence /**< */,
344 uint8_t initially_triggered /**< */,
345 int32_t fence_fd /**< */)
347 static const xcb_protocol_request_t xcb_req = {
348 /* count */ 2,
349 /* ext */ &xcb_dri3_id,
350 /* opcode */ XCB_DRI3_FENCE_FROM_FD,
351 /* isvoid */ 1
354 struct iovec xcb_parts[4];
355 xcb_void_cookie_t xcb_ret;
356 xcb_dri3_fence_from_fd_request_t xcb_out;
358 xcb_out.drawable = drawable;
359 xcb_out.fence = fence;
360 xcb_out.initially_triggered = initially_triggered;
361 memset(xcb_out.pad0, 0, 3);
363 xcb_parts[2].iov_base = (char *) &xcb_out;
364 xcb_parts[2].iov_len = sizeof(xcb_out);
365 xcb_parts[3].iov_base = 0;
366 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
368 xcb_send_fd(c, fence_fd);
369 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
370 return xcb_ret;
373 xcb_dri3_fd_from_fence_cookie_t
374 xcb_dri3_fd_from_fence (xcb_connection_t *c /**< */,
375 xcb_drawable_t drawable /**< */,
376 uint32_t fence /**< */)
378 static const xcb_protocol_request_t xcb_req = {
379 /* count */ 2,
380 /* ext */ &xcb_dri3_id,
381 /* opcode */ XCB_DRI3_FD_FROM_FENCE,
382 /* isvoid */ 0
385 struct iovec xcb_parts[4];
386 xcb_dri3_fd_from_fence_cookie_t xcb_ret;
387 xcb_dri3_fd_from_fence_request_t xcb_out;
389 xcb_out.drawable = drawable;
390 xcb_out.fence = fence;
392 xcb_parts[2].iov_base = (char *) &xcb_out;
393 xcb_parts[2].iov_len = sizeof(xcb_out);
394 xcb_parts[3].iov_base = 0;
395 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
397 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED|XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
398 return xcb_ret;
401 xcb_dri3_fd_from_fence_cookie_t
402 xcb_dri3_fd_from_fence_unchecked (xcb_connection_t *c /**< */,
403 xcb_drawable_t drawable /**< */,
404 uint32_t fence /**< */)
406 static const xcb_protocol_request_t xcb_req = {
407 /* count */ 2,
408 /* ext */ &xcb_dri3_id,
409 /* opcode */ XCB_DRI3_FD_FROM_FENCE,
410 /* isvoid */ 0
413 struct iovec xcb_parts[4];
414 xcb_dri3_fd_from_fence_cookie_t xcb_ret;
415 xcb_dri3_fd_from_fence_request_t xcb_out;
417 xcb_out.drawable = drawable;
418 xcb_out.fence = fence;
420 xcb_parts[2].iov_base = (char *) &xcb_out;
421 xcb_parts[2].iov_len = sizeof(xcb_out);
422 xcb_parts[3].iov_base = 0;
423 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
425 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req);
426 return xcb_ret;
429 xcb_dri3_fd_from_fence_reply_t *
430 xcb_dri3_fd_from_fence_reply (xcb_connection_t *c /**< */,
431 xcb_dri3_fd_from_fence_cookie_t cookie /**< */,
432 xcb_generic_error_t **e /**< */)
434 return (xcb_dri3_fd_from_fence_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
437 int *
438 xcb_dri3_fd_from_fence_reply_fds (xcb_connection_t *c /**< */,
439 xcb_dri3_fd_from_fence_reply_t *reply /**< */)
441 return xcb_get_reply_fds(c, reply, sizeof(xcb_dri3_fd_from_fence_reply_t) + 4 * reply->length);