xref: /minix3/external/mit/xorg/lib/libxcb/files/dri2.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1971bb1a5SLionel Sambuc /*
2971bb1a5SLionel Sambuc  * This file generated automatically from dri2.xml by c_client.py.
3971bb1a5SLionel Sambuc  * Edit at your peril.
4971bb1a5SLionel Sambuc  */
5971bb1a5SLionel Sambuc 
6971bb1a5SLionel Sambuc #ifdef HAVE_CONFIG_H
7971bb1a5SLionel Sambuc #include "config.h"
8971bb1a5SLionel Sambuc #endif
9971bb1a5SLionel Sambuc #include <stdlib.h>
10971bb1a5SLionel Sambuc #include <string.h>
11971bb1a5SLionel Sambuc #include <assert.h>
12971bb1a5SLionel Sambuc #include <stddef.h>  /* for offsetof() */
13971bb1a5SLionel Sambuc #include "xcbext.h"
14971bb1a5SLionel Sambuc #include "dri2.h"
15971bb1a5SLionel Sambuc 
16971bb1a5SLionel Sambuc #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17971bb1a5SLionel Sambuc #include "xproto.h"
18971bb1a5SLionel Sambuc 
19971bb1a5SLionel Sambuc xcb_extension_t xcb_dri2_id = { "DRI2", 0 };
20971bb1a5SLionel Sambuc 
21971bb1a5SLionel Sambuc void
xcb_dri2_dri2_buffer_next(xcb_dri2_dri2_buffer_iterator_t * i)22971bb1a5SLionel Sambuc xcb_dri2_dri2_buffer_next (xcb_dri2_dri2_buffer_iterator_t *i  /**< */)
23971bb1a5SLionel Sambuc {
24971bb1a5SLionel Sambuc     --i->rem;
25971bb1a5SLionel Sambuc     ++i->data;
26971bb1a5SLionel Sambuc     i->index += sizeof(xcb_dri2_dri2_buffer_t);
27971bb1a5SLionel Sambuc }
28971bb1a5SLionel Sambuc 
29971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_dri2_dri2_buffer_end(xcb_dri2_dri2_buffer_iterator_t i)30971bb1a5SLionel Sambuc xcb_dri2_dri2_buffer_end (xcb_dri2_dri2_buffer_iterator_t i  /**< */)
31971bb1a5SLionel Sambuc {
32971bb1a5SLionel Sambuc     xcb_generic_iterator_t ret;
33971bb1a5SLionel Sambuc     ret.data = i.data + i.rem;
34971bb1a5SLionel Sambuc     ret.index = i.index + ((char *) ret.data - (char *) i.data);
35971bb1a5SLionel Sambuc     ret.rem = 0;
36971bb1a5SLionel Sambuc     return ret;
37971bb1a5SLionel Sambuc }
38971bb1a5SLionel Sambuc 
39971bb1a5SLionel Sambuc void
xcb_dri2_attach_format_next(xcb_dri2_attach_format_iterator_t * i)40971bb1a5SLionel Sambuc xcb_dri2_attach_format_next (xcb_dri2_attach_format_iterator_t *i  /**< */)
41971bb1a5SLionel Sambuc {
42971bb1a5SLionel Sambuc     --i->rem;
43971bb1a5SLionel Sambuc     ++i->data;
44971bb1a5SLionel Sambuc     i->index += sizeof(xcb_dri2_attach_format_t);
45971bb1a5SLionel Sambuc }
46971bb1a5SLionel Sambuc 
47971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_dri2_attach_format_end(xcb_dri2_attach_format_iterator_t i)48971bb1a5SLionel Sambuc xcb_dri2_attach_format_end (xcb_dri2_attach_format_iterator_t i  /**< */)
49971bb1a5SLionel Sambuc {
50971bb1a5SLionel Sambuc     xcb_generic_iterator_t ret;
51971bb1a5SLionel Sambuc     ret.data = i.data + i.rem;
52971bb1a5SLionel Sambuc     ret.index = i.index + ((char *) ret.data - (char *) i.data);
53971bb1a5SLionel Sambuc     ret.rem = 0;
54971bb1a5SLionel Sambuc     return ret;
55971bb1a5SLionel Sambuc }
56971bb1a5SLionel Sambuc 
57971bb1a5SLionel Sambuc xcb_dri2_query_version_cookie_t
xcb_dri2_query_version(xcb_connection_t * c,uint32_t major_version,uint32_t minor_version)58971bb1a5SLionel Sambuc xcb_dri2_query_version (xcb_connection_t *c  /**< */,
59971bb1a5SLionel Sambuc                         uint32_t          major_version  /**< */,
60971bb1a5SLionel Sambuc                         uint32_t          minor_version  /**< */)
61971bb1a5SLionel Sambuc {
62971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
63971bb1a5SLionel Sambuc         /* count */ 2,
64971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
65971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_QUERY_VERSION,
66971bb1a5SLionel Sambuc         /* isvoid */ 0
67971bb1a5SLionel Sambuc     };
68971bb1a5SLionel Sambuc 
69971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
70971bb1a5SLionel Sambuc     xcb_dri2_query_version_cookie_t xcb_ret;
71971bb1a5SLionel Sambuc     xcb_dri2_query_version_request_t xcb_out;
72971bb1a5SLionel Sambuc 
73971bb1a5SLionel Sambuc     xcb_out.major_version = major_version;
74971bb1a5SLionel Sambuc     xcb_out.minor_version = minor_version;
75971bb1a5SLionel Sambuc 
76971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
77971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
78971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
79971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
80971bb1a5SLionel Sambuc 
81971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
82971bb1a5SLionel Sambuc     return xcb_ret;
83971bb1a5SLionel Sambuc }
84971bb1a5SLionel Sambuc 
85971bb1a5SLionel Sambuc xcb_dri2_query_version_cookie_t
xcb_dri2_query_version_unchecked(xcb_connection_t * c,uint32_t major_version,uint32_t minor_version)86971bb1a5SLionel Sambuc xcb_dri2_query_version_unchecked (xcb_connection_t *c  /**< */,
87971bb1a5SLionel Sambuc                                   uint32_t          major_version  /**< */,
88971bb1a5SLionel Sambuc                                   uint32_t          minor_version  /**< */)
89971bb1a5SLionel Sambuc {
90971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
91971bb1a5SLionel Sambuc         /* count */ 2,
92971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
93971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_QUERY_VERSION,
94971bb1a5SLionel Sambuc         /* isvoid */ 0
95971bb1a5SLionel Sambuc     };
96971bb1a5SLionel Sambuc 
97971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
98971bb1a5SLionel Sambuc     xcb_dri2_query_version_cookie_t xcb_ret;
99971bb1a5SLionel Sambuc     xcb_dri2_query_version_request_t xcb_out;
100971bb1a5SLionel Sambuc 
101971bb1a5SLionel Sambuc     xcb_out.major_version = major_version;
102971bb1a5SLionel Sambuc     xcb_out.minor_version = minor_version;
103971bb1a5SLionel Sambuc 
104971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
105971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
106971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
107971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
108971bb1a5SLionel Sambuc 
109971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
110971bb1a5SLionel Sambuc     return xcb_ret;
111971bb1a5SLionel Sambuc }
112971bb1a5SLionel Sambuc 
113971bb1a5SLionel Sambuc xcb_dri2_query_version_reply_t *
xcb_dri2_query_version_reply(xcb_connection_t * c,xcb_dri2_query_version_cookie_t cookie,xcb_generic_error_t ** e)114971bb1a5SLionel Sambuc xcb_dri2_query_version_reply (xcb_connection_t                 *c  /**< */,
115971bb1a5SLionel Sambuc                               xcb_dri2_query_version_cookie_t   cookie  /**< */,
116971bb1a5SLionel Sambuc                               xcb_generic_error_t             **e  /**< */)
117971bb1a5SLionel Sambuc {
118971bb1a5SLionel Sambuc     return (xcb_dri2_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
119971bb1a5SLionel Sambuc }
120971bb1a5SLionel Sambuc 
121971bb1a5SLionel Sambuc int
xcb_dri2_connect_sizeof(const void * _buffer)122971bb1a5SLionel Sambuc xcb_dri2_connect_sizeof (const void  *_buffer  /**< */)
123971bb1a5SLionel Sambuc {
124971bb1a5SLionel Sambuc     char *xcb_tmp = (char *)_buffer;
125971bb1a5SLionel Sambuc     const xcb_dri2_connect_reply_t *_aux = (xcb_dri2_connect_reply_t *)_buffer;
126971bb1a5SLionel Sambuc     unsigned int xcb_buffer_len = 0;
127971bb1a5SLionel Sambuc     unsigned int xcb_block_len = 0;
128971bb1a5SLionel Sambuc     unsigned int xcb_pad = 0;
129*0a6a1f1dSLionel Sambuc     unsigned int xcb_align_to = 0;
130971bb1a5SLionel Sambuc 
131971bb1a5SLionel Sambuc 
132971bb1a5SLionel Sambuc     xcb_block_len += sizeof(xcb_dri2_connect_reply_t);
133971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
134*0a6a1f1dSLionel Sambuc     xcb_buffer_len += xcb_block_len;
135*0a6a1f1dSLionel Sambuc     xcb_block_len = 0;
136971bb1a5SLionel Sambuc     /* driver_name */
137971bb1a5SLionel Sambuc     xcb_block_len += _aux->driver_name_length * sizeof(char);
138971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
139971bb1a5SLionel Sambuc     xcb_align_to = ALIGNOF(char);
140971bb1a5SLionel Sambuc     /* insert padding */
141971bb1a5SLionel Sambuc     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
142971bb1a5SLionel Sambuc     xcb_buffer_len += xcb_block_len + xcb_pad;
143971bb1a5SLionel Sambuc     if (0 != xcb_pad) {
144971bb1a5SLionel Sambuc         xcb_tmp += xcb_pad;
145971bb1a5SLionel Sambuc         xcb_pad = 0;
146971bb1a5SLionel Sambuc     }
147971bb1a5SLionel Sambuc     xcb_block_len = 0;
148971bb1a5SLionel Sambuc     /* alignment_pad */
149971bb1a5SLionel Sambuc     xcb_block_len += (((_aux->driver_name_length + 3) & (~3)) - _aux->driver_name_length) * sizeof(char);
150971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
151971bb1a5SLionel Sambuc     xcb_align_to = ALIGNOF(char);
152971bb1a5SLionel Sambuc     /* insert padding */
153971bb1a5SLionel Sambuc     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
154971bb1a5SLionel Sambuc     xcb_buffer_len += xcb_block_len + xcb_pad;
155971bb1a5SLionel Sambuc     if (0 != xcb_pad) {
156971bb1a5SLionel Sambuc         xcb_tmp += xcb_pad;
157971bb1a5SLionel Sambuc         xcb_pad = 0;
158971bb1a5SLionel Sambuc     }
159971bb1a5SLionel Sambuc     xcb_block_len = 0;
160971bb1a5SLionel Sambuc     /* device_name */
161971bb1a5SLionel Sambuc     xcb_block_len += _aux->device_name_length * sizeof(char);
162971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
163971bb1a5SLionel Sambuc     xcb_align_to = ALIGNOF(char);
164971bb1a5SLionel Sambuc     /* insert padding */
165971bb1a5SLionel Sambuc     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
166971bb1a5SLionel Sambuc     xcb_buffer_len += xcb_block_len + xcb_pad;
167971bb1a5SLionel Sambuc     if (0 != xcb_pad) {
168971bb1a5SLionel Sambuc         xcb_tmp += xcb_pad;
169971bb1a5SLionel Sambuc         xcb_pad = 0;
170971bb1a5SLionel Sambuc     }
171971bb1a5SLionel Sambuc     xcb_block_len = 0;
172971bb1a5SLionel Sambuc 
173971bb1a5SLionel Sambuc     return xcb_buffer_len;
174971bb1a5SLionel Sambuc }
175971bb1a5SLionel Sambuc 
176971bb1a5SLionel Sambuc xcb_dri2_connect_cookie_t
xcb_dri2_connect(xcb_connection_t * c,xcb_window_t window,uint32_t driver_type)177971bb1a5SLionel Sambuc xcb_dri2_connect (xcb_connection_t *c  /**< */,
178971bb1a5SLionel Sambuc                   xcb_window_t      window  /**< */,
179971bb1a5SLionel Sambuc                   uint32_t          driver_type  /**< */)
180971bb1a5SLionel Sambuc {
181971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
182971bb1a5SLionel Sambuc         /* count */ 2,
183971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
184971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_CONNECT,
185971bb1a5SLionel Sambuc         /* isvoid */ 0
186971bb1a5SLionel Sambuc     };
187971bb1a5SLionel Sambuc 
188971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
189971bb1a5SLionel Sambuc     xcb_dri2_connect_cookie_t xcb_ret;
190971bb1a5SLionel Sambuc     xcb_dri2_connect_request_t xcb_out;
191971bb1a5SLionel Sambuc 
192971bb1a5SLionel Sambuc     xcb_out.window = window;
193971bb1a5SLionel Sambuc     xcb_out.driver_type = driver_type;
194971bb1a5SLionel Sambuc 
195971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
196971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
197971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
198971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
199971bb1a5SLionel Sambuc 
200971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
201971bb1a5SLionel Sambuc     return xcb_ret;
202971bb1a5SLionel Sambuc }
203971bb1a5SLionel Sambuc 
204971bb1a5SLionel Sambuc xcb_dri2_connect_cookie_t
xcb_dri2_connect_unchecked(xcb_connection_t * c,xcb_window_t window,uint32_t driver_type)205971bb1a5SLionel Sambuc xcb_dri2_connect_unchecked (xcb_connection_t *c  /**< */,
206971bb1a5SLionel Sambuc                             xcb_window_t      window  /**< */,
207971bb1a5SLionel Sambuc                             uint32_t          driver_type  /**< */)
208971bb1a5SLionel Sambuc {
209971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
210971bb1a5SLionel Sambuc         /* count */ 2,
211971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
212971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_CONNECT,
213971bb1a5SLionel Sambuc         /* isvoid */ 0
214971bb1a5SLionel Sambuc     };
215971bb1a5SLionel Sambuc 
216971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
217971bb1a5SLionel Sambuc     xcb_dri2_connect_cookie_t xcb_ret;
218971bb1a5SLionel Sambuc     xcb_dri2_connect_request_t xcb_out;
219971bb1a5SLionel Sambuc 
220971bb1a5SLionel Sambuc     xcb_out.window = window;
221971bb1a5SLionel Sambuc     xcb_out.driver_type = driver_type;
222971bb1a5SLionel Sambuc 
223971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
224971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
225971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
226971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
227971bb1a5SLionel Sambuc 
228971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
229971bb1a5SLionel Sambuc     return xcb_ret;
230971bb1a5SLionel Sambuc }
231971bb1a5SLionel Sambuc 
232971bb1a5SLionel Sambuc char *
xcb_dri2_connect_driver_name(const xcb_dri2_connect_reply_t * R)233971bb1a5SLionel Sambuc xcb_dri2_connect_driver_name (const xcb_dri2_connect_reply_t *R  /**< */)
234971bb1a5SLionel Sambuc {
235971bb1a5SLionel Sambuc     return (char *) (R + 1);
236971bb1a5SLionel Sambuc }
237971bb1a5SLionel Sambuc 
238971bb1a5SLionel Sambuc int
xcb_dri2_connect_driver_name_length(const xcb_dri2_connect_reply_t * R)239971bb1a5SLionel Sambuc xcb_dri2_connect_driver_name_length (const xcb_dri2_connect_reply_t *R  /**< */)
240971bb1a5SLionel Sambuc {
241971bb1a5SLionel Sambuc     return R->driver_name_length;
242971bb1a5SLionel Sambuc }
243971bb1a5SLionel Sambuc 
244971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_dri2_connect_driver_name_end(const xcb_dri2_connect_reply_t * R)245971bb1a5SLionel Sambuc xcb_dri2_connect_driver_name_end (const xcb_dri2_connect_reply_t *R  /**< */)
246971bb1a5SLionel Sambuc {
247971bb1a5SLionel Sambuc     xcb_generic_iterator_t i;
248971bb1a5SLionel Sambuc     i.data = ((char *) (R + 1)) + (R->driver_name_length);
249971bb1a5SLionel Sambuc     i.rem = 0;
250971bb1a5SLionel Sambuc     i.index = (char *) i.data - (char *) R;
251971bb1a5SLionel Sambuc     return i;
252971bb1a5SLionel Sambuc }
253971bb1a5SLionel Sambuc 
254971bb1a5SLionel Sambuc void *
xcb_dri2_connect_alignment_pad(const xcb_dri2_connect_reply_t * R)255971bb1a5SLionel Sambuc xcb_dri2_connect_alignment_pad (const xcb_dri2_connect_reply_t *R  /**< */)
256971bb1a5SLionel Sambuc {
257971bb1a5SLionel Sambuc     xcb_generic_iterator_t prev = xcb_dri2_connect_driver_name_end(R);
258971bb1a5SLionel Sambuc     return (void *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
259971bb1a5SLionel Sambuc }
260971bb1a5SLionel Sambuc 
261971bb1a5SLionel Sambuc int
xcb_dri2_connect_alignment_pad_length(const xcb_dri2_connect_reply_t * R)262971bb1a5SLionel Sambuc xcb_dri2_connect_alignment_pad_length (const xcb_dri2_connect_reply_t *R  /**< */)
263971bb1a5SLionel Sambuc {
264971bb1a5SLionel Sambuc     return (((R->driver_name_length + 3) & (~3)) - R->driver_name_length);
265971bb1a5SLionel Sambuc }
266971bb1a5SLionel Sambuc 
267971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_dri2_connect_alignment_pad_end(const xcb_dri2_connect_reply_t * R)268971bb1a5SLionel Sambuc xcb_dri2_connect_alignment_pad_end (const xcb_dri2_connect_reply_t *R  /**< */)
269971bb1a5SLionel Sambuc {
270971bb1a5SLionel Sambuc     xcb_generic_iterator_t i;
271971bb1a5SLionel Sambuc     xcb_generic_iterator_t child = xcb_dri2_connect_driver_name_end(R);
272971bb1a5SLionel Sambuc     i.data = ((char *) child.data) + ((((R->driver_name_length + 3) & (~3)) - R->driver_name_length));
273971bb1a5SLionel Sambuc     i.rem = 0;
274971bb1a5SLionel Sambuc     i.index = (char *) i.data - (char *) R;
275971bb1a5SLionel Sambuc     return i;
276971bb1a5SLionel Sambuc }
277971bb1a5SLionel Sambuc 
278971bb1a5SLionel Sambuc char *
xcb_dri2_connect_device_name(const xcb_dri2_connect_reply_t * R)279971bb1a5SLionel Sambuc xcb_dri2_connect_device_name (const xcb_dri2_connect_reply_t *R  /**< */)
280971bb1a5SLionel Sambuc {
281971bb1a5SLionel Sambuc     xcb_generic_iterator_t prev = xcb_dri2_connect_alignment_pad_end(R);
282971bb1a5SLionel Sambuc     return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
283971bb1a5SLionel Sambuc }
284971bb1a5SLionel Sambuc 
285971bb1a5SLionel Sambuc int
xcb_dri2_connect_device_name_length(const xcb_dri2_connect_reply_t * R)286971bb1a5SLionel Sambuc xcb_dri2_connect_device_name_length (const xcb_dri2_connect_reply_t *R  /**< */)
287971bb1a5SLionel Sambuc {
288971bb1a5SLionel Sambuc     return R->device_name_length;
289971bb1a5SLionel Sambuc }
290971bb1a5SLionel Sambuc 
291971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_dri2_connect_device_name_end(const xcb_dri2_connect_reply_t * R)292971bb1a5SLionel Sambuc xcb_dri2_connect_device_name_end (const xcb_dri2_connect_reply_t *R  /**< */)
293971bb1a5SLionel Sambuc {
294971bb1a5SLionel Sambuc     xcb_generic_iterator_t i;
295971bb1a5SLionel Sambuc     xcb_generic_iterator_t child = xcb_dri2_connect_alignment_pad_end(R);
296971bb1a5SLionel Sambuc     i.data = ((char *) child.data) + (R->device_name_length);
297971bb1a5SLionel Sambuc     i.rem = 0;
298971bb1a5SLionel Sambuc     i.index = (char *) i.data - (char *) R;
299971bb1a5SLionel Sambuc     return i;
300971bb1a5SLionel Sambuc }
301971bb1a5SLionel Sambuc 
302971bb1a5SLionel Sambuc xcb_dri2_connect_reply_t *
xcb_dri2_connect_reply(xcb_connection_t * c,xcb_dri2_connect_cookie_t cookie,xcb_generic_error_t ** e)303971bb1a5SLionel Sambuc xcb_dri2_connect_reply (xcb_connection_t           *c  /**< */,
304971bb1a5SLionel Sambuc                         xcb_dri2_connect_cookie_t   cookie  /**< */,
305971bb1a5SLionel Sambuc                         xcb_generic_error_t       **e  /**< */)
306971bb1a5SLionel Sambuc {
307971bb1a5SLionel Sambuc     return (xcb_dri2_connect_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
308971bb1a5SLionel Sambuc }
309971bb1a5SLionel Sambuc 
310971bb1a5SLionel Sambuc xcb_dri2_authenticate_cookie_t
xcb_dri2_authenticate(xcb_connection_t * c,xcb_window_t window,uint32_t magic)311971bb1a5SLionel Sambuc xcb_dri2_authenticate (xcb_connection_t *c  /**< */,
312971bb1a5SLionel Sambuc                        xcb_window_t      window  /**< */,
313971bb1a5SLionel Sambuc                        uint32_t          magic  /**< */)
314971bb1a5SLionel Sambuc {
315971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
316971bb1a5SLionel Sambuc         /* count */ 2,
317971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
318971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_AUTHENTICATE,
319971bb1a5SLionel Sambuc         /* isvoid */ 0
320971bb1a5SLionel Sambuc     };
321971bb1a5SLionel Sambuc 
322971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
323971bb1a5SLionel Sambuc     xcb_dri2_authenticate_cookie_t xcb_ret;
324971bb1a5SLionel Sambuc     xcb_dri2_authenticate_request_t xcb_out;
325971bb1a5SLionel Sambuc 
326971bb1a5SLionel Sambuc     xcb_out.window = window;
327971bb1a5SLionel Sambuc     xcb_out.magic = magic;
328971bb1a5SLionel Sambuc 
329971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
330971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
331971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
332971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
333971bb1a5SLionel Sambuc 
334971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
335971bb1a5SLionel Sambuc     return xcb_ret;
336971bb1a5SLionel Sambuc }
337971bb1a5SLionel Sambuc 
338971bb1a5SLionel Sambuc xcb_dri2_authenticate_cookie_t
xcb_dri2_authenticate_unchecked(xcb_connection_t * c,xcb_window_t window,uint32_t magic)339971bb1a5SLionel Sambuc xcb_dri2_authenticate_unchecked (xcb_connection_t *c  /**< */,
340971bb1a5SLionel Sambuc                                  xcb_window_t      window  /**< */,
341971bb1a5SLionel Sambuc                                  uint32_t          magic  /**< */)
342971bb1a5SLionel Sambuc {
343971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
344971bb1a5SLionel Sambuc         /* count */ 2,
345971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
346971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_AUTHENTICATE,
347971bb1a5SLionel Sambuc         /* isvoid */ 0
348971bb1a5SLionel Sambuc     };
349971bb1a5SLionel Sambuc 
350971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
351971bb1a5SLionel Sambuc     xcb_dri2_authenticate_cookie_t xcb_ret;
352971bb1a5SLionel Sambuc     xcb_dri2_authenticate_request_t xcb_out;
353971bb1a5SLionel Sambuc 
354971bb1a5SLionel Sambuc     xcb_out.window = window;
355971bb1a5SLionel Sambuc     xcb_out.magic = magic;
356971bb1a5SLionel Sambuc 
357971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
358971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
359971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
360971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
361971bb1a5SLionel Sambuc 
362971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
363971bb1a5SLionel Sambuc     return xcb_ret;
364971bb1a5SLionel Sambuc }
365971bb1a5SLionel Sambuc 
366971bb1a5SLionel Sambuc xcb_dri2_authenticate_reply_t *
xcb_dri2_authenticate_reply(xcb_connection_t * c,xcb_dri2_authenticate_cookie_t cookie,xcb_generic_error_t ** e)367971bb1a5SLionel Sambuc xcb_dri2_authenticate_reply (xcb_connection_t                *c  /**< */,
368971bb1a5SLionel Sambuc                              xcb_dri2_authenticate_cookie_t   cookie  /**< */,
369971bb1a5SLionel Sambuc                              xcb_generic_error_t            **e  /**< */)
370971bb1a5SLionel Sambuc {
371971bb1a5SLionel Sambuc     return (xcb_dri2_authenticate_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
372971bb1a5SLionel Sambuc }
373971bb1a5SLionel Sambuc 
374971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_dri2_create_drawable_checked(xcb_connection_t * c,xcb_drawable_t drawable)375971bb1a5SLionel Sambuc xcb_dri2_create_drawable_checked (xcb_connection_t *c  /**< */,
376971bb1a5SLionel Sambuc                                   xcb_drawable_t    drawable  /**< */)
377971bb1a5SLionel Sambuc {
378971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
379971bb1a5SLionel Sambuc         /* count */ 2,
380971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
381971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_CREATE_DRAWABLE,
382971bb1a5SLionel Sambuc         /* isvoid */ 1
383971bb1a5SLionel Sambuc     };
384971bb1a5SLionel Sambuc 
385971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
386971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
387971bb1a5SLionel Sambuc     xcb_dri2_create_drawable_request_t xcb_out;
388971bb1a5SLionel Sambuc 
389971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
390971bb1a5SLionel Sambuc 
391971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
392971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
393971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
394971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
395971bb1a5SLionel Sambuc 
396971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
397971bb1a5SLionel Sambuc     return xcb_ret;
398971bb1a5SLionel Sambuc }
399971bb1a5SLionel Sambuc 
400971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_dri2_create_drawable(xcb_connection_t * c,xcb_drawable_t drawable)401971bb1a5SLionel Sambuc xcb_dri2_create_drawable (xcb_connection_t *c  /**< */,
402971bb1a5SLionel Sambuc                           xcb_drawable_t    drawable  /**< */)
403971bb1a5SLionel Sambuc {
404971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
405971bb1a5SLionel Sambuc         /* count */ 2,
406971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
407971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_CREATE_DRAWABLE,
408971bb1a5SLionel Sambuc         /* isvoid */ 1
409971bb1a5SLionel Sambuc     };
410971bb1a5SLionel Sambuc 
411971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
412971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
413971bb1a5SLionel Sambuc     xcb_dri2_create_drawable_request_t xcb_out;
414971bb1a5SLionel Sambuc 
415971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
416971bb1a5SLionel Sambuc 
417971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
418971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
419971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
420971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
421971bb1a5SLionel Sambuc 
422971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
423971bb1a5SLionel Sambuc     return xcb_ret;
424971bb1a5SLionel Sambuc }
425971bb1a5SLionel Sambuc 
426971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_dri2_destroy_drawable_checked(xcb_connection_t * c,xcb_drawable_t drawable)427971bb1a5SLionel Sambuc xcb_dri2_destroy_drawable_checked (xcb_connection_t *c  /**< */,
428971bb1a5SLionel Sambuc                                    xcb_drawable_t    drawable  /**< */)
429971bb1a5SLionel Sambuc {
430971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
431971bb1a5SLionel Sambuc         /* count */ 2,
432971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
433971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_DESTROY_DRAWABLE,
434971bb1a5SLionel Sambuc         /* isvoid */ 1
435971bb1a5SLionel Sambuc     };
436971bb1a5SLionel Sambuc 
437971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
438971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
439971bb1a5SLionel Sambuc     xcb_dri2_destroy_drawable_request_t xcb_out;
440971bb1a5SLionel Sambuc 
441971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
442971bb1a5SLionel Sambuc 
443971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
444971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
445971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
446971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
447971bb1a5SLionel Sambuc 
448971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
449971bb1a5SLionel Sambuc     return xcb_ret;
450971bb1a5SLionel Sambuc }
451971bb1a5SLionel Sambuc 
452971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_dri2_destroy_drawable(xcb_connection_t * c,xcb_drawable_t drawable)453971bb1a5SLionel Sambuc xcb_dri2_destroy_drawable (xcb_connection_t *c  /**< */,
454971bb1a5SLionel Sambuc                            xcb_drawable_t    drawable  /**< */)
455971bb1a5SLionel Sambuc {
456971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
457971bb1a5SLionel Sambuc         /* count */ 2,
458971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
459971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_DESTROY_DRAWABLE,
460971bb1a5SLionel Sambuc         /* isvoid */ 1
461971bb1a5SLionel Sambuc     };
462971bb1a5SLionel Sambuc 
463971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
464971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
465971bb1a5SLionel Sambuc     xcb_dri2_destroy_drawable_request_t xcb_out;
466971bb1a5SLionel Sambuc 
467971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
468971bb1a5SLionel Sambuc 
469971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
470971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
471971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
472971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
473971bb1a5SLionel Sambuc 
474971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
475971bb1a5SLionel Sambuc     return xcb_ret;
476971bb1a5SLionel Sambuc }
477971bb1a5SLionel Sambuc 
478971bb1a5SLionel Sambuc int
xcb_dri2_get_buffers_sizeof(const void * _buffer,uint32_t attachments_len)479971bb1a5SLionel Sambuc xcb_dri2_get_buffers_sizeof (const void  *_buffer  /**< */,
480971bb1a5SLionel Sambuc                              uint32_t     attachments_len  /**< */)
481971bb1a5SLionel Sambuc {
482971bb1a5SLionel Sambuc     char *xcb_tmp = (char *)_buffer;
483971bb1a5SLionel Sambuc     unsigned int xcb_buffer_len = 0;
484971bb1a5SLionel Sambuc     unsigned int xcb_block_len = 0;
485971bb1a5SLionel Sambuc     unsigned int xcb_pad = 0;
486*0a6a1f1dSLionel Sambuc     unsigned int xcb_align_to = 0;
487971bb1a5SLionel Sambuc 
488971bb1a5SLionel Sambuc 
489971bb1a5SLionel Sambuc     xcb_block_len += sizeof(xcb_dri2_get_buffers_request_t);
490971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
491*0a6a1f1dSLionel Sambuc     xcb_buffer_len += xcb_block_len;
492*0a6a1f1dSLionel Sambuc     xcb_block_len = 0;
493971bb1a5SLionel Sambuc     /* attachments */
494971bb1a5SLionel Sambuc     xcb_block_len += attachments_len * sizeof(uint32_t);
495971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
496971bb1a5SLionel Sambuc     xcb_align_to = ALIGNOF(uint32_t);
497971bb1a5SLionel Sambuc     /* insert padding */
498971bb1a5SLionel Sambuc     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
499971bb1a5SLionel Sambuc     xcb_buffer_len += xcb_block_len + xcb_pad;
500971bb1a5SLionel Sambuc     if (0 != xcb_pad) {
501971bb1a5SLionel Sambuc         xcb_tmp += xcb_pad;
502971bb1a5SLionel Sambuc         xcb_pad = 0;
503971bb1a5SLionel Sambuc     }
504971bb1a5SLionel Sambuc     xcb_block_len = 0;
505971bb1a5SLionel Sambuc 
506971bb1a5SLionel Sambuc     return xcb_buffer_len;
507971bb1a5SLionel Sambuc }
508971bb1a5SLionel Sambuc 
509971bb1a5SLionel Sambuc xcb_dri2_get_buffers_cookie_t
xcb_dri2_get_buffers(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t count,uint32_t attachments_len,const uint32_t * attachments)510971bb1a5SLionel Sambuc xcb_dri2_get_buffers (xcb_connection_t *c  /**< */,
511971bb1a5SLionel Sambuc                       xcb_drawable_t    drawable  /**< */,
512971bb1a5SLionel Sambuc                       uint32_t          count  /**< */,
513971bb1a5SLionel Sambuc                       uint32_t          attachments_len  /**< */,
514971bb1a5SLionel Sambuc                       const uint32_t   *attachments  /**< */)
515971bb1a5SLionel Sambuc {
516971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
517971bb1a5SLionel Sambuc         /* count */ 4,
518971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
519971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_GET_BUFFERS,
520971bb1a5SLionel Sambuc         /* isvoid */ 0
521971bb1a5SLionel Sambuc     };
522971bb1a5SLionel Sambuc 
523971bb1a5SLionel Sambuc     struct iovec xcb_parts[6];
524971bb1a5SLionel Sambuc     xcb_dri2_get_buffers_cookie_t xcb_ret;
525971bb1a5SLionel Sambuc     xcb_dri2_get_buffers_request_t xcb_out;
526971bb1a5SLionel Sambuc 
527971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
528971bb1a5SLionel Sambuc     xcb_out.count = count;
529971bb1a5SLionel Sambuc 
530971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
531971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
532971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
533971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
534971bb1a5SLionel Sambuc     /* uint32_t attachments */
535971bb1a5SLionel Sambuc     xcb_parts[4].iov_base = (char *) attachments;
536971bb1a5SLionel Sambuc     xcb_parts[4].iov_len = attachments_len * sizeof(uint32_t);
537971bb1a5SLionel Sambuc     xcb_parts[5].iov_base = 0;
538971bb1a5SLionel Sambuc     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
539971bb1a5SLionel Sambuc 
540971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
541971bb1a5SLionel Sambuc     return xcb_ret;
542971bb1a5SLionel Sambuc }
543971bb1a5SLionel Sambuc 
544971bb1a5SLionel Sambuc xcb_dri2_get_buffers_cookie_t
xcb_dri2_get_buffers_unchecked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t count,uint32_t attachments_len,const uint32_t * attachments)545971bb1a5SLionel Sambuc xcb_dri2_get_buffers_unchecked (xcb_connection_t *c  /**< */,
546971bb1a5SLionel Sambuc                                 xcb_drawable_t    drawable  /**< */,
547971bb1a5SLionel Sambuc                                 uint32_t          count  /**< */,
548971bb1a5SLionel Sambuc                                 uint32_t          attachments_len  /**< */,
549971bb1a5SLionel Sambuc                                 const uint32_t   *attachments  /**< */)
550971bb1a5SLionel Sambuc {
551971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
552971bb1a5SLionel Sambuc         /* count */ 4,
553971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
554971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_GET_BUFFERS,
555971bb1a5SLionel Sambuc         /* isvoid */ 0
556971bb1a5SLionel Sambuc     };
557971bb1a5SLionel Sambuc 
558971bb1a5SLionel Sambuc     struct iovec xcb_parts[6];
559971bb1a5SLionel Sambuc     xcb_dri2_get_buffers_cookie_t xcb_ret;
560971bb1a5SLionel Sambuc     xcb_dri2_get_buffers_request_t xcb_out;
561971bb1a5SLionel Sambuc 
562971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
563971bb1a5SLionel Sambuc     xcb_out.count = count;
564971bb1a5SLionel Sambuc 
565971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
566971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
567971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
568971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
569971bb1a5SLionel Sambuc     /* uint32_t attachments */
570971bb1a5SLionel Sambuc     xcb_parts[4].iov_base = (char *) attachments;
571971bb1a5SLionel Sambuc     xcb_parts[4].iov_len = attachments_len * sizeof(uint32_t);
572971bb1a5SLionel Sambuc     xcb_parts[5].iov_base = 0;
573971bb1a5SLionel Sambuc     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
574971bb1a5SLionel Sambuc 
575971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
576971bb1a5SLionel Sambuc     return xcb_ret;
577971bb1a5SLionel Sambuc }
578971bb1a5SLionel Sambuc 
579971bb1a5SLionel Sambuc xcb_dri2_dri2_buffer_t *
xcb_dri2_get_buffers_buffers(const xcb_dri2_get_buffers_reply_t * R)580971bb1a5SLionel Sambuc xcb_dri2_get_buffers_buffers (const xcb_dri2_get_buffers_reply_t *R  /**< */)
581971bb1a5SLionel Sambuc {
582971bb1a5SLionel Sambuc     return (xcb_dri2_dri2_buffer_t *) (R + 1);
583971bb1a5SLionel Sambuc }
584971bb1a5SLionel Sambuc 
585971bb1a5SLionel Sambuc int
xcb_dri2_get_buffers_buffers_length(const xcb_dri2_get_buffers_reply_t * R)586971bb1a5SLionel Sambuc xcb_dri2_get_buffers_buffers_length (const xcb_dri2_get_buffers_reply_t *R  /**< */)
587971bb1a5SLionel Sambuc {
588971bb1a5SLionel Sambuc     return R->count;
589971bb1a5SLionel Sambuc }
590971bb1a5SLionel Sambuc 
591971bb1a5SLionel Sambuc xcb_dri2_dri2_buffer_iterator_t
xcb_dri2_get_buffers_buffers_iterator(const xcb_dri2_get_buffers_reply_t * R)592971bb1a5SLionel Sambuc xcb_dri2_get_buffers_buffers_iterator (const xcb_dri2_get_buffers_reply_t *R  /**< */)
593971bb1a5SLionel Sambuc {
594971bb1a5SLionel Sambuc     xcb_dri2_dri2_buffer_iterator_t i;
595971bb1a5SLionel Sambuc     i.data = (xcb_dri2_dri2_buffer_t *) (R + 1);
596971bb1a5SLionel Sambuc     i.rem = R->count;
597971bb1a5SLionel Sambuc     i.index = (char *) i.data - (char *) R;
598971bb1a5SLionel Sambuc     return i;
599971bb1a5SLionel Sambuc }
600971bb1a5SLionel Sambuc 
601971bb1a5SLionel Sambuc xcb_dri2_get_buffers_reply_t *
xcb_dri2_get_buffers_reply(xcb_connection_t * c,xcb_dri2_get_buffers_cookie_t cookie,xcb_generic_error_t ** e)602971bb1a5SLionel Sambuc xcb_dri2_get_buffers_reply (xcb_connection_t               *c  /**< */,
603971bb1a5SLionel Sambuc                             xcb_dri2_get_buffers_cookie_t   cookie  /**< */,
604971bb1a5SLionel Sambuc                             xcb_generic_error_t           **e  /**< */)
605971bb1a5SLionel Sambuc {
606971bb1a5SLionel Sambuc     return (xcb_dri2_get_buffers_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
607971bb1a5SLionel Sambuc }
608971bb1a5SLionel Sambuc 
609971bb1a5SLionel Sambuc xcb_dri2_copy_region_cookie_t
xcb_dri2_copy_region(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t region,uint32_t dest,uint32_t src)610971bb1a5SLionel Sambuc xcb_dri2_copy_region (xcb_connection_t *c  /**< */,
611971bb1a5SLionel Sambuc                       xcb_drawable_t    drawable  /**< */,
612971bb1a5SLionel Sambuc                       uint32_t          region  /**< */,
613971bb1a5SLionel Sambuc                       uint32_t          dest  /**< */,
614971bb1a5SLionel Sambuc                       uint32_t          src  /**< */)
615971bb1a5SLionel Sambuc {
616971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
617971bb1a5SLionel Sambuc         /* count */ 2,
618971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
619971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_COPY_REGION,
620971bb1a5SLionel Sambuc         /* isvoid */ 0
621971bb1a5SLionel Sambuc     };
622971bb1a5SLionel Sambuc 
623971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
624971bb1a5SLionel Sambuc     xcb_dri2_copy_region_cookie_t xcb_ret;
625971bb1a5SLionel Sambuc     xcb_dri2_copy_region_request_t xcb_out;
626971bb1a5SLionel Sambuc 
627971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
628971bb1a5SLionel Sambuc     xcb_out.region = region;
629971bb1a5SLionel Sambuc     xcb_out.dest = dest;
630971bb1a5SLionel Sambuc     xcb_out.src = src;
631971bb1a5SLionel Sambuc 
632971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
633971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
634971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
635971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
636971bb1a5SLionel Sambuc 
637971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
638971bb1a5SLionel Sambuc     return xcb_ret;
639971bb1a5SLionel Sambuc }
640971bb1a5SLionel Sambuc 
641971bb1a5SLionel Sambuc xcb_dri2_copy_region_cookie_t
xcb_dri2_copy_region_unchecked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t region,uint32_t dest,uint32_t src)642971bb1a5SLionel Sambuc xcb_dri2_copy_region_unchecked (xcb_connection_t *c  /**< */,
643971bb1a5SLionel Sambuc                                 xcb_drawable_t    drawable  /**< */,
644971bb1a5SLionel Sambuc                                 uint32_t          region  /**< */,
645971bb1a5SLionel Sambuc                                 uint32_t          dest  /**< */,
646971bb1a5SLionel Sambuc                                 uint32_t          src  /**< */)
647971bb1a5SLionel Sambuc {
648971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
649971bb1a5SLionel Sambuc         /* count */ 2,
650971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
651971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_COPY_REGION,
652971bb1a5SLionel Sambuc         /* isvoid */ 0
653971bb1a5SLionel Sambuc     };
654971bb1a5SLionel Sambuc 
655971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
656971bb1a5SLionel Sambuc     xcb_dri2_copy_region_cookie_t xcb_ret;
657971bb1a5SLionel Sambuc     xcb_dri2_copy_region_request_t xcb_out;
658971bb1a5SLionel Sambuc 
659971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
660971bb1a5SLionel Sambuc     xcb_out.region = region;
661971bb1a5SLionel Sambuc     xcb_out.dest = dest;
662971bb1a5SLionel Sambuc     xcb_out.src = src;
663971bb1a5SLionel Sambuc 
664971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
665971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
666971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
667971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
668971bb1a5SLionel Sambuc 
669971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
670971bb1a5SLionel Sambuc     return xcb_ret;
671971bb1a5SLionel Sambuc }
672971bb1a5SLionel Sambuc 
673971bb1a5SLionel Sambuc xcb_dri2_copy_region_reply_t *
xcb_dri2_copy_region_reply(xcb_connection_t * c,xcb_dri2_copy_region_cookie_t cookie,xcb_generic_error_t ** e)674971bb1a5SLionel Sambuc xcb_dri2_copy_region_reply (xcb_connection_t               *c  /**< */,
675971bb1a5SLionel Sambuc                             xcb_dri2_copy_region_cookie_t   cookie  /**< */,
676971bb1a5SLionel Sambuc                             xcb_generic_error_t           **e  /**< */)
677971bb1a5SLionel Sambuc {
678971bb1a5SLionel Sambuc     return (xcb_dri2_copy_region_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
679971bb1a5SLionel Sambuc }
680971bb1a5SLionel Sambuc 
681971bb1a5SLionel Sambuc int
xcb_dri2_get_buffers_with_format_sizeof(const void * _buffer,uint32_t attachments_len)682971bb1a5SLionel Sambuc xcb_dri2_get_buffers_with_format_sizeof (const void  *_buffer  /**< */,
683971bb1a5SLionel Sambuc                                          uint32_t     attachments_len  /**< */)
684971bb1a5SLionel Sambuc {
685971bb1a5SLionel Sambuc     char *xcb_tmp = (char *)_buffer;
686971bb1a5SLionel Sambuc     unsigned int xcb_buffer_len = 0;
687971bb1a5SLionel Sambuc     unsigned int xcb_block_len = 0;
688971bb1a5SLionel Sambuc     unsigned int xcb_pad = 0;
689*0a6a1f1dSLionel Sambuc     unsigned int xcb_align_to = 0;
690971bb1a5SLionel Sambuc 
691971bb1a5SLionel Sambuc 
692971bb1a5SLionel Sambuc     xcb_block_len += sizeof(xcb_dri2_get_buffers_with_format_request_t);
693971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
694*0a6a1f1dSLionel Sambuc     xcb_buffer_len += xcb_block_len;
695*0a6a1f1dSLionel Sambuc     xcb_block_len = 0;
696971bb1a5SLionel Sambuc     /* attachments */
697971bb1a5SLionel Sambuc     xcb_block_len += attachments_len * sizeof(xcb_dri2_attach_format_t);
698971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
699971bb1a5SLionel Sambuc     xcb_align_to = ALIGNOF(xcb_dri2_attach_format_t);
700971bb1a5SLionel Sambuc     /* insert padding */
701971bb1a5SLionel Sambuc     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
702971bb1a5SLionel Sambuc     xcb_buffer_len += xcb_block_len + xcb_pad;
703971bb1a5SLionel Sambuc     if (0 != xcb_pad) {
704971bb1a5SLionel Sambuc         xcb_tmp += xcb_pad;
705971bb1a5SLionel Sambuc         xcb_pad = 0;
706971bb1a5SLionel Sambuc     }
707971bb1a5SLionel Sambuc     xcb_block_len = 0;
708971bb1a5SLionel Sambuc 
709971bb1a5SLionel Sambuc     return xcb_buffer_len;
710971bb1a5SLionel Sambuc }
711971bb1a5SLionel Sambuc 
712971bb1a5SLionel Sambuc xcb_dri2_get_buffers_with_format_cookie_t
xcb_dri2_get_buffers_with_format(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t count,uint32_t attachments_len,const xcb_dri2_attach_format_t * attachments)713971bb1a5SLionel Sambuc xcb_dri2_get_buffers_with_format (xcb_connection_t               *c  /**< */,
714971bb1a5SLionel Sambuc                                   xcb_drawable_t                  drawable  /**< */,
715971bb1a5SLionel Sambuc                                   uint32_t                        count  /**< */,
716971bb1a5SLionel Sambuc                                   uint32_t                        attachments_len  /**< */,
717971bb1a5SLionel Sambuc                                   const xcb_dri2_attach_format_t *attachments  /**< */)
718971bb1a5SLionel Sambuc {
719971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
720971bb1a5SLionel Sambuc         /* count */ 4,
721971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
722971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_GET_BUFFERS_WITH_FORMAT,
723971bb1a5SLionel Sambuc         /* isvoid */ 0
724971bb1a5SLionel Sambuc     };
725971bb1a5SLionel Sambuc 
726971bb1a5SLionel Sambuc     struct iovec xcb_parts[6];
727971bb1a5SLionel Sambuc     xcb_dri2_get_buffers_with_format_cookie_t xcb_ret;
728971bb1a5SLionel Sambuc     xcb_dri2_get_buffers_with_format_request_t xcb_out;
729971bb1a5SLionel Sambuc 
730971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
731971bb1a5SLionel Sambuc     xcb_out.count = count;
732971bb1a5SLionel Sambuc 
733971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
734971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
735971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
736971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
737971bb1a5SLionel Sambuc     /* xcb_dri2_attach_format_t attachments */
738971bb1a5SLionel Sambuc     xcb_parts[4].iov_base = (char *) attachments;
739971bb1a5SLionel Sambuc     xcb_parts[4].iov_len = attachments_len * sizeof(xcb_dri2_attach_format_t);
740971bb1a5SLionel Sambuc     xcb_parts[5].iov_base = 0;
741971bb1a5SLionel Sambuc     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
742971bb1a5SLionel Sambuc 
743971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
744971bb1a5SLionel Sambuc     return xcb_ret;
745971bb1a5SLionel Sambuc }
746971bb1a5SLionel Sambuc 
747971bb1a5SLionel Sambuc xcb_dri2_get_buffers_with_format_cookie_t
xcb_dri2_get_buffers_with_format_unchecked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t count,uint32_t attachments_len,const xcb_dri2_attach_format_t * attachments)748971bb1a5SLionel Sambuc xcb_dri2_get_buffers_with_format_unchecked (xcb_connection_t               *c  /**< */,
749971bb1a5SLionel Sambuc                                             xcb_drawable_t                  drawable  /**< */,
750971bb1a5SLionel Sambuc                                             uint32_t                        count  /**< */,
751971bb1a5SLionel Sambuc                                             uint32_t                        attachments_len  /**< */,
752971bb1a5SLionel Sambuc                                             const xcb_dri2_attach_format_t *attachments  /**< */)
753971bb1a5SLionel Sambuc {
754971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
755971bb1a5SLionel Sambuc         /* count */ 4,
756971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
757971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_GET_BUFFERS_WITH_FORMAT,
758971bb1a5SLionel Sambuc         /* isvoid */ 0
759971bb1a5SLionel Sambuc     };
760971bb1a5SLionel Sambuc 
761971bb1a5SLionel Sambuc     struct iovec xcb_parts[6];
762971bb1a5SLionel Sambuc     xcb_dri2_get_buffers_with_format_cookie_t xcb_ret;
763971bb1a5SLionel Sambuc     xcb_dri2_get_buffers_with_format_request_t xcb_out;
764971bb1a5SLionel Sambuc 
765971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
766971bb1a5SLionel Sambuc     xcb_out.count = count;
767971bb1a5SLionel Sambuc 
768971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
769971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
770971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
771971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
772971bb1a5SLionel Sambuc     /* xcb_dri2_attach_format_t attachments */
773971bb1a5SLionel Sambuc     xcb_parts[4].iov_base = (char *) attachments;
774971bb1a5SLionel Sambuc     xcb_parts[4].iov_len = attachments_len * sizeof(xcb_dri2_attach_format_t);
775971bb1a5SLionel Sambuc     xcb_parts[5].iov_base = 0;
776971bb1a5SLionel Sambuc     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
777971bb1a5SLionel Sambuc 
778971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
779971bb1a5SLionel Sambuc     return xcb_ret;
780971bb1a5SLionel Sambuc }
781971bb1a5SLionel Sambuc 
782971bb1a5SLionel Sambuc xcb_dri2_dri2_buffer_t *
xcb_dri2_get_buffers_with_format_buffers(const xcb_dri2_get_buffers_with_format_reply_t * R)783971bb1a5SLionel Sambuc xcb_dri2_get_buffers_with_format_buffers (const xcb_dri2_get_buffers_with_format_reply_t *R  /**< */)
784971bb1a5SLionel Sambuc {
785971bb1a5SLionel Sambuc     return (xcb_dri2_dri2_buffer_t *) (R + 1);
786971bb1a5SLionel Sambuc }
787971bb1a5SLionel Sambuc 
788971bb1a5SLionel Sambuc int
xcb_dri2_get_buffers_with_format_buffers_length(const xcb_dri2_get_buffers_with_format_reply_t * R)789971bb1a5SLionel Sambuc xcb_dri2_get_buffers_with_format_buffers_length (const xcb_dri2_get_buffers_with_format_reply_t *R  /**< */)
790971bb1a5SLionel Sambuc {
791971bb1a5SLionel Sambuc     return R->count;
792971bb1a5SLionel Sambuc }
793971bb1a5SLionel Sambuc 
794971bb1a5SLionel Sambuc xcb_dri2_dri2_buffer_iterator_t
xcb_dri2_get_buffers_with_format_buffers_iterator(const xcb_dri2_get_buffers_with_format_reply_t * R)795971bb1a5SLionel Sambuc xcb_dri2_get_buffers_with_format_buffers_iterator (const xcb_dri2_get_buffers_with_format_reply_t *R  /**< */)
796971bb1a5SLionel Sambuc {
797971bb1a5SLionel Sambuc     xcb_dri2_dri2_buffer_iterator_t i;
798971bb1a5SLionel Sambuc     i.data = (xcb_dri2_dri2_buffer_t *) (R + 1);
799971bb1a5SLionel Sambuc     i.rem = R->count;
800971bb1a5SLionel Sambuc     i.index = (char *) i.data - (char *) R;
801971bb1a5SLionel Sambuc     return i;
802971bb1a5SLionel Sambuc }
803971bb1a5SLionel Sambuc 
804971bb1a5SLionel Sambuc xcb_dri2_get_buffers_with_format_reply_t *
xcb_dri2_get_buffers_with_format_reply(xcb_connection_t * c,xcb_dri2_get_buffers_with_format_cookie_t cookie,xcb_generic_error_t ** e)805971bb1a5SLionel Sambuc xcb_dri2_get_buffers_with_format_reply (xcb_connection_t                           *c  /**< */,
806971bb1a5SLionel Sambuc                                         xcb_dri2_get_buffers_with_format_cookie_t   cookie  /**< */,
807971bb1a5SLionel Sambuc                                         xcb_generic_error_t                       **e  /**< */)
808971bb1a5SLionel Sambuc {
809971bb1a5SLionel Sambuc     return (xcb_dri2_get_buffers_with_format_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
810971bb1a5SLionel Sambuc }
811971bb1a5SLionel Sambuc 
812971bb1a5SLionel Sambuc xcb_dri2_swap_buffers_cookie_t
xcb_dri2_swap_buffers(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t target_msc_hi,uint32_t target_msc_lo,uint32_t divisor_hi,uint32_t divisor_lo,uint32_t remainder_hi,uint32_t remainder_lo)813971bb1a5SLionel Sambuc xcb_dri2_swap_buffers (xcb_connection_t *c  /**< */,
814971bb1a5SLionel Sambuc                        xcb_drawable_t    drawable  /**< */,
815971bb1a5SLionel Sambuc                        uint32_t          target_msc_hi  /**< */,
816971bb1a5SLionel Sambuc                        uint32_t          target_msc_lo  /**< */,
817971bb1a5SLionel Sambuc                        uint32_t          divisor_hi  /**< */,
818971bb1a5SLionel Sambuc                        uint32_t          divisor_lo  /**< */,
819971bb1a5SLionel Sambuc                        uint32_t          remainder_hi  /**< */,
820971bb1a5SLionel Sambuc                        uint32_t          remainder_lo  /**< */)
821971bb1a5SLionel Sambuc {
822971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
823971bb1a5SLionel Sambuc         /* count */ 2,
824971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
825971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_SWAP_BUFFERS,
826971bb1a5SLionel Sambuc         /* isvoid */ 0
827971bb1a5SLionel Sambuc     };
828971bb1a5SLionel Sambuc 
829971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
830971bb1a5SLionel Sambuc     xcb_dri2_swap_buffers_cookie_t xcb_ret;
831971bb1a5SLionel Sambuc     xcb_dri2_swap_buffers_request_t xcb_out;
832971bb1a5SLionel Sambuc 
833971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
834971bb1a5SLionel Sambuc     xcb_out.target_msc_hi = target_msc_hi;
835971bb1a5SLionel Sambuc     xcb_out.target_msc_lo = target_msc_lo;
836971bb1a5SLionel Sambuc     xcb_out.divisor_hi = divisor_hi;
837971bb1a5SLionel Sambuc     xcb_out.divisor_lo = divisor_lo;
838971bb1a5SLionel Sambuc     xcb_out.remainder_hi = remainder_hi;
839971bb1a5SLionel Sambuc     xcb_out.remainder_lo = remainder_lo;
840971bb1a5SLionel Sambuc 
841971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
842971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
843971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
844971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
845971bb1a5SLionel Sambuc 
846971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
847971bb1a5SLionel Sambuc     return xcb_ret;
848971bb1a5SLionel Sambuc }
849971bb1a5SLionel Sambuc 
850971bb1a5SLionel Sambuc xcb_dri2_swap_buffers_cookie_t
xcb_dri2_swap_buffers_unchecked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t target_msc_hi,uint32_t target_msc_lo,uint32_t divisor_hi,uint32_t divisor_lo,uint32_t remainder_hi,uint32_t remainder_lo)851971bb1a5SLionel Sambuc xcb_dri2_swap_buffers_unchecked (xcb_connection_t *c  /**< */,
852971bb1a5SLionel Sambuc                                  xcb_drawable_t    drawable  /**< */,
853971bb1a5SLionel Sambuc                                  uint32_t          target_msc_hi  /**< */,
854971bb1a5SLionel Sambuc                                  uint32_t          target_msc_lo  /**< */,
855971bb1a5SLionel Sambuc                                  uint32_t          divisor_hi  /**< */,
856971bb1a5SLionel Sambuc                                  uint32_t          divisor_lo  /**< */,
857971bb1a5SLionel Sambuc                                  uint32_t          remainder_hi  /**< */,
858971bb1a5SLionel Sambuc                                  uint32_t          remainder_lo  /**< */)
859971bb1a5SLionel Sambuc {
860971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
861971bb1a5SLionel Sambuc         /* count */ 2,
862971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
863971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_SWAP_BUFFERS,
864971bb1a5SLionel Sambuc         /* isvoid */ 0
865971bb1a5SLionel Sambuc     };
866971bb1a5SLionel Sambuc 
867971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
868971bb1a5SLionel Sambuc     xcb_dri2_swap_buffers_cookie_t xcb_ret;
869971bb1a5SLionel Sambuc     xcb_dri2_swap_buffers_request_t xcb_out;
870971bb1a5SLionel Sambuc 
871971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
872971bb1a5SLionel Sambuc     xcb_out.target_msc_hi = target_msc_hi;
873971bb1a5SLionel Sambuc     xcb_out.target_msc_lo = target_msc_lo;
874971bb1a5SLionel Sambuc     xcb_out.divisor_hi = divisor_hi;
875971bb1a5SLionel Sambuc     xcb_out.divisor_lo = divisor_lo;
876971bb1a5SLionel Sambuc     xcb_out.remainder_hi = remainder_hi;
877971bb1a5SLionel Sambuc     xcb_out.remainder_lo = remainder_lo;
878971bb1a5SLionel Sambuc 
879971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
880971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
881971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
882971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
883971bb1a5SLionel Sambuc 
884971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
885971bb1a5SLionel Sambuc     return xcb_ret;
886971bb1a5SLionel Sambuc }
887971bb1a5SLionel Sambuc 
888971bb1a5SLionel Sambuc xcb_dri2_swap_buffers_reply_t *
xcb_dri2_swap_buffers_reply(xcb_connection_t * c,xcb_dri2_swap_buffers_cookie_t cookie,xcb_generic_error_t ** e)889971bb1a5SLionel Sambuc xcb_dri2_swap_buffers_reply (xcb_connection_t                *c  /**< */,
890971bb1a5SLionel Sambuc                              xcb_dri2_swap_buffers_cookie_t   cookie  /**< */,
891971bb1a5SLionel Sambuc                              xcb_generic_error_t            **e  /**< */)
892971bb1a5SLionel Sambuc {
893971bb1a5SLionel Sambuc     return (xcb_dri2_swap_buffers_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
894971bb1a5SLionel Sambuc }
895971bb1a5SLionel Sambuc 
896971bb1a5SLionel Sambuc xcb_dri2_get_msc_cookie_t
xcb_dri2_get_msc(xcb_connection_t * c,xcb_drawable_t drawable)897971bb1a5SLionel Sambuc xcb_dri2_get_msc (xcb_connection_t *c  /**< */,
898971bb1a5SLionel Sambuc                   xcb_drawable_t    drawable  /**< */)
899971bb1a5SLionel Sambuc {
900971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
901971bb1a5SLionel Sambuc         /* count */ 2,
902971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
903971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_GET_MSC,
904971bb1a5SLionel Sambuc         /* isvoid */ 0
905971bb1a5SLionel Sambuc     };
906971bb1a5SLionel Sambuc 
907971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
908971bb1a5SLionel Sambuc     xcb_dri2_get_msc_cookie_t xcb_ret;
909971bb1a5SLionel Sambuc     xcb_dri2_get_msc_request_t xcb_out;
910971bb1a5SLionel Sambuc 
911971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
912971bb1a5SLionel Sambuc 
913971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
914971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
915971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
916971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
917971bb1a5SLionel Sambuc 
918971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
919971bb1a5SLionel Sambuc     return xcb_ret;
920971bb1a5SLionel Sambuc }
921971bb1a5SLionel Sambuc 
922971bb1a5SLionel Sambuc xcb_dri2_get_msc_cookie_t
xcb_dri2_get_msc_unchecked(xcb_connection_t * c,xcb_drawable_t drawable)923971bb1a5SLionel Sambuc xcb_dri2_get_msc_unchecked (xcb_connection_t *c  /**< */,
924971bb1a5SLionel Sambuc                             xcb_drawable_t    drawable  /**< */)
925971bb1a5SLionel Sambuc {
926971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
927971bb1a5SLionel Sambuc         /* count */ 2,
928971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
929971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_GET_MSC,
930971bb1a5SLionel Sambuc         /* isvoid */ 0
931971bb1a5SLionel Sambuc     };
932971bb1a5SLionel Sambuc 
933971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
934971bb1a5SLionel Sambuc     xcb_dri2_get_msc_cookie_t xcb_ret;
935971bb1a5SLionel Sambuc     xcb_dri2_get_msc_request_t xcb_out;
936971bb1a5SLionel Sambuc 
937971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
938971bb1a5SLionel Sambuc 
939971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
940971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
941971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
942971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
943971bb1a5SLionel Sambuc 
944971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
945971bb1a5SLionel Sambuc     return xcb_ret;
946971bb1a5SLionel Sambuc }
947971bb1a5SLionel Sambuc 
948971bb1a5SLionel Sambuc xcb_dri2_get_msc_reply_t *
xcb_dri2_get_msc_reply(xcb_connection_t * c,xcb_dri2_get_msc_cookie_t cookie,xcb_generic_error_t ** e)949971bb1a5SLionel Sambuc xcb_dri2_get_msc_reply (xcb_connection_t           *c  /**< */,
950971bb1a5SLionel Sambuc                         xcb_dri2_get_msc_cookie_t   cookie  /**< */,
951971bb1a5SLionel Sambuc                         xcb_generic_error_t       **e  /**< */)
952971bb1a5SLionel Sambuc {
953971bb1a5SLionel Sambuc     return (xcb_dri2_get_msc_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
954971bb1a5SLionel Sambuc }
955971bb1a5SLionel Sambuc 
956971bb1a5SLionel Sambuc xcb_dri2_wait_msc_cookie_t
xcb_dri2_wait_msc(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t target_msc_hi,uint32_t target_msc_lo,uint32_t divisor_hi,uint32_t divisor_lo,uint32_t remainder_hi,uint32_t remainder_lo)957971bb1a5SLionel Sambuc xcb_dri2_wait_msc (xcb_connection_t *c  /**< */,
958971bb1a5SLionel Sambuc                    xcb_drawable_t    drawable  /**< */,
959971bb1a5SLionel Sambuc                    uint32_t          target_msc_hi  /**< */,
960971bb1a5SLionel Sambuc                    uint32_t          target_msc_lo  /**< */,
961971bb1a5SLionel Sambuc                    uint32_t          divisor_hi  /**< */,
962971bb1a5SLionel Sambuc                    uint32_t          divisor_lo  /**< */,
963971bb1a5SLionel Sambuc                    uint32_t          remainder_hi  /**< */,
964971bb1a5SLionel Sambuc                    uint32_t          remainder_lo  /**< */)
965971bb1a5SLionel Sambuc {
966971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
967971bb1a5SLionel Sambuc         /* count */ 2,
968971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
969971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_WAIT_MSC,
970971bb1a5SLionel Sambuc         /* isvoid */ 0
971971bb1a5SLionel Sambuc     };
972971bb1a5SLionel Sambuc 
973971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
974971bb1a5SLionel Sambuc     xcb_dri2_wait_msc_cookie_t xcb_ret;
975971bb1a5SLionel Sambuc     xcb_dri2_wait_msc_request_t xcb_out;
976971bb1a5SLionel Sambuc 
977971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
978971bb1a5SLionel Sambuc     xcb_out.target_msc_hi = target_msc_hi;
979971bb1a5SLionel Sambuc     xcb_out.target_msc_lo = target_msc_lo;
980971bb1a5SLionel Sambuc     xcb_out.divisor_hi = divisor_hi;
981971bb1a5SLionel Sambuc     xcb_out.divisor_lo = divisor_lo;
982971bb1a5SLionel Sambuc     xcb_out.remainder_hi = remainder_hi;
983971bb1a5SLionel Sambuc     xcb_out.remainder_lo = remainder_lo;
984971bb1a5SLionel Sambuc 
985971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
986971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
987971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
988971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
989971bb1a5SLionel Sambuc 
990971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
991971bb1a5SLionel Sambuc     return xcb_ret;
992971bb1a5SLionel Sambuc }
993971bb1a5SLionel Sambuc 
994971bb1a5SLionel Sambuc xcb_dri2_wait_msc_cookie_t
xcb_dri2_wait_msc_unchecked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t target_msc_hi,uint32_t target_msc_lo,uint32_t divisor_hi,uint32_t divisor_lo,uint32_t remainder_hi,uint32_t remainder_lo)995971bb1a5SLionel Sambuc xcb_dri2_wait_msc_unchecked (xcb_connection_t *c  /**< */,
996971bb1a5SLionel Sambuc                              xcb_drawable_t    drawable  /**< */,
997971bb1a5SLionel Sambuc                              uint32_t          target_msc_hi  /**< */,
998971bb1a5SLionel Sambuc                              uint32_t          target_msc_lo  /**< */,
999971bb1a5SLionel Sambuc                              uint32_t          divisor_hi  /**< */,
1000971bb1a5SLionel Sambuc                              uint32_t          divisor_lo  /**< */,
1001971bb1a5SLionel Sambuc                              uint32_t          remainder_hi  /**< */,
1002971bb1a5SLionel Sambuc                              uint32_t          remainder_lo  /**< */)
1003971bb1a5SLionel Sambuc {
1004971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
1005971bb1a5SLionel Sambuc         /* count */ 2,
1006971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
1007971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_WAIT_MSC,
1008971bb1a5SLionel Sambuc         /* isvoid */ 0
1009971bb1a5SLionel Sambuc     };
1010971bb1a5SLionel Sambuc 
1011971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
1012971bb1a5SLionel Sambuc     xcb_dri2_wait_msc_cookie_t xcb_ret;
1013971bb1a5SLionel Sambuc     xcb_dri2_wait_msc_request_t xcb_out;
1014971bb1a5SLionel Sambuc 
1015971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
1016971bb1a5SLionel Sambuc     xcb_out.target_msc_hi = target_msc_hi;
1017971bb1a5SLionel Sambuc     xcb_out.target_msc_lo = target_msc_lo;
1018971bb1a5SLionel Sambuc     xcb_out.divisor_hi = divisor_hi;
1019971bb1a5SLionel Sambuc     xcb_out.divisor_lo = divisor_lo;
1020971bb1a5SLionel Sambuc     xcb_out.remainder_hi = remainder_hi;
1021971bb1a5SLionel Sambuc     xcb_out.remainder_lo = remainder_lo;
1022971bb1a5SLionel Sambuc 
1023971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
1024971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
1025971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
1026971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1027971bb1a5SLionel Sambuc 
1028971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1029971bb1a5SLionel Sambuc     return xcb_ret;
1030971bb1a5SLionel Sambuc }
1031971bb1a5SLionel Sambuc 
1032971bb1a5SLionel Sambuc xcb_dri2_wait_msc_reply_t *
xcb_dri2_wait_msc_reply(xcb_connection_t * c,xcb_dri2_wait_msc_cookie_t cookie,xcb_generic_error_t ** e)1033971bb1a5SLionel Sambuc xcb_dri2_wait_msc_reply (xcb_connection_t            *c  /**< */,
1034971bb1a5SLionel Sambuc                          xcb_dri2_wait_msc_cookie_t   cookie  /**< */,
1035971bb1a5SLionel Sambuc                          xcb_generic_error_t        **e  /**< */)
1036971bb1a5SLionel Sambuc {
1037971bb1a5SLionel Sambuc     return (xcb_dri2_wait_msc_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1038971bb1a5SLionel Sambuc }
1039971bb1a5SLionel Sambuc 
1040971bb1a5SLionel Sambuc xcb_dri2_wait_sbc_cookie_t
xcb_dri2_wait_sbc(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t target_sbc_hi,uint32_t target_sbc_lo)1041971bb1a5SLionel Sambuc xcb_dri2_wait_sbc (xcb_connection_t *c  /**< */,
1042971bb1a5SLionel Sambuc                    xcb_drawable_t    drawable  /**< */,
1043971bb1a5SLionel Sambuc                    uint32_t          target_sbc_hi  /**< */,
1044971bb1a5SLionel Sambuc                    uint32_t          target_sbc_lo  /**< */)
1045971bb1a5SLionel Sambuc {
1046971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
1047971bb1a5SLionel Sambuc         /* count */ 2,
1048971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
1049971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_WAIT_SBC,
1050971bb1a5SLionel Sambuc         /* isvoid */ 0
1051971bb1a5SLionel Sambuc     };
1052971bb1a5SLionel Sambuc 
1053971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
1054971bb1a5SLionel Sambuc     xcb_dri2_wait_sbc_cookie_t xcb_ret;
1055971bb1a5SLionel Sambuc     xcb_dri2_wait_sbc_request_t xcb_out;
1056971bb1a5SLionel Sambuc 
1057971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
1058971bb1a5SLionel Sambuc     xcb_out.target_sbc_hi = target_sbc_hi;
1059971bb1a5SLionel Sambuc     xcb_out.target_sbc_lo = target_sbc_lo;
1060971bb1a5SLionel Sambuc 
1061971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
1062971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
1063971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
1064971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1065971bb1a5SLionel Sambuc 
1066971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1067971bb1a5SLionel Sambuc     return xcb_ret;
1068971bb1a5SLionel Sambuc }
1069971bb1a5SLionel Sambuc 
1070971bb1a5SLionel Sambuc xcb_dri2_wait_sbc_cookie_t
xcb_dri2_wait_sbc_unchecked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t target_sbc_hi,uint32_t target_sbc_lo)1071971bb1a5SLionel Sambuc xcb_dri2_wait_sbc_unchecked (xcb_connection_t *c  /**< */,
1072971bb1a5SLionel Sambuc                              xcb_drawable_t    drawable  /**< */,
1073971bb1a5SLionel Sambuc                              uint32_t          target_sbc_hi  /**< */,
1074971bb1a5SLionel Sambuc                              uint32_t          target_sbc_lo  /**< */)
1075971bb1a5SLionel Sambuc {
1076971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
1077971bb1a5SLionel Sambuc         /* count */ 2,
1078971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
1079971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_WAIT_SBC,
1080971bb1a5SLionel Sambuc         /* isvoid */ 0
1081971bb1a5SLionel Sambuc     };
1082971bb1a5SLionel Sambuc 
1083971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
1084971bb1a5SLionel Sambuc     xcb_dri2_wait_sbc_cookie_t xcb_ret;
1085971bb1a5SLionel Sambuc     xcb_dri2_wait_sbc_request_t xcb_out;
1086971bb1a5SLionel Sambuc 
1087971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
1088971bb1a5SLionel Sambuc     xcb_out.target_sbc_hi = target_sbc_hi;
1089971bb1a5SLionel Sambuc     xcb_out.target_sbc_lo = target_sbc_lo;
1090971bb1a5SLionel Sambuc 
1091971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
1092971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
1093971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
1094971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1095971bb1a5SLionel Sambuc 
1096971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1097971bb1a5SLionel Sambuc     return xcb_ret;
1098971bb1a5SLionel Sambuc }
1099971bb1a5SLionel Sambuc 
1100971bb1a5SLionel Sambuc xcb_dri2_wait_sbc_reply_t *
xcb_dri2_wait_sbc_reply(xcb_connection_t * c,xcb_dri2_wait_sbc_cookie_t cookie,xcb_generic_error_t ** e)1101971bb1a5SLionel Sambuc xcb_dri2_wait_sbc_reply (xcb_connection_t            *c  /**< */,
1102971bb1a5SLionel Sambuc                          xcb_dri2_wait_sbc_cookie_t   cookie  /**< */,
1103971bb1a5SLionel Sambuc                          xcb_generic_error_t        **e  /**< */)
1104971bb1a5SLionel Sambuc {
1105971bb1a5SLionel Sambuc     return (xcb_dri2_wait_sbc_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1106971bb1a5SLionel Sambuc }
1107971bb1a5SLionel Sambuc 
1108971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_dri2_swap_interval_checked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t interval)1109971bb1a5SLionel Sambuc xcb_dri2_swap_interval_checked (xcb_connection_t *c  /**< */,
1110971bb1a5SLionel Sambuc                                 xcb_drawable_t    drawable  /**< */,
1111971bb1a5SLionel Sambuc                                 uint32_t          interval  /**< */)
1112971bb1a5SLionel Sambuc {
1113971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
1114971bb1a5SLionel Sambuc         /* count */ 2,
1115971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
1116971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_SWAP_INTERVAL,
1117971bb1a5SLionel Sambuc         /* isvoid */ 1
1118971bb1a5SLionel Sambuc     };
1119971bb1a5SLionel Sambuc 
1120971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
1121971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
1122971bb1a5SLionel Sambuc     xcb_dri2_swap_interval_request_t xcb_out;
1123971bb1a5SLionel Sambuc 
1124971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
1125971bb1a5SLionel Sambuc     xcb_out.interval = interval;
1126971bb1a5SLionel Sambuc 
1127971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
1128971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
1129971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
1130971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1131971bb1a5SLionel Sambuc 
1132971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1133971bb1a5SLionel Sambuc     return xcb_ret;
1134971bb1a5SLionel Sambuc }
1135971bb1a5SLionel Sambuc 
1136971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_dri2_swap_interval(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t interval)1137971bb1a5SLionel Sambuc xcb_dri2_swap_interval (xcb_connection_t *c  /**< */,
1138971bb1a5SLionel Sambuc                         xcb_drawable_t    drawable  /**< */,
1139971bb1a5SLionel Sambuc                         uint32_t          interval  /**< */)
1140971bb1a5SLionel Sambuc {
1141971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
1142971bb1a5SLionel Sambuc         /* count */ 2,
1143971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
1144971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_SWAP_INTERVAL,
1145971bb1a5SLionel Sambuc         /* isvoid */ 1
1146971bb1a5SLionel Sambuc     };
1147971bb1a5SLionel Sambuc 
1148971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
1149971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
1150971bb1a5SLionel Sambuc     xcb_dri2_swap_interval_request_t xcb_out;
1151971bb1a5SLionel Sambuc 
1152971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
1153971bb1a5SLionel Sambuc     xcb_out.interval = interval;
1154971bb1a5SLionel Sambuc 
1155971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
1156971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
1157971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
1158971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1159971bb1a5SLionel Sambuc 
1160971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1161971bb1a5SLionel Sambuc     return xcb_ret;
1162971bb1a5SLionel Sambuc }
1163971bb1a5SLionel Sambuc 
1164971bb1a5SLionel Sambuc xcb_dri2_get_param_cookie_t
xcb_dri2_get_param(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t param)1165971bb1a5SLionel Sambuc xcb_dri2_get_param (xcb_connection_t *c  /**< */,
1166971bb1a5SLionel Sambuc                     xcb_drawable_t    drawable  /**< */,
1167971bb1a5SLionel Sambuc                     uint32_t          param  /**< */)
1168971bb1a5SLionel Sambuc {
1169971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
1170971bb1a5SLionel Sambuc         /* count */ 2,
1171971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
1172971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_GET_PARAM,
1173971bb1a5SLionel Sambuc         /* isvoid */ 0
1174971bb1a5SLionel Sambuc     };
1175971bb1a5SLionel Sambuc 
1176971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
1177971bb1a5SLionel Sambuc     xcb_dri2_get_param_cookie_t xcb_ret;
1178971bb1a5SLionel Sambuc     xcb_dri2_get_param_request_t xcb_out;
1179971bb1a5SLionel Sambuc 
1180971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
1181971bb1a5SLionel Sambuc     xcb_out.param = param;
1182971bb1a5SLionel Sambuc 
1183971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
1184971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
1185971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
1186971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1187971bb1a5SLionel Sambuc 
1188971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1189971bb1a5SLionel Sambuc     return xcb_ret;
1190971bb1a5SLionel Sambuc }
1191971bb1a5SLionel Sambuc 
1192971bb1a5SLionel Sambuc xcb_dri2_get_param_cookie_t
xcb_dri2_get_param_unchecked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t param)1193971bb1a5SLionel Sambuc xcb_dri2_get_param_unchecked (xcb_connection_t *c  /**< */,
1194971bb1a5SLionel Sambuc                               xcb_drawable_t    drawable  /**< */,
1195971bb1a5SLionel Sambuc                               uint32_t          param  /**< */)
1196971bb1a5SLionel Sambuc {
1197971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
1198971bb1a5SLionel Sambuc         /* count */ 2,
1199971bb1a5SLionel Sambuc         /* ext */ &xcb_dri2_id,
1200971bb1a5SLionel Sambuc         /* opcode */ XCB_DRI2_GET_PARAM,
1201971bb1a5SLionel Sambuc         /* isvoid */ 0
1202971bb1a5SLionel Sambuc     };
1203971bb1a5SLionel Sambuc 
1204971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
1205971bb1a5SLionel Sambuc     xcb_dri2_get_param_cookie_t xcb_ret;
1206971bb1a5SLionel Sambuc     xcb_dri2_get_param_request_t xcb_out;
1207971bb1a5SLionel Sambuc 
1208971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
1209971bb1a5SLionel Sambuc     xcb_out.param = param;
1210971bb1a5SLionel Sambuc 
1211971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
1212971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
1213971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
1214971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1215971bb1a5SLionel Sambuc 
1216971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1217971bb1a5SLionel Sambuc     return xcb_ret;
1218971bb1a5SLionel Sambuc }
1219971bb1a5SLionel Sambuc 
1220971bb1a5SLionel Sambuc xcb_dri2_get_param_reply_t *
xcb_dri2_get_param_reply(xcb_connection_t * c,xcb_dri2_get_param_cookie_t cookie,xcb_generic_error_t ** e)1221971bb1a5SLionel Sambuc xcb_dri2_get_param_reply (xcb_connection_t             *c  /**< */,
1222971bb1a5SLionel Sambuc                           xcb_dri2_get_param_cookie_t   cookie  /**< */,
1223971bb1a5SLionel Sambuc                           xcb_generic_error_t         **e  /**< */)
1224971bb1a5SLionel Sambuc {
1225971bb1a5SLionel Sambuc     return (xcb_dri2_get_param_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1226971bb1a5SLionel Sambuc }
1227971bb1a5SLionel Sambuc 
1228