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