xref: /netbsd-src/external/mit/xorg/lib/libxcb/files/dri2.c (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1 /*
2  * This file generated automatically from dri2.xml by c_client.py.
3  * Edit at your peril.
4  */
5 
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 "dri2.h"
15 
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
18 
19 xcb_extension_t xcb_dri2_id = { "DRI2", 0 };
20 
21 
22 /*****************************************************************************
23  **
24  ** void xcb_dri2_dri2_buffer_next
25  **
26  ** @param xcb_dri2_dri2_buffer_iterator_t *i
27  ** @returns void
28  **
29  *****************************************************************************/
30 
31 void
32 xcb_dri2_dri2_buffer_next (xcb_dri2_dri2_buffer_iterator_t *i  /**< */)
33 {
34     --i->rem;
35     ++i->data;
36     i->index += sizeof(xcb_dri2_dri2_buffer_t);
37 }
38 
39 
40 /*****************************************************************************
41  **
42  ** xcb_generic_iterator_t xcb_dri2_dri2_buffer_end
43  **
44  ** @param xcb_dri2_dri2_buffer_iterator_t i
45  ** @returns xcb_generic_iterator_t
46  **
47  *****************************************************************************/
48 
49 xcb_generic_iterator_t
50 xcb_dri2_dri2_buffer_end (xcb_dri2_dri2_buffer_iterator_t i  /**< */)
51 {
52     xcb_generic_iterator_t ret;
53     ret.data = i.data + i.rem;
54     ret.index = i.index + ((char *) ret.data - (char *) i.data);
55     ret.rem = 0;
56     return ret;
57 }
58 
59 
60 /*****************************************************************************
61  **
62  ** void xcb_dri2_attach_format_next
63  **
64  ** @param xcb_dri2_attach_format_iterator_t *i
65  ** @returns void
66  **
67  *****************************************************************************/
68 
69 void
70 xcb_dri2_attach_format_next (xcb_dri2_attach_format_iterator_t *i  /**< */)
71 {
72     --i->rem;
73     ++i->data;
74     i->index += sizeof(xcb_dri2_attach_format_t);
75 }
76 
77 
78 /*****************************************************************************
79  **
80  ** xcb_generic_iterator_t xcb_dri2_attach_format_end
81  **
82  ** @param xcb_dri2_attach_format_iterator_t i
83  ** @returns xcb_generic_iterator_t
84  **
85  *****************************************************************************/
86 
87 xcb_generic_iterator_t
88 xcb_dri2_attach_format_end (xcb_dri2_attach_format_iterator_t i  /**< */)
89 {
90     xcb_generic_iterator_t ret;
91     ret.data = i.data + i.rem;
92     ret.index = i.index + ((char *) ret.data - (char *) i.data);
93     ret.rem = 0;
94     return ret;
95 }
96 
97 
98 /*****************************************************************************
99  **
100  ** xcb_dri2_query_version_cookie_t xcb_dri2_query_version
101  **
102  ** @param xcb_connection_t *c
103  ** @param uint32_t          major_version
104  ** @param uint32_t          minor_version
105  ** @returns xcb_dri2_query_version_cookie_t
106  **
107  *****************************************************************************/
108 
109 xcb_dri2_query_version_cookie_t
110 xcb_dri2_query_version (xcb_connection_t *c  /**< */,
111                         uint32_t          major_version  /**< */,
112                         uint32_t          minor_version  /**< */)
113 {
114     static const xcb_protocol_request_t xcb_req = {
115         /* count */ 2,
116         /* ext */ &xcb_dri2_id,
117         /* opcode */ XCB_DRI2_QUERY_VERSION,
118         /* isvoid */ 0
119     };
120 
121     struct iovec xcb_parts[4];
122     xcb_dri2_query_version_cookie_t xcb_ret;
123     xcb_dri2_query_version_request_t xcb_out;
124 
125     xcb_out.major_version = major_version;
126     xcb_out.minor_version = minor_version;
127 
128     xcb_parts[2].iov_base = (char *) &xcb_out;
129     xcb_parts[2].iov_len = sizeof(xcb_out);
130     xcb_parts[3].iov_base = 0;
131     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
132 
133     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
134     return xcb_ret;
135 }
136 
137 
138 /*****************************************************************************
139  **
140  ** xcb_dri2_query_version_cookie_t xcb_dri2_query_version_unchecked
141  **
142  ** @param xcb_connection_t *c
143  ** @param uint32_t          major_version
144  ** @param uint32_t          minor_version
145  ** @returns xcb_dri2_query_version_cookie_t
146  **
147  *****************************************************************************/
148 
149 xcb_dri2_query_version_cookie_t
150 xcb_dri2_query_version_unchecked (xcb_connection_t *c  /**< */,
151                                   uint32_t          major_version  /**< */,
152                                   uint32_t          minor_version  /**< */)
153 {
154     static const xcb_protocol_request_t xcb_req = {
155         /* count */ 2,
156         /* ext */ &xcb_dri2_id,
157         /* opcode */ XCB_DRI2_QUERY_VERSION,
158         /* isvoid */ 0
159     };
160 
161     struct iovec xcb_parts[4];
162     xcb_dri2_query_version_cookie_t xcb_ret;
163     xcb_dri2_query_version_request_t xcb_out;
164 
165     xcb_out.major_version = major_version;
166     xcb_out.minor_version = minor_version;
167 
168     xcb_parts[2].iov_base = (char *) &xcb_out;
169     xcb_parts[2].iov_len = sizeof(xcb_out);
170     xcb_parts[3].iov_base = 0;
171     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
172 
173     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
174     return xcb_ret;
175 }
176 
177 
178 /*****************************************************************************
179  **
180  ** xcb_dri2_query_version_reply_t * xcb_dri2_query_version_reply
181  **
182  ** @param xcb_connection_t                 *c
183  ** @param xcb_dri2_query_version_cookie_t   cookie
184  ** @param xcb_generic_error_t             **e
185  ** @returns xcb_dri2_query_version_reply_t *
186  **
187  *****************************************************************************/
188 
189 xcb_dri2_query_version_reply_t *
190 xcb_dri2_query_version_reply (xcb_connection_t                 *c  /**< */,
191                               xcb_dri2_query_version_cookie_t   cookie  /**< */,
192                               xcb_generic_error_t             **e  /**< */)
193 {
194     return (xcb_dri2_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
195 }
196 
197 int
198 xcb_dri2_connect_sizeof (const void  *_buffer  /**< */)
199 {
200     char *xcb_tmp = (char *)_buffer;
201     const xcb_dri2_connect_reply_t *_aux = (xcb_dri2_connect_reply_t *)_buffer;
202     unsigned int xcb_buffer_len = 0;
203     unsigned int xcb_block_len = 0;
204     unsigned int xcb_pad = 0;
205     unsigned int xcb_align_to = 0;
206 
207 
208     xcb_block_len += sizeof(xcb_dri2_connect_reply_t);
209     xcb_tmp += xcb_block_len;
210     xcb_buffer_len += xcb_block_len;
211     xcb_block_len = 0;
212     /* driver_name */
213     xcb_block_len += _aux->driver_name_length * sizeof(char);
214     xcb_tmp += xcb_block_len;
215     xcb_align_to = ALIGNOF(char);
216     /* insert padding */
217     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
218     xcb_buffer_len += xcb_block_len + xcb_pad;
219     if (0 != xcb_pad) {
220         xcb_tmp += xcb_pad;
221         xcb_pad = 0;
222     }
223     xcb_block_len = 0;
224     /* alignment_pad */
225     xcb_block_len += (((_aux->driver_name_length + 3) & (~3)) - _aux->driver_name_length) * sizeof(char);
226     xcb_tmp += xcb_block_len;
227     xcb_align_to = ALIGNOF(char);
228     /* insert padding */
229     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
230     xcb_buffer_len += xcb_block_len + xcb_pad;
231     if (0 != xcb_pad) {
232         xcb_tmp += xcb_pad;
233         xcb_pad = 0;
234     }
235     xcb_block_len = 0;
236     /* device_name */
237     xcb_block_len += _aux->device_name_length * sizeof(char);
238     xcb_tmp += xcb_block_len;
239     xcb_align_to = ALIGNOF(char);
240     /* insert padding */
241     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
242     xcb_buffer_len += xcb_block_len + xcb_pad;
243     if (0 != xcb_pad) {
244         xcb_tmp += xcb_pad;
245         xcb_pad = 0;
246     }
247     xcb_block_len = 0;
248 
249     return xcb_buffer_len;
250 }
251 
252 
253 /*****************************************************************************
254  **
255  ** xcb_dri2_connect_cookie_t xcb_dri2_connect
256  **
257  ** @param xcb_connection_t *c
258  ** @param xcb_window_t      window
259  ** @param uint32_t          driver_type
260  ** @returns xcb_dri2_connect_cookie_t
261  **
262  *****************************************************************************/
263 
264 xcb_dri2_connect_cookie_t
265 xcb_dri2_connect (xcb_connection_t *c  /**< */,
266                   xcb_window_t      window  /**< */,
267                   uint32_t          driver_type  /**< */)
268 {
269     static const xcb_protocol_request_t xcb_req = {
270         /* count */ 2,
271         /* ext */ &xcb_dri2_id,
272         /* opcode */ XCB_DRI2_CONNECT,
273         /* isvoid */ 0
274     };
275 
276     struct iovec xcb_parts[4];
277     xcb_dri2_connect_cookie_t xcb_ret;
278     xcb_dri2_connect_request_t xcb_out;
279 
280     xcb_out.window = window;
281     xcb_out.driver_type = driver_type;
282 
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;
287 
288     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
289     return xcb_ret;
290 }
291 
292 
293 /*****************************************************************************
294  **
295  ** xcb_dri2_connect_cookie_t xcb_dri2_connect_unchecked
296  **
297  ** @param xcb_connection_t *c
298  ** @param xcb_window_t      window
299  ** @param uint32_t          driver_type
300  ** @returns xcb_dri2_connect_cookie_t
301  **
302  *****************************************************************************/
303 
304 xcb_dri2_connect_cookie_t
305 xcb_dri2_connect_unchecked (xcb_connection_t *c  /**< */,
306                             xcb_window_t      window  /**< */,
307                             uint32_t          driver_type  /**< */)
308 {
309     static const xcb_protocol_request_t xcb_req = {
310         /* count */ 2,
311         /* ext */ &xcb_dri2_id,
312         /* opcode */ XCB_DRI2_CONNECT,
313         /* isvoid */ 0
314     };
315 
316     struct iovec xcb_parts[4];
317     xcb_dri2_connect_cookie_t xcb_ret;
318     xcb_dri2_connect_request_t xcb_out;
319 
320     xcb_out.window = window;
321     xcb_out.driver_type = driver_type;
322 
323     xcb_parts[2].iov_base = (char *) &xcb_out;
324     xcb_parts[2].iov_len = sizeof(xcb_out);
325     xcb_parts[3].iov_base = 0;
326     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
327 
328     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
329     return xcb_ret;
330 }
331 
332 
333 /*****************************************************************************
334  **
335  ** char * xcb_dri2_connect_driver_name
336  **
337  ** @param const xcb_dri2_connect_reply_t *R
338  ** @returns char *
339  **
340  *****************************************************************************/
341 
342 char *
343 xcb_dri2_connect_driver_name (const xcb_dri2_connect_reply_t *R  /**< */)
344 {
345     return (char *) (R + 1);
346 }
347 
348 
349 /*****************************************************************************
350  **
351  ** int xcb_dri2_connect_driver_name_length
352  **
353  ** @param const xcb_dri2_connect_reply_t *R
354  ** @returns int
355  **
356  *****************************************************************************/
357 
358 int
359 xcb_dri2_connect_driver_name_length (const xcb_dri2_connect_reply_t *R  /**< */)
360 {
361     return R->driver_name_length;
362 }
363 
364 
365 /*****************************************************************************
366  **
367  ** xcb_generic_iterator_t xcb_dri2_connect_driver_name_end
368  **
369  ** @param const xcb_dri2_connect_reply_t *R
370  ** @returns xcb_generic_iterator_t
371  **
372  *****************************************************************************/
373 
374 xcb_generic_iterator_t
375 xcb_dri2_connect_driver_name_end (const xcb_dri2_connect_reply_t *R  /**< */)
376 {
377     xcb_generic_iterator_t i;
378     i.data = ((char *) (R + 1)) + (R->driver_name_length);
379     i.rem = 0;
380     i.index = (char *) i.data - (char *) R;
381     return i;
382 }
383 
384 
385 /*****************************************************************************
386  **
387  ** void * xcb_dri2_connect_alignment_pad
388  **
389  ** @param const xcb_dri2_connect_reply_t *R
390  ** @returns void *
391  **
392  *****************************************************************************/
393 
394 void *
395 xcb_dri2_connect_alignment_pad (const xcb_dri2_connect_reply_t *R  /**< */)
396 {
397     xcb_generic_iterator_t prev = xcb_dri2_connect_driver_name_end(R);
398     return (void *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
399 }
400 
401 
402 /*****************************************************************************
403  **
404  ** int xcb_dri2_connect_alignment_pad_length
405  **
406  ** @param const xcb_dri2_connect_reply_t *R
407  ** @returns int
408  **
409  *****************************************************************************/
410 
411 int
412 xcb_dri2_connect_alignment_pad_length (const xcb_dri2_connect_reply_t *R  /**< */)
413 {
414     return (((R->driver_name_length + 3) & (~3)) - R->driver_name_length);
415 }
416 
417 
418 /*****************************************************************************
419  **
420  ** xcb_generic_iterator_t xcb_dri2_connect_alignment_pad_end
421  **
422  ** @param const xcb_dri2_connect_reply_t *R
423  ** @returns xcb_generic_iterator_t
424  **
425  *****************************************************************************/
426 
427 xcb_generic_iterator_t
428 xcb_dri2_connect_alignment_pad_end (const xcb_dri2_connect_reply_t *R  /**< */)
429 {
430     xcb_generic_iterator_t i;
431     xcb_generic_iterator_t child = xcb_dri2_connect_driver_name_end(R);
432     i.data = ((char *) child.data) + ((((R->driver_name_length + 3) & (~3)) - R->driver_name_length));
433     i.rem = 0;
434     i.index = (char *) i.data - (char *) R;
435     return i;
436 }
437 
438 
439 /*****************************************************************************
440  **
441  ** char * xcb_dri2_connect_device_name
442  **
443  ** @param const xcb_dri2_connect_reply_t *R
444  ** @returns char *
445  **
446  *****************************************************************************/
447 
448 char *
449 xcb_dri2_connect_device_name (const xcb_dri2_connect_reply_t *R  /**< */)
450 {
451     xcb_generic_iterator_t prev = xcb_dri2_connect_alignment_pad_end(R);
452     return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
453 }
454 
455 
456 /*****************************************************************************
457  **
458  ** int xcb_dri2_connect_device_name_length
459  **
460  ** @param const xcb_dri2_connect_reply_t *R
461  ** @returns int
462  **
463  *****************************************************************************/
464 
465 int
466 xcb_dri2_connect_device_name_length (const xcb_dri2_connect_reply_t *R  /**< */)
467 {
468     return R->device_name_length;
469 }
470 
471 
472 /*****************************************************************************
473  **
474  ** xcb_generic_iterator_t xcb_dri2_connect_device_name_end
475  **
476  ** @param const xcb_dri2_connect_reply_t *R
477  ** @returns xcb_generic_iterator_t
478  **
479  *****************************************************************************/
480 
481 xcb_generic_iterator_t
482 xcb_dri2_connect_device_name_end (const xcb_dri2_connect_reply_t *R  /**< */)
483 {
484     xcb_generic_iterator_t i;
485     xcb_generic_iterator_t child = xcb_dri2_connect_alignment_pad_end(R);
486     i.data = ((char *) child.data) + (R->device_name_length);
487     i.rem = 0;
488     i.index = (char *) i.data - (char *) R;
489     return i;
490 }
491 
492 
493 /*****************************************************************************
494  **
495  ** xcb_dri2_connect_reply_t * xcb_dri2_connect_reply
496  **
497  ** @param xcb_connection_t           *c
498  ** @param xcb_dri2_connect_cookie_t   cookie
499  ** @param xcb_generic_error_t       **e
500  ** @returns xcb_dri2_connect_reply_t *
501  **
502  *****************************************************************************/
503 
504 xcb_dri2_connect_reply_t *
505 xcb_dri2_connect_reply (xcb_connection_t           *c  /**< */,
506                         xcb_dri2_connect_cookie_t   cookie  /**< */,
507                         xcb_generic_error_t       **e  /**< */)
508 {
509     return (xcb_dri2_connect_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
510 }
511 
512 
513 /*****************************************************************************
514  **
515  ** xcb_dri2_authenticate_cookie_t xcb_dri2_authenticate
516  **
517  ** @param xcb_connection_t *c
518  ** @param xcb_window_t      window
519  ** @param uint32_t          magic
520  ** @returns xcb_dri2_authenticate_cookie_t
521  **
522  *****************************************************************************/
523 
524 xcb_dri2_authenticate_cookie_t
525 xcb_dri2_authenticate (xcb_connection_t *c  /**< */,
526                        xcb_window_t      window  /**< */,
527                        uint32_t          magic  /**< */)
528 {
529     static const xcb_protocol_request_t xcb_req = {
530         /* count */ 2,
531         /* ext */ &xcb_dri2_id,
532         /* opcode */ XCB_DRI2_AUTHENTICATE,
533         /* isvoid */ 0
534     };
535 
536     struct iovec xcb_parts[4];
537     xcb_dri2_authenticate_cookie_t xcb_ret;
538     xcb_dri2_authenticate_request_t xcb_out;
539 
540     xcb_out.window = window;
541     xcb_out.magic = magic;
542 
543     xcb_parts[2].iov_base = (char *) &xcb_out;
544     xcb_parts[2].iov_len = sizeof(xcb_out);
545     xcb_parts[3].iov_base = 0;
546     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
547 
548     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
549     return xcb_ret;
550 }
551 
552 
553 /*****************************************************************************
554  **
555  ** xcb_dri2_authenticate_cookie_t xcb_dri2_authenticate_unchecked
556  **
557  ** @param xcb_connection_t *c
558  ** @param xcb_window_t      window
559  ** @param uint32_t          magic
560  ** @returns xcb_dri2_authenticate_cookie_t
561  **
562  *****************************************************************************/
563 
564 xcb_dri2_authenticate_cookie_t
565 xcb_dri2_authenticate_unchecked (xcb_connection_t *c  /**< */,
566                                  xcb_window_t      window  /**< */,
567                                  uint32_t          magic  /**< */)
568 {
569     static const xcb_protocol_request_t xcb_req = {
570         /* count */ 2,
571         /* ext */ &xcb_dri2_id,
572         /* opcode */ XCB_DRI2_AUTHENTICATE,
573         /* isvoid */ 0
574     };
575 
576     struct iovec xcb_parts[4];
577     xcb_dri2_authenticate_cookie_t xcb_ret;
578     xcb_dri2_authenticate_request_t xcb_out;
579 
580     xcb_out.window = window;
581     xcb_out.magic = magic;
582 
583     xcb_parts[2].iov_base = (char *) &xcb_out;
584     xcb_parts[2].iov_len = sizeof(xcb_out);
585     xcb_parts[3].iov_base = 0;
586     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
587 
588     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
589     return xcb_ret;
590 }
591 
592 
593 /*****************************************************************************
594  **
595  ** xcb_dri2_authenticate_reply_t * xcb_dri2_authenticate_reply
596  **
597  ** @param xcb_connection_t                *c
598  ** @param xcb_dri2_authenticate_cookie_t   cookie
599  ** @param xcb_generic_error_t            **e
600  ** @returns xcb_dri2_authenticate_reply_t *
601  **
602  *****************************************************************************/
603 
604 xcb_dri2_authenticate_reply_t *
605 xcb_dri2_authenticate_reply (xcb_connection_t                *c  /**< */,
606                              xcb_dri2_authenticate_cookie_t   cookie  /**< */,
607                              xcb_generic_error_t            **e  /**< */)
608 {
609     return (xcb_dri2_authenticate_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
610 }
611 
612 
613 /*****************************************************************************
614  **
615  ** xcb_void_cookie_t xcb_dri2_create_drawable_checked
616  **
617  ** @param xcb_connection_t *c
618  ** @param xcb_drawable_t    drawable
619  ** @returns xcb_void_cookie_t
620  **
621  *****************************************************************************/
622 
623 xcb_void_cookie_t
624 xcb_dri2_create_drawable_checked (xcb_connection_t *c  /**< */,
625                                   xcb_drawable_t    drawable  /**< */)
626 {
627     static const xcb_protocol_request_t xcb_req = {
628         /* count */ 2,
629         /* ext */ &xcb_dri2_id,
630         /* opcode */ XCB_DRI2_CREATE_DRAWABLE,
631         /* isvoid */ 1
632     };
633 
634     struct iovec xcb_parts[4];
635     xcb_void_cookie_t xcb_ret;
636     xcb_dri2_create_drawable_request_t xcb_out;
637 
638     xcb_out.drawable = drawable;
639 
640     xcb_parts[2].iov_base = (char *) &xcb_out;
641     xcb_parts[2].iov_len = sizeof(xcb_out);
642     xcb_parts[3].iov_base = 0;
643     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
644 
645     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
646     return xcb_ret;
647 }
648 
649 
650 /*****************************************************************************
651  **
652  ** xcb_void_cookie_t xcb_dri2_create_drawable
653  **
654  ** @param xcb_connection_t *c
655  ** @param xcb_drawable_t    drawable
656  ** @returns xcb_void_cookie_t
657  **
658  *****************************************************************************/
659 
660 xcb_void_cookie_t
661 xcb_dri2_create_drawable (xcb_connection_t *c  /**< */,
662                           xcb_drawable_t    drawable  /**< */)
663 {
664     static const xcb_protocol_request_t xcb_req = {
665         /* count */ 2,
666         /* ext */ &xcb_dri2_id,
667         /* opcode */ XCB_DRI2_CREATE_DRAWABLE,
668         /* isvoid */ 1
669     };
670 
671     struct iovec xcb_parts[4];
672     xcb_void_cookie_t xcb_ret;
673     xcb_dri2_create_drawable_request_t xcb_out;
674 
675     xcb_out.drawable = drawable;
676 
677     xcb_parts[2].iov_base = (char *) &xcb_out;
678     xcb_parts[2].iov_len = sizeof(xcb_out);
679     xcb_parts[3].iov_base = 0;
680     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
681 
682     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
683     return xcb_ret;
684 }
685 
686 
687 /*****************************************************************************
688  **
689  ** xcb_void_cookie_t xcb_dri2_destroy_drawable_checked
690  **
691  ** @param xcb_connection_t *c
692  ** @param xcb_drawable_t    drawable
693  ** @returns xcb_void_cookie_t
694  **
695  *****************************************************************************/
696 
697 xcb_void_cookie_t
698 xcb_dri2_destroy_drawable_checked (xcb_connection_t *c  /**< */,
699                                    xcb_drawable_t    drawable  /**< */)
700 {
701     static const xcb_protocol_request_t xcb_req = {
702         /* count */ 2,
703         /* ext */ &xcb_dri2_id,
704         /* opcode */ XCB_DRI2_DESTROY_DRAWABLE,
705         /* isvoid */ 1
706     };
707 
708     struct iovec xcb_parts[4];
709     xcb_void_cookie_t xcb_ret;
710     xcb_dri2_destroy_drawable_request_t xcb_out;
711 
712     xcb_out.drawable = drawable;
713 
714     xcb_parts[2].iov_base = (char *) &xcb_out;
715     xcb_parts[2].iov_len = sizeof(xcb_out);
716     xcb_parts[3].iov_base = 0;
717     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
718 
719     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
720     return xcb_ret;
721 }
722 
723 
724 /*****************************************************************************
725  **
726  ** xcb_void_cookie_t xcb_dri2_destroy_drawable
727  **
728  ** @param xcb_connection_t *c
729  ** @param xcb_drawable_t    drawable
730  ** @returns xcb_void_cookie_t
731  **
732  *****************************************************************************/
733 
734 xcb_void_cookie_t
735 xcb_dri2_destroy_drawable (xcb_connection_t *c  /**< */,
736                            xcb_drawable_t    drawable  /**< */)
737 {
738     static const xcb_protocol_request_t xcb_req = {
739         /* count */ 2,
740         /* ext */ &xcb_dri2_id,
741         /* opcode */ XCB_DRI2_DESTROY_DRAWABLE,
742         /* isvoid */ 1
743     };
744 
745     struct iovec xcb_parts[4];
746     xcb_void_cookie_t xcb_ret;
747     xcb_dri2_destroy_drawable_request_t xcb_out;
748 
749     xcb_out.drawable = drawable;
750 
751     xcb_parts[2].iov_base = (char *) &xcb_out;
752     xcb_parts[2].iov_len = sizeof(xcb_out);
753     xcb_parts[3].iov_base = 0;
754     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
755 
756     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
757     return xcb_ret;
758 }
759 
760 int
761 xcb_dri2_get_buffers_sizeof (const void  *_buffer  /**< */,
762                              uint32_t     attachments_len  /**< */)
763 {
764     char *xcb_tmp = (char *)_buffer;
765     unsigned int xcb_buffer_len = 0;
766     unsigned int xcb_block_len = 0;
767     unsigned int xcb_pad = 0;
768     unsigned int xcb_align_to = 0;
769 
770 
771     xcb_block_len += sizeof(xcb_dri2_get_buffers_request_t);
772     xcb_tmp += xcb_block_len;
773     xcb_buffer_len += xcb_block_len;
774     xcb_block_len = 0;
775     /* attachments */
776     xcb_block_len += attachments_len * sizeof(uint32_t);
777     xcb_tmp += xcb_block_len;
778     xcb_align_to = ALIGNOF(uint32_t);
779     /* insert padding */
780     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
781     xcb_buffer_len += xcb_block_len + xcb_pad;
782     if (0 != xcb_pad) {
783         xcb_tmp += xcb_pad;
784         xcb_pad = 0;
785     }
786     xcb_block_len = 0;
787 
788     return xcb_buffer_len;
789 }
790 
791 
792 /*****************************************************************************
793  **
794  ** xcb_dri2_get_buffers_cookie_t xcb_dri2_get_buffers
795  **
796  ** @param xcb_connection_t *c
797  ** @param xcb_drawable_t    drawable
798  ** @param uint32_t          count
799  ** @param uint32_t          attachments_len
800  ** @param const uint32_t   *attachments
801  ** @returns xcb_dri2_get_buffers_cookie_t
802  **
803  *****************************************************************************/
804 
805 xcb_dri2_get_buffers_cookie_t
806 xcb_dri2_get_buffers (xcb_connection_t *c  /**< */,
807                       xcb_drawable_t    drawable  /**< */,
808                       uint32_t          count  /**< */,
809                       uint32_t          attachments_len  /**< */,
810                       const uint32_t   *attachments  /**< */)
811 {
812     static const xcb_protocol_request_t xcb_req = {
813         /* count */ 4,
814         /* ext */ &xcb_dri2_id,
815         /* opcode */ XCB_DRI2_GET_BUFFERS,
816         /* isvoid */ 0
817     };
818 
819     struct iovec xcb_parts[6];
820     xcb_dri2_get_buffers_cookie_t xcb_ret;
821     xcb_dri2_get_buffers_request_t xcb_out;
822 
823     xcb_out.drawable = drawable;
824     xcb_out.count = count;
825 
826     xcb_parts[2].iov_base = (char *) &xcb_out;
827     xcb_parts[2].iov_len = sizeof(xcb_out);
828     xcb_parts[3].iov_base = 0;
829     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
830     /* uint32_t attachments */
831     xcb_parts[4].iov_base = (char *) attachments;
832     xcb_parts[4].iov_len = attachments_len * sizeof(uint32_t);
833     xcb_parts[5].iov_base = 0;
834     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
835 
836     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
837     return xcb_ret;
838 }
839 
840 
841 /*****************************************************************************
842  **
843  ** xcb_dri2_get_buffers_cookie_t xcb_dri2_get_buffers_unchecked
844  **
845  ** @param xcb_connection_t *c
846  ** @param xcb_drawable_t    drawable
847  ** @param uint32_t          count
848  ** @param uint32_t          attachments_len
849  ** @param const uint32_t   *attachments
850  ** @returns xcb_dri2_get_buffers_cookie_t
851  **
852  *****************************************************************************/
853 
854 xcb_dri2_get_buffers_cookie_t
855 xcb_dri2_get_buffers_unchecked (xcb_connection_t *c  /**< */,
856                                 xcb_drawable_t    drawable  /**< */,
857                                 uint32_t          count  /**< */,
858                                 uint32_t          attachments_len  /**< */,
859                                 const uint32_t   *attachments  /**< */)
860 {
861     static const xcb_protocol_request_t xcb_req = {
862         /* count */ 4,
863         /* ext */ &xcb_dri2_id,
864         /* opcode */ XCB_DRI2_GET_BUFFERS,
865         /* isvoid */ 0
866     };
867 
868     struct iovec xcb_parts[6];
869     xcb_dri2_get_buffers_cookie_t xcb_ret;
870     xcb_dri2_get_buffers_request_t xcb_out;
871 
872     xcb_out.drawable = drawable;
873     xcb_out.count = count;
874 
875     xcb_parts[2].iov_base = (char *) &xcb_out;
876     xcb_parts[2].iov_len = sizeof(xcb_out);
877     xcb_parts[3].iov_base = 0;
878     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
879     /* uint32_t attachments */
880     xcb_parts[4].iov_base = (char *) attachments;
881     xcb_parts[4].iov_len = attachments_len * sizeof(uint32_t);
882     xcb_parts[5].iov_base = 0;
883     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
884 
885     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
886     return xcb_ret;
887 }
888 
889 
890 /*****************************************************************************
891  **
892  ** xcb_dri2_dri2_buffer_t * xcb_dri2_get_buffers_buffers
893  **
894  ** @param const xcb_dri2_get_buffers_reply_t *R
895  ** @returns xcb_dri2_dri2_buffer_t *
896  **
897  *****************************************************************************/
898 
899 xcb_dri2_dri2_buffer_t *
900 xcb_dri2_get_buffers_buffers (const xcb_dri2_get_buffers_reply_t *R  /**< */)
901 {
902     return (xcb_dri2_dri2_buffer_t *) (R + 1);
903 }
904 
905 
906 /*****************************************************************************
907  **
908  ** int xcb_dri2_get_buffers_buffers_length
909  **
910  ** @param const xcb_dri2_get_buffers_reply_t *R
911  ** @returns int
912  **
913  *****************************************************************************/
914 
915 int
916 xcb_dri2_get_buffers_buffers_length (const xcb_dri2_get_buffers_reply_t *R  /**< */)
917 {
918     return R->count;
919 }
920 
921 
922 /*****************************************************************************
923  **
924  ** xcb_dri2_dri2_buffer_iterator_t xcb_dri2_get_buffers_buffers_iterator
925  **
926  ** @param const xcb_dri2_get_buffers_reply_t *R
927  ** @returns xcb_dri2_dri2_buffer_iterator_t
928  **
929  *****************************************************************************/
930 
931 xcb_dri2_dri2_buffer_iterator_t
932 xcb_dri2_get_buffers_buffers_iterator (const xcb_dri2_get_buffers_reply_t *R  /**< */)
933 {
934     xcb_dri2_dri2_buffer_iterator_t i;
935     i.data = (xcb_dri2_dri2_buffer_t *) (R + 1);
936     i.rem = R->count;
937     i.index = (char *) i.data - (char *) R;
938     return i;
939 }
940 
941 
942 /*****************************************************************************
943  **
944  ** xcb_dri2_get_buffers_reply_t * xcb_dri2_get_buffers_reply
945  **
946  ** @param xcb_connection_t               *c
947  ** @param xcb_dri2_get_buffers_cookie_t   cookie
948  ** @param xcb_generic_error_t           **e
949  ** @returns xcb_dri2_get_buffers_reply_t *
950  **
951  *****************************************************************************/
952 
953 xcb_dri2_get_buffers_reply_t *
954 xcb_dri2_get_buffers_reply (xcb_connection_t               *c  /**< */,
955                             xcb_dri2_get_buffers_cookie_t   cookie  /**< */,
956                             xcb_generic_error_t           **e  /**< */)
957 {
958     return (xcb_dri2_get_buffers_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
959 }
960 
961 
962 /*****************************************************************************
963  **
964  ** xcb_dri2_copy_region_cookie_t xcb_dri2_copy_region
965  **
966  ** @param xcb_connection_t *c
967  ** @param xcb_drawable_t    drawable
968  ** @param uint32_t          region
969  ** @param uint32_t          dest
970  ** @param uint32_t          src
971  ** @returns xcb_dri2_copy_region_cookie_t
972  **
973  *****************************************************************************/
974 
975 xcb_dri2_copy_region_cookie_t
976 xcb_dri2_copy_region (xcb_connection_t *c  /**< */,
977                       xcb_drawable_t    drawable  /**< */,
978                       uint32_t          region  /**< */,
979                       uint32_t          dest  /**< */,
980                       uint32_t          src  /**< */)
981 {
982     static const xcb_protocol_request_t xcb_req = {
983         /* count */ 2,
984         /* ext */ &xcb_dri2_id,
985         /* opcode */ XCB_DRI2_COPY_REGION,
986         /* isvoid */ 0
987     };
988 
989     struct iovec xcb_parts[4];
990     xcb_dri2_copy_region_cookie_t xcb_ret;
991     xcb_dri2_copy_region_request_t xcb_out;
992 
993     xcb_out.drawable = drawable;
994     xcb_out.region = region;
995     xcb_out.dest = dest;
996     xcb_out.src = src;
997 
998     xcb_parts[2].iov_base = (char *) &xcb_out;
999     xcb_parts[2].iov_len = sizeof(xcb_out);
1000     xcb_parts[3].iov_base = 0;
1001     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1002 
1003     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1004     return xcb_ret;
1005 }
1006 
1007 
1008 /*****************************************************************************
1009  **
1010  ** xcb_dri2_copy_region_cookie_t xcb_dri2_copy_region_unchecked
1011  **
1012  ** @param xcb_connection_t *c
1013  ** @param xcb_drawable_t    drawable
1014  ** @param uint32_t          region
1015  ** @param uint32_t          dest
1016  ** @param uint32_t          src
1017  ** @returns xcb_dri2_copy_region_cookie_t
1018  **
1019  *****************************************************************************/
1020 
1021 xcb_dri2_copy_region_cookie_t
1022 xcb_dri2_copy_region_unchecked (xcb_connection_t *c  /**< */,
1023                                 xcb_drawable_t    drawable  /**< */,
1024                                 uint32_t          region  /**< */,
1025                                 uint32_t          dest  /**< */,
1026                                 uint32_t          src  /**< */)
1027 {
1028     static const xcb_protocol_request_t xcb_req = {
1029         /* count */ 2,
1030         /* ext */ &xcb_dri2_id,
1031         /* opcode */ XCB_DRI2_COPY_REGION,
1032         /* isvoid */ 0
1033     };
1034 
1035     struct iovec xcb_parts[4];
1036     xcb_dri2_copy_region_cookie_t xcb_ret;
1037     xcb_dri2_copy_region_request_t xcb_out;
1038 
1039     xcb_out.drawable = drawable;
1040     xcb_out.region = region;
1041     xcb_out.dest = dest;
1042     xcb_out.src = src;
1043 
1044     xcb_parts[2].iov_base = (char *) &xcb_out;
1045     xcb_parts[2].iov_len = sizeof(xcb_out);
1046     xcb_parts[3].iov_base = 0;
1047     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1048 
1049     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1050     return xcb_ret;
1051 }
1052 
1053 
1054 /*****************************************************************************
1055  **
1056  ** xcb_dri2_copy_region_reply_t * xcb_dri2_copy_region_reply
1057  **
1058  ** @param xcb_connection_t               *c
1059  ** @param xcb_dri2_copy_region_cookie_t   cookie
1060  ** @param xcb_generic_error_t           **e
1061  ** @returns xcb_dri2_copy_region_reply_t *
1062  **
1063  *****************************************************************************/
1064 
1065 xcb_dri2_copy_region_reply_t *
1066 xcb_dri2_copy_region_reply (xcb_connection_t               *c  /**< */,
1067                             xcb_dri2_copy_region_cookie_t   cookie  /**< */,
1068                             xcb_generic_error_t           **e  /**< */)
1069 {
1070     return (xcb_dri2_copy_region_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1071 }
1072 
1073 int
1074 xcb_dri2_get_buffers_with_format_sizeof (const void  *_buffer  /**< */,
1075                                          uint32_t     attachments_len  /**< */)
1076 {
1077     char *xcb_tmp = (char *)_buffer;
1078     unsigned int xcb_buffer_len = 0;
1079     unsigned int xcb_block_len = 0;
1080     unsigned int xcb_pad = 0;
1081     unsigned int xcb_align_to = 0;
1082 
1083 
1084     xcb_block_len += sizeof(xcb_dri2_get_buffers_with_format_request_t);
1085     xcb_tmp += xcb_block_len;
1086     xcb_buffer_len += xcb_block_len;
1087     xcb_block_len = 0;
1088     /* attachments */
1089     xcb_block_len += attachments_len * sizeof(xcb_dri2_attach_format_t);
1090     xcb_tmp += xcb_block_len;
1091     xcb_align_to = ALIGNOF(xcb_dri2_attach_format_t);
1092     /* insert padding */
1093     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1094     xcb_buffer_len += xcb_block_len + xcb_pad;
1095     if (0 != xcb_pad) {
1096         xcb_tmp += xcb_pad;
1097         xcb_pad = 0;
1098     }
1099     xcb_block_len = 0;
1100 
1101     return xcb_buffer_len;
1102 }
1103 
1104 
1105 /*****************************************************************************
1106  **
1107  ** xcb_dri2_get_buffers_with_format_cookie_t xcb_dri2_get_buffers_with_format
1108  **
1109  ** @param xcb_connection_t               *c
1110  ** @param xcb_drawable_t                  drawable
1111  ** @param uint32_t                        count
1112  ** @param uint32_t                        attachments_len
1113  ** @param const xcb_dri2_attach_format_t *attachments
1114  ** @returns xcb_dri2_get_buffers_with_format_cookie_t
1115  **
1116  *****************************************************************************/
1117 
1118 xcb_dri2_get_buffers_with_format_cookie_t
1119 xcb_dri2_get_buffers_with_format (xcb_connection_t               *c  /**< */,
1120                                   xcb_drawable_t                  drawable  /**< */,
1121                                   uint32_t                        count  /**< */,
1122                                   uint32_t                        attachments_len  /**< */,
1123                                   const xcb_dri2_attach_format_t *attachments  /**< */)
1124 {
1125     static const xcb_protocol_request_t xcb_req = {
1126         /* count */ 4,
1127         /* ext */ &xcb_dri2_id,
1128         /* opcode */ XCB_DRI2_GET_BUFFERS_WITH_FORMAT,
1129         /* isvoid */ 0
1130     };
1131 
1132     struct iovec xcb_parts[6];
1133     xcb_dri2_get_buffers_with_format_cookie_t xcb_ret;
1134     xcb_dri2_get_buffers_with_format_request_t xcb_out;
1135 
1136     xcb_out.drawable = drawable;
1137     xcb_out.count = count;
1138 
1139     xcb_parts[2].iov_base = (char *) &xcb_out;
1140     xcb_parts[2].iov_len = sizeof(xcb_out);
1141     xcb_parts[3].iov_base = 0;
1142     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1143     /* xcb_dri2_attach_format_t attachments */
1144     xcb_parts[4].iov_base = (char *) attachments;
1145     xcb_parts[4].iov_len = attachments_len * sizeof(xcb_dri2_attach_format_t);
1146     xcb_parts[5].iov_base = 0;
1147     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1148 
1149     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1150     return xcb_ret;
1151 }
1152 
1153 
1154 /*****************************************************************************
1155  **
1156  ** xcb_dri2_get_buffers_with_format_cookie_t xcb_dri2_get_buffers_with_format_unchecked
1157  **
1158  ** @param xcb_connection_t               *c
1159  ** @param xcb_drawable_t                  drawable
1160  ** @param uint32_t                        count
1161  ** @param uint32_t                        attachments_len
1162  ** @param const xcb_dri2_attach_format_t *attachments
1163  ** @returns xcb_dri2_get_buffers_with_format_cookie_t
1164  **
1165  *****************************************************************************/
1166 
1167 xcb_dri2_get_buffers_with_format_cookie_t
1168 xcb_dri2_get_buffers_with_format_unchecked (xcb_connection_t               *c  /**< */,
1169                                             xcb_drawable_t                  drawable  /**< */,
1170                                             uint32_t                        count  /**< */,
1171                                             uint32_t                        attachments_len  /**< */,
1172                                             const xcb_dri2_attach_format_t *attachments  /**< */)
1173 {
1174     static const xcb_protocol_request_t xcb_req = {
1175         /* count */ 4,
1176         /* ext */ &xcb_dri2_id,
1177         /* opcode */ XCB_DRI2_GET_BUFFERS_WITH_FORMAT,
1178         /* isvoid */ 0
1179     };
1180 
1181     struct iovec xcb_parts[6];
1182     xcb_dri2_get_buffers_with_format_cookie_t xcb_ret;
1183     xcb_dri2_get_buffers_with_format_request_t xcb_out;
1184 
1185     xcb_out.drawable = drawable;
1186     xcb_out.count = count;
1187 
1188     xcb_parts[2].iov_base = (char *) &xcb_out;
1189     xcb_parts[2].iov_len = sizeof(xcb_out);
1190     xcb_parts[3].iov_base = 0;
1191     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1192     /* xcb_dri2_attach_format_t attachments */
1193     xcb_parts[4].iov_base = (char *) attachments;
1194     xcb_parts[4].iov_len = attachments_len * sizeof(xcb_dri2_attach_format_t);
1195     xcb_parts[5].iov_base = 0;
1196     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1197 
1198     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1199     return xcb_ret;
1200 }
1201 
1202 
1203 /*****************************************************************************
1204  **
1205  ** xcb_dri2_dri2_buffer_t * xcb_dri2_get_buffers_with_format_buffers
1206  **
1207  ** @param const xcb_dri2_get_buffers_with_format_reply_t *R
1208  ** @returns xcb_dri2_dri2_buffer_t *
1209  **
1210  *****************************************************************************/
1211 
1212 xcb_dri2_dri2_buffer_t *
1213 xcb_dri2_get_buffers_with_format_buffers (const xcb_dri2_get_buffers_with_format_reply_t *R  /**< */)
1214 {
1215     return (xcb_dri2_dri2_buffer_t *) (R + 1);
1216 }
1217 
1218 
1219 /*****************************************************************************
1220  **
1221  ** int xcb_dri2_get_buffers_with_format_buffers_length
1222  **
1223  ** @param const xcb_dri2_get_buffers_with_format_reply_t *R
1224  ** @returns int
1225  **
1226  *****************************************************************************/
1227 
1228 int
1229 xcb_dri2_get_buffers_with_format_buffers_length (const xcb_dri2_get_buffers_with_format_reply_t *R  /**< */)
1230 {
1231     return R->count;
1232 }
1233 
1234 
1235 /*****************************************************************************
1236  **
1237  ** xcb_dri2_dri2_buffer_iterator_t xcb_dri2_get_buffers_with_format_buffers_iterator
1238  **
1239  ** @param const xcb_dri2_get_buffers_with_format_reply_t *R
1240  ** @returns xcb_dri2_dri2_buffer_iterator_t
1241  **
1242  *****************************************************************************/
1243 
1244 xcb_dri2_dri2_buffer_iterator_t
1245 xcb_dri2_get_buffers_with_format_buffers_iterator (const xcb_dri2_get_buffers_with_format_reply_t *R  /**< */)
1246 {
1247     xcb_dri2_dri2_buffer_iterator_t i;
1248     i.data = (xcb_dri2_dri2_buffer_t *) (R + 1);
1249     i.rem = R->count;
1250     i.index = (char *) i.data - (char *) R;
1251     return i;
1252 }
1253 
1254 
1255 /*****************************************************************************
1256  **
1257  ** xcb_dri2_get_buffers_with_format_reply_t * xcb_dri2_get_buffers_with_format_reply
1258  **
1259  ** @param xcb_connection_t                           *c
1260  ** @param xcb_dri2_get_buffers_with_format_cookie_t   cookie
1261  ** @param xcb_generic_error_t                       **e
1262  ** @returns xcb_dri2_get_buffers_with_format_reply_t *
1263  **
1264  *****************************************************************************/
1265 
1266 xcb_dri2_get_buffers_with_format_reply_t *
1267 xcb_dri2_get_buffers_with_format_reply (xcb_connection_t                           *c  /**< */,
1268                                         xcb_dri2_get_buffers_with_format_cookie_t   cookie  /**< */,
1269                                         xcb_generic_error_t                       **e  /**< */)
1270 {
1271     return (xcb_dri2_get_buffers_with_format_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1272 }
1273 
1274 
1275 /*****************************************************************************
1276  **
1277  ** xcb_dri2_swap_buffers_cookie_t xcb_dri2_swap_buffers
1278  **
1279  ** @param xcb_connection_t *c
1280  ** @param xcb_drawable_t    drawable
1281  ** @param uint32_t          target_msc_hi
1282  ** @param uint32_t          target_msc_lo
1283  ** @param uint32_t          divisor_hi
1284  ** @param uint32_t          divisor_lo
1285  ** @param uint32_t          remainder_hi
1286  ** @param uint32_t          remainder_lo
1287  ** @returns xcb_dri2_swap_buffers_cookie_t
1288  **
1289  *****************************************************************************/
1290 
1291 xcb_dri2_swap_buffers_cookie_t
1292 xcb_dri2_swap_buffers (xcb_connection_t *c  /**< */,
1293                        xcb_drawable_t    drawable  /**< */,
1294                        uint32_t          target_msc_hi  /**< */,
1295                        uint32_t          target_msc_lo  /**< */,
1296                        uint32_t          divisor_hi  /**< */,
1297                        uint32_t          divisor_lo  /**< */,
1298                        uint32_t          remainder_hi  /**< */,
1299                        uint32_t          remainder_lo  /**< */)
1300 {
1301     static const xcb_protocol_request_t xcb_req = {
1302         /* count */ 2,
1303         /* ext */ &xcb_dri2_id,
1304         /* opcode */ XCB_DRI2_SWAP_BUFFERS,
1305         /* isvoid */ 0
1306     };
1307 
1308     struct iovec xcb_parts[4];
1309     xcb_dri2_swap_buffers_cookie_t xcb_ret;
1310     xcb_dri2_swap_buffers_request_t xcb_out;
1311 
1312     xcb_out.drawable = drawable;
1313     xcb_out.target_msc_hi = target_msc_hi;
1314     xcb_out.target_msc_lo = target_msc_lo;
1315     xcb_out.divisor_hi = divisor_hi;
1316     xcb_out.divisor_lo = divisor_lo;
1317     xcb_out.remainder_hi = remainder_hi;
1318     xcb_out.remainder_lo = remainder_lo;
1319 
1320     xcb_parts[2].iov_base = (char *) &xcb_out;
1321     xcb_parts[2].iov_len = sizeof(xcb_out);
1322     xcb_parts[3].iov_base = 0;
1323     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1324 
1325     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1326     return xcb_ret;
1327 }
1328 
1329 
1330 /*****************************************************************************
1331  **
1332  ** xcb_dri2_swap_buffers_cookie_t xcb_dri2_swap_buffers_unchecked
1333  **
1334  ** @param xcb_connection_t *c
1335  ** @param xcb_drawable_t    drawable
1336  ** @param uint32_t          target_msc_hi
1337  ** @param uint32_t          target_msc_lo
1338  ** @param uint32_t          divisor_hi
1339  ** @param uint32_t          divisor_lo
1340  ** @param uint32_t          remainder_hi
1341  ** @param uint32_t          remainder_lo
1342  ** @returns xcb_dri2_swap_buffers_cookie_t
1343  **
1344  *****************************************************************************/
1345 
1346 xcb_dri2_swap_buffers_cookie_t
1347 xcb_dri2_swap_buffers_unchecked (xcb_connection_t *c  /**< */,
1348                                  xcb_drawable_t    drawable  /**< */,
1349                                  uint32_t          target_msc_hi  /**< */,
1350                                  uint32_t          target_msc_lo  /**< */,
1351                                  uint32_t          divisor_hi  /**< */,
1352                                  uint32_t          divisor_lo  /**< */,
1353                                  uint32_t          remainder_hi  /**< */,
1354                                  uint32_t          remainder_lo  /**< */)
1355 {
1356     static const xcb_protocol_request_t xcb_req = {
1357         /* count */ 2,
1358         /* ext */ &xcb_dri2_id,
1359         /* opcode */ XCB_DRI2_SWAP_BUFFERS,
1360         /* isvoid */ 0
1361     };
1362 
1363     struct iovec xcb_parts[4];
1364     xcb_dri2_swap_buffers_cookie_t xcb_ret;
1365     xcb_dri2_swap_buffers_request_t xcb_out;
1366 
1367     xcb_out.drawable = drawable;
1368     xcb_out.target_msc_hi = target_msc_hi;
1369     xcb_out.target_msc_lo = target_msc_lo;
1370     xcb_out.divisor_hi = divisor_hi;
1371     xcb_out.divisor_lo = divisor_lo;
1372     xcb_out.remainder_hi = remainder_hi;
1373     xcb_out.remainder_lo = remainder_lo;
1374 
1375     xcb_parts[2].iov_base = (char *) &xcb_out;
1376     xcb_parts[2].iov_len = sizeof(xcb_out);
1377     xcb_parts[3].iov_base = 0;
1378     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1379 
1380     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1381     return xcb_ret;
1382 }
1383 
1384 
1385 /*****************************************************************************
1386  **
1387  ** xcb_dri2_swap_buffers_reply_t * xcb_dri2_swap_buffers_reply
1388  **
1389  ** @param xcb_connection_t                *c
1390  ** @param xcb_dri2_swap_buffers_cookie_t   cookie
1391  ** @param xcb_generic_error_t            **e
1392  ** @returns xcb_dri2_swap_buffers_reply_t *
1393  **
1394  *****************************************************************************/
1395 
1396 xcb_dri2_swap_buffers_reply_t *
1397 xcb_dri2_swap_buffers_reply (xcb_connection_t                *c  /**< */,
1398                              xcb_dri2_swap_buffers_cookie_t   cookie  /**< */,
1399                              xcb_generic_error_t            **e  /**< */)
1400 {
1401     return (xcb_dri2_swap_buffers_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1402 }
1403 
1404 
1405 /*****************************************************************************
1406  **
1407  ** xcb_dri2_get_msc_cookie_t xcb_dri2_get_msc
1408  **
1409  ** @param xcb_connection_t *c
1410  ** @param xcb_drawable_t    drawable
1411  ** @returns xcb_dri2_get_msc_cookie_t
1412  **
1413  *****************************************************************************/
1414 
1415 xcb_dri2_get_msc_cookie_t
1416 xcb_dri2_get_msc (xcb_connection_t *c  /**< */,
1417                   xcb_drawable_t    drawable  /**< */)
1418 {
1419     static const xcb_protocol_request_t xcb_req = {
1420         /* count */ 2,
1421         /* ext */ &xcb_dri2_id,
1422         /* opcode */ XCB_DRI2_GET_MSC,
1423         /* isvoid */ 0
1424     };
1425 
1426     struct iovec xcb_parts[4];
1427     xcb_dri2_get_msc_cookie_t xcb_ret;
1428     xcb_dri2_get_msc_request_t xcb_out;
1429 
1430     xcb_out.drawable = drawable;
1431 
1432     xcb_parts[2].iov_base = (char *) &xcb_out;
1433     xcb_parts[2].iov_len = sizeof(xcb_out);
1434     xcb_parts[3].iov_base = 0;
1435     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1436 
1437     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1438     return xcb_ret;
1439 }
1440 
1441 
1442 /*****************************************************************************
1443  **
1444  ** xcb_dri2_get_msc_cookie_t xcb_dri2_get_msc_unchecked
1445  **
1446  ** @param xcb_connection_t *c
1447  ** @param xcb_drawable_t    drawable
1448  ** @returns xcb_dri2_get_msc_cookie_t
1449  **
1450  *****************************************************************************/
1451 
1452 xcb_dri2_get_msc_cookie_t
1453 xcb_dri2_get_msc_unchecked (xcb_connection_t *c  /**< */,
1454                             xcb_drawable_t    drawable  /**< */)
1455 {
1456     static const xcb_protocol_request_t xcb_req = {
1457         /* count */ 2,
1458         /* ext */ &xcb_dri2_id,
1459         /* opcode */ XCB_DRI2_GET_MSC,
1460         /* isvoid */ 0
1461     };
1462 
1463     struct iovec xcb_parts[4];
1464     xcb_dri2_get_msc_cookie_t xcb_ret;
1465     xcb_dri2_get_msc_request_t xcb_out;
1466 
1467     xcb_out.drawable = drawable;
1468 
1469     xcb_parts[2].iov_base = (char *) &xcb_out;
1470     xcb_parts[2].iov_len = sizeof(xcb_out);
1471     xcb_parts[3].iov_base = 0;
1472     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1473 
1474     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1475     return xcb_ret;
1476 }
1477 
1478 
1479 /*****************************************************************************
1480  **
1481  ** xcb_dri2_get_msc_reply_t * xcb_dri2_get_msc_reply
1482  **
1483  ** @param xcb_connection_t           *c
1484  ** @param xcb_dri2_get_msc_cookie_t   cookie
1485  ** @param xcb_generic_error_t       **e
1486  ** @returns xcb_dri2_get_msc_reply_t *
1487  **
1488  *****************************************************************************/
1489 
1490 xcb_dri2_get_msc_reply_t *
1491 xcb_dri2_get_msc_reply (xcb_connection_t           *c  /**< */,
1492                         xcb_dri2_get_msc_cookie_t   cookie  /**< */,
1493                         xcb_generic_error_t       **e  /**< */)
1494 {
1495     return (xcb_dri2_get_msc_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1496 }
1497 
1498 
1499 /*****************************************************************************
1500  **
1501  ** xcb_dri2_wait_msc_cookie_t xcb_dri2_wait_msc
1502  **
1503  ** @param xcb_connection_t *c
1504  ** @param xcb_drawable_t    drawable
1505  ** @param uint32_t          target_msc_hi
1506  ** @param uint32_t          target_msc_lo
1507  ** @param uint32_t          divisor_hi
1508  ** @param uint32_t          divisor_lo
1509  ** @param uint32_t          remainder_hi
1510  ** @param uint32_t          remainder_lo
1511  ** @returns xcb_dri2_wait_msc_cookie_t
1512  **
1513  *****************************************************************************/
1514 
1515 xcb_dri2_wait_msc_cookie_t
1516 xcb_dri2_wait_msc (xcb_connection_t *c  /**< */,
1517                    xcb_drawable_t    drawable  /**< */,
1518                    uint32_t          target_msc_hi  /**< */,
1519                    uint32_t          target_msc_lo  /**< */,
1520                    uint32_t          divisor_hi  /**< */,
1521                    uint32_t          divisor_lo  /**< */,
1522                    uint32_t          remainder_hi  /**< */,
1523                    uint32_t          remainder_lo  /**< */)
1524 {
1525     static const xcb_protocol_request_t xcb_req = {
1526         /* count */ 2,
1527         /* ext */ &xcb_dri2_id,
1528         /* opcode */ XCB_DRI2_WAIT_MSC,
1529         /* isvoid */ 0
1530     };
1531 
1532     struct iovec xcb_parts[4];
1533     xcb_dri2_wait_msc_cookie_t xcb_ret;
1534     xcb_dri2_wait_msc_request_t xcb_out;
1535 
1536     xcb_out.drawable = drawable;
1537     xcb_out.target_msc_hi = target_msc_hi;
1538     xcb_out.target_msc_lo = target_msc_lo;
1539     xcb_out.divisor_hi = divisor_hi;
1540     xcb_out.divisor_lo = divisor_lo;
1541     xcb_out.remainder_hi = remainder_hi;
1542     xcb_out.remainder_lo = remainder_lo;
1543 
1544     xcb_parts[2].iov_base = (char *) &xcb_out;
1545     xcb_parts[2].iov_len = sizeof(xcb_out);
1546     xcb_parts[3].iov_base = 0;
1547     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1548 
1549     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1550     return xcb_ret;
1551 }
1552 
1553 
1554 /*****************************************************************************
1555  **
1556  ** xcb_dri2_wait_msc_cookie_t xcb_dri2_wait_msc_unchecked
1557  **
1558  ** @param xcb_connection_t *c
1559  ** @param xcb_drawable_t    drawable
1560  ** @param uint32_t          target_msc_hi
1561  ** @param uint32_t          target_msc_lo
1562  ** @param uint32_t          divisor_hi
1563  ** @param uint32_t          divisor_lo
1564  ** @param uint32_t          remainder_hi
1565  ** @param uint32_t          remainder_lo
1566  ** @returns xcb_dri2_wait_msc_cookie_t
1567  **
1568  *****************************************************************************/
1569 
1570 xcb_dri2_wait_msc_cookie_t
1571 xcb_dri2_wait_msc_unchecked (xcb_connection_t *c  /**< */,
1572                              xcb_drawable_t    drawable  /**< */,
1573                              uint32_t          target_msc_hi  /**< */,
1574                              uint32_t          target_msc_lo  /**< */,
1575                              uint32_t          divisor_hi  /**< */,
1576                              uint32_t          divisor_lo  /**< */,
1577                              uint32_t          remainder_hi  /**< */,
1578                              uint32_t          remainder_lo  /**< */)
1579 {
1580     static const xcb_protocol_request_t xcb_req = {
1581         /* count */ 2,
1582         /* ext */ &xcb_dri2_id,
1583         /* opcode */ XCB_DRI2_WAIT_MSC,
1584         /* isvoid */ 0
1585     };
1586 
1587     struct iovec xcb_parts[4];
1588     xcb_dri2_wait_msc_cookie_t xcb_ret;
1589     xcb_dri2_wait_msc_request_t xcb_out;
1590 
1591     xcb_out.drawable = drawable;
1592     xcb_out.target_msc_hi = target_msc_hi;
1593     xcb_out.target_msc_lo = target_msc_lo;
1594     xcb_out.divisor_hi = divisor_hi;
1595     xcb_out.divisor_lo = divisor_lo;
1596     xcb_out.remainder_hi = remainder_hi;
1597     xcb_out.remainder_lo = remainder_lo;
1598 
1599     xcb_parts[2].iov_base = (char *) &xcb_out;
1600     xcb_parts[2].iov_len = sizeof(xcb_out);
1601     xcb_parts[3].iov_base = 0;
1602     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1603 
1604     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1605     return xcb_ret;
1606 }
1607 
1608 
1609 /*****************************************************************************
1610  **
1611  ** xcb_dri2_wait_msc_reply_t * xcb_dri2_wait_msc_reply
1612  **
1613  ** @param xcb_connection_t            *c
1614  ** @param xcb_dri2_wait_msc_cookie_t   cookie
1615  ** @param xcb_generic_error_t        **e
1616  ** @returns xcb_dri2_wait_msc_reply_t *
1617  **
1618  *****************************************************************************/
1619 
1620 xcb_dri2_wait_msc_reply_t *
1621 xcb_dri2_wait_msc_reply (xcb_connection_t            *c  /**< */,
1622                          xcb_dri2_wait_msc_cookie_t   cookie  /**< */,
1623                          xcb_generic_error_t        **e  /**< */)
1624 {
1625     return (xcb_dri2_wait_msc_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1626 }
1627 
1628 
1629 /*****************************************************************************
1630  **
1631  ** xcb_dri2_wait_sbc_cookie_t xcb_dri2_wait_sbc
1632  **
1633  ** @param xcb_connection_t *c
1634  ** @param xcb_drawable_t    drawable
1635  ** @param uint32_t          target_sbc_hi
1636  ** @param uint32_t          target_sbc_lo
1637  ** @returns xcb_dri2_wait_sbc_cookie_t
1638  **
1639  *****************************************************************************/
1640 
1641 xcb_dri2_wait_sbc_cookie_t
1642 xcb_dri2_wait_sbc (xcb_connection_t *c  /**< */,
1643                    xcb_drawable_t    drawable  /**< */,
1644                    uint32_t          target_sbc_hi  /**< */,
1645                    uint32_t          target_sbc_lo  /**< */)
1646 {
1647     static const xcb_protocol_request_t xcb_req = {
1648         /* count */ 2,
1649         /* ext */ &xcb_dri2_id,
1650         /* opcode */ XCB_DRI2_WAIT_SBC,
1651         /* isvoid */ 0
1652     };
1653 
1654     struct iovec xcb_parts[4];
1655     xcb_dri2_wait_sbc_cookie_t xcb_ret;
1656     xcb_dri2_wait_sbc_request_t xcb_out;
1657 
1658     xcb_out.drawable = drawable;
1659     xcb_out.target_sbc_hi = target_sbc_hi;
1660     xcb_out.target_sbc_lo = target_sbc_lo;
1661 
1662     xcb_parts[2].iov_base = (char *) &xcb_out;
1663     xcb_parts[2].iov_len = sizeof(xcb_out);
1664     xcb_parts[3].iov_base = 0;
1665     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1666 
1667     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1668     return xcb_ret;
1669 }
1670 
1671 
1672 /*****************************************************************************
1673  **
1674  ** xcb_dri2_wait_sbc_cookie_t xcb_dri2_wait_sbc_unchecked
1675  **
1676  ** @param xcb_connection_t *c
1677  ** @param xcb_drawable_t    drawable
1678  ** @param uint32_t          target_sbc_hi
1679  ** @param uint32_t          target_sbc_lo
1680  ** @returns xcb_dri2_wait_sbc_cookie_t
1681  **
1682  *****************************************************************************/
1683 
1684 xcb_dri2_wait_sbc_cookie_t
1685 xcb_dri2_wait_sbc_unchecked (xcb_connection_t *c  /**< */,
1686                              xcb_drawable_t    drawable  /**< */,
1687                              uint32_t          target_sbc_hi  /**< */,
1688                              uint32_t          target_sbc_lo  /**< */)
1689 {
1690     static const xcb_protocol_request_t xcb_req = {
1691         /* count */ 2,
1692         /* ext */ &xcb_dri2_id,
1693         /* opcode */ XCB_DRI2_WAIT_SBC,
1694         /* isvoid */ 0
1695     };
1696 
1697     struct iovec xcb_parts[4];
1698     xcb_dri2_wait_sbc_cookie_t xcb_ret;
1699     xcb_dri2_wait_sbc_request_t xcb_out;
1700 
1701     xcb_out.drawable = drawable;
1702     xcb_out.target_sbc_hi = target_sbc_hi;
1703     xcb_out.target_sbc_lo = target_sbc_lo;
1704 
1705     xcb_parts[2].iov_base = (char *) &xcb_out;
1706     xcb_parts[2].iov_len = sizeof(xcb_out);
1707     xcb_parts[3].iov_base = 0;
1708     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1709 
1710     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1711     return xcb_ret;
1712 }
1713 
1714 
1715 /*****************************************************************************
1716  **
1717  ** xcb_dri2_wait_sbc_reply_t * xcb_dri2_wait_sbc_reply
1718  **
1719  ** @param xcb_connection_t            *c
1720  ** @param xcb_dri2_wait_sbc_cookie_t   cookie
1721  ** @param xcb_generic_error_t        **e
1722  ** @returns xcb_dri2_wait_sbc_reply_t *
1723  **
1724  *****************************************************************************/
1725 
1726 xcb_dri2_wait_sbc_reply_t *
1727 xcb_dri2_wait_sbc_reply (xcb_connection_t            *c  /**< */,
1728                          xcb_dri2_wait_sbc_cookie_t   cookie  /**< */,
1729                          xcb_generic_error_t        **e  /**< */)
1730 {
1731     return (xcb_dri2_wait_sbc_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1732 }
1733 
1734 
1735 /*****************************************************************************
1736  **
1737  ** xcb_void_cookie_t xcb_dri2_swap_interval_checked
1738  **
1739  ** @param xcb_connection_t *c
1740  ** @param xcb_drawable_t    drawable
1741  ** @param uint32_t          interval
1742  ** @returns xcb_void_cookie_t
1743  **
1744  *****************************************************************************/
1745 
1746 xcb_void_cookie_t
1747 xcb_dri2_swap_interval_checked (xcb_connection_t *c  /**< */,
1748                                 xcb_drawable_t    drawable  /**< */,
1749                                 uint32_t          interval  /**< */)
1750 {
1751     static const xcb_protocol_request_t xcb_req = {
1752         /* count */ 2,
1753         /* ext */ &xcb_dri2_id,
1754         /* opcode */ XCB_DRI2_SWAP_INTERVAL,
1755         /* isvoid */ 1
1756     };
1757 
1758     struct iovec xcb_parts[4];
1759     xcb_void_cookie_t xcb_ret;
1760     xcb_dri2_swap_interval_request_t xcb_out;
1761 
1762     xcb_out.drawable = drawable;
1763     xcb_out.interval = interval;
1764 
1765     xcb_parts[2].iov_base = (char *) &xcb_out;
1766     xcb_parts[2].iov_len = sizeof(xcb_out);
1767     xcb_parts[3].iov_base = 0;
1768     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1769 
1770     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1771     return xcb_ret;
1772 }
1773 
1774 
1775 /*****************************************************************************
1776  **
1777  ** xcb_void_cookie_t xcb_dri2_swap_interval
1778  **
1779  ** @param xcb_connection_t *c
1780  ** @param xcb_drawable_t    drawable
1781  ** @param uint32_t          interval
1782  ** @returns xcb_void_cookie_t
1783  **
1784  *****************************************************************************/
1785 
1786 xcb_void_cookie_t
1787 xcb_dri2_swap_interval (xcb_connection_t *c  /**< */,
1788                         xcb_drawable_t    drawable  /**< */,
1789                         uint32_t          interval  /**< */)
1790 {
1791     static const xcb_protocol_request_t xcb_req = {
1792         /* count */ 2,
1793         /* ext */ &xcb_dri2_id,
1794         /* opcode */ XCB_DRI2_SWAP_INTERVAL,
1795         /* isvoid */ 1
1796     };
1797 
1798     struct iovec xcb_parts[4];
1799     xcb_void_cookie_t xcb_ret;
1800     xcb_dri2_swap_interval_request_t xcb_out;
1801 
1802     xcb_out.drawable = drawable;
1803     xcb_out.interval = interval;
1804 
1805     xcb_parts[2].iov_base = (char *) &xcb_out;
1806     xcb_parts[2].iov_len = sizeof(xcb_out);
1807     xcb_parts[3].iov_base = 0;
1808     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1809 
1810     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1811     return xcb_ret;
1812 }
1813 
1814 
1815 /*****************************************************************************
1816  **
1817  ** xcb_dri2_get_param_cookie_t xcb_dri2_get_param
1818  **
1819  ** @param xcb_connection_t *c
1820  ** @param xcb_drawable_t    drawable
1821  ** @param uint32_t          param
1822  ** @returns xcb_dri2_get_param_cookie_t
1823  **
1824  *****************************************************************************/
1825 
1826 xcb_dri2_get_param_cookie_t
1827 xcb_dri2_get_param (xcb_connection_t *c  /**< */,
1828                     xcb_drawable_t    drawable  /**< */,
1829                     uint32_t          param  /**< */)
1830 {
1831     static const xcb_protocol_request_t xcb_req = {
1832         /* count */ 2,
1833         /* ext */ &xcb_dri2_id,
1834         /* opcode */ XCB_DRI2_GET_PARAM,
1835         /* isvoid */ 0
1836     };
1837 
1838     struct iovec xcb_parts[4];
1839     xcb_dri2_get_param_cookie_t xcb_ret;
1840     xcb_dri2_get_param_request_t xcb_out;
1841 
1842     xcb_out.drawable = drawable;
1843     xcb_out.param = param;
1844 
1845     xcb_parts[2].iov_base = (char *) &xcb_out;
1846     xcb_parts[2].iov_len = sizeof(xcb_out);
1847     xcb_parts[3].iov_base = 0;
1848     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1849 
1850     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1851     return xcb_ret;
1852 }
1853 
1854 
1855 /*****************************************************************************
1856  **
1857  ** xcb_dri2_get_param_cookie_t xcb_dri2_get_param_unchecked
1858  **
1859  ** @param xcb_connection_t *c
1860  ** @param xcb_drawable_t    drawable
1861  ** @param uint32_t          param
1862  ** @returns xcb_dri2_get_param_cookie_t
1863  **
1864  *****************************************************************************/
1865 
1866 xcb_dri2_get_param_cookie_t
1867 xcb_dri2_get_param_unchecked (xcb_connection_t *c  /**< */,
1868                               xcb_drawable_t    drawable  /**< */,
1869                               uint32_t          param  /**< */)
1870 {
1871     static const xcb_protocol_request_t xcb_req = {
1872         /* count */ 2,
1873         /* ext */ &xcb_dri2_id,
1874         /* opcode */ XCB_DRI2_GET_PARAM,
1875         /* isvoid */ 0
1876     };
1877 
1878     struct iovec xcb_parts[4];
1879     xcb_dri2_get_param_cookie_t xcb_ret;
1880     xcb_dri2_get_param_request_t xcb_out;
1881 
1882     xcb_out.drawable = drawable;
1883     xcb_out.param = param;
1884 
1885     xcb_parts[2].iov_base = (char *) &xcb_out;
1886     xcb_parts[2].iov_len = sizeof(xcb_out);
1887     xcb_parts[3].iov_base = 0;
1888     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1889 
1890     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1891     return xcb_ret;
1892 }
1893 
1894 
1895 /*****************************************************************************
1896  **
1897  ** xcb_dri2_get_param_reply_t * xcb_dri2_get_param_reply
1898  **
1899  ** @param xcb_connection_t             *c
1900  ** @param xcb_dri2_get_param_cookie_t   cookie
1901  ** @param xcb_generic_error_t         **e
1902  ** @returns xcb_dri2_get_param_reply_t *
1903  **
1904  *****************************************************************************/
1905 
1906 xcb_dri2_get_param_reply_t *
1907 xcb_dri2_get_param_reply (xcb_connection_t             *c  /**< */,
1908                           xcb_dri2_get_param_cookie_t   cookie  /**< */,
1909                           xcb_generic_error_t         **e  /**< */)
1910 {
1911     return (xcb_dri2_get_param_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1912 }
1913 
1914