1971bb1a5SLionel Sambuc /*
2971bb1a5SLionel Sambuc * This file generated automatically from xf86dri.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 "xf86dri.h"
15971bb1a5SLionel Sambuc
16971bb1a5SLionel Sambuc #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17971bb1a5SLionel Sambuc
18971bb1a5SLionel Sambuc xcb_extension_t xcb_xf86dri_id = { "XFree86-DRI", 0 };
19971bb1a5SLionel Sambuc
20971bb1a5SLionel Sambuc void
xcb_xf86dri_drm_clip_rect_next(xcb_xf86dri_drm_clip_rect_iterator_t * i)21971bb1a5SLionel Sambuc xcb_xf86dri_drm_clip_rect_next (xcb_xf86dri_drm_clip_rect_iterator_t *i /**< */)
22971bb1a5SLionel Sambuc {
23971bb1a5SLionel Sambuc --i->rem;
24971bb1a5SLionel Sambuc ++i->data;
25971bb1a5SLionel Sambuc i->index += sizeof(xcb_xf86dri_drm_clip_rect_t);
26971bb1a5SLionel Sambuc }
27971bb1a5SLionel Sambuc
28971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_xf86dri_drm_clip_rect_end(xcb_xf86dri_drm_clip_rect_iterator_t i)29971bb1a5SLionel Sambuc xcb_xf86dri_drm_clip_rect_end (xcb_xf86dri_drm_clip_rect_iterator_t i /**< */)
30971bb1a5SLionel Sambuc {
31971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
32971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
33971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
34971bb1a5SLionel Sambuc ret.rem = 0;
35971bb1a5SLionel Sambuc return ret;
36971bb1a5SLionel Sambuc }
37971bb1a5SLionel Sambuc
38971bb1a5SLionel Sambuc xcb_xf86dri_query_version_cookie_t
xcb_xf86dri_query_version(xcb_connection_t * c)39971bb1a5SLionel Sambuc xcb_xf86dri_query_version (xcb_connection_t *c /**< */)
40971bb1a5SLionel Sambuc {
41971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
42971bb1a5SLionel Sambuc /* count */ 2,
43971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
44971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_QUERY_VERSION,
45971bb1a5SLionel Sambuc /* isvoid */ 0
46971bb1a5SLionel Sambuc };
47971bb1a5SLionel Sambuc
48971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
49971bb1a5SLionel Sambuc xcb_xf86dri_query_version_cookie_t xcb_ret;
50971bb1a5SLionel Sambuc xcb_xf86dri_query_version_request_t xcb_out;
51971bb1a5SLionel Sambuc
52971bb1a5SLionel Sambuc
53971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
54971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
55971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
56971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
57971bb1a5SLionel Sambuc
58971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
59971bb1a5SLionel Sambuc return xcb_ret;
60971bb1a5SLionel Sambuc }
61971bb1a5SLionel Sambuc
62971bb1a5SLionel Sambuc xcb_xf86dri_query_version_cookie_t
xcb_xf86dri_query_version_unchecked(xcb_connection_t * c)63971bb1a5SLionel Sambuc xcb_xf86dri_query_version_unchecked (xcb_connection_t *c /**< */)
64971bb1a5SLionel Sambuc {
65971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
66971bb1a5SLionel Sambuc /* count */ 2,
67971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
68971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_QUERY_VERSION,
69971bb1a5SLionel Sambuc /* isvoid */ 0
70971bb1a5SLionel Sambuc };
71971bb1a5SLionel Sambuc
72971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
73971bb1a5SLionel Sambuc xcb_xf86dri_query_version_cookie_t xcb_ret;
74971bb1a5SLionel Sambuc xcb_xf86dri_query_version_request_t xcb_out;
75971bb1a5SLionel Sambuc
76971bb1a5SLionel Sambuc
77971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
78971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
79971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
80971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
81971bb1a5SLionel Sambuc
82971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
83971bb1a5SLionel Sambuc return xcb_ret;
84971bb1a5SLionel Sambuc }
85971bb1a5SLionel Sambuc
86971bb1a5SLionel Sambuc xcb_xf86dri_query_version_reply_t *
xcb_xf86dri_query_version_reply(xcb_connection_t * c,xcb_xf86dri_query_version_cookie_t cookie,xcb_generic_error_t ** e)87971bb1a5SLionel Sambuc xcb_xf86dri_query_version_reply (xcb_connection_t *c /**< */,
88971bb1a5SLionel Sambuc xcb_xf86dri_query_version_cookie_t cookie /**< */,
89971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
90971bb1a5SLionel Sambuc {
91971bb1a5SLionel Sambuc return (xcb_xf86dri_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
92971bb1a5SLionel Sambuc }
93971bb1a5SLionel Sambuc
94971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable_cookie_t
xcb_xf86dri_query_direct_rendering_capable(xcb_connection_t * c,uint32_t screen)95971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable (xcb_connection_t *c /**< */,
96971bb1a5SLionel Sambuc uint32_t screen /**< */)
97971bb1a5SLionel Sambuc {
98971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
99971bb1a5SLionel Sambuc /* count */ 2,
100971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
101971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_QUERY_DIRECT_RENDERING_CAPABLE,
102971bb1a5SLionel Sambuc /* isvoid */ 0
103971bb1a5SLionel Sambuc };
104971bb1a5SLionel Sambuc
105971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
106971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable_cookie_t xcb_ret;
107971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable_request_t xcb_out;
108971bb1a5SLionel Sambuc
109971bb1a5SLionel Sambuc xcb_out.screen = screen;
110971bb1a5SLionel Sambuc
111971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
112971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
113971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
114971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
115971bb1a5SLionel Sambuc
116971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
117971bb1a5SLionel Sambuc return xcb_ret;
118971bb1a5SLionel Sambuc }
119971bb1a5SLionel Sambuc
120971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable_cookie_t
xcb_xf86dri_query_direct_rendering_capable_unchecked(xcb_connection_t * c,uint32_t screen)121971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable_unchecked (xcb_connection_t *c /**< */,
122971bb1a5SLionel Sambuc uint32_t screen /**< */)
123971bb1a5SLionel Sambuc {
124971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
125971bb1a5SLionel Sambuc /* count */ 2,
126971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
127971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_QUERY_DIRECT_RENDERING_CAPABLE,
128971bb1a5SLionel Sambuc /* isvoid */ 0
129971bb1a5SLionel Sambuc };
130971bb1a5SLionel Sambuc
131971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
132971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable_cookie_t xcb_ret;
133971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable_request_t xcb_out;
134971bb1a5SLionel Sambuc
135971bb1a5SLionel Sambuc xcb_out.screen = screen;
136971bb1a5SLionel Sambuc
137971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
138971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
139971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
140971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
141971bb1a5SLionel Sambuc
142971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
143971bb1a5SLionel Sambuc return xcb_ret;
144971bb1a5SLionel Sambuc }
145971bb1a5SLionel Sambuc
146971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable_reply_t *
xcb_xf86dri_query_direct_rendering_capable_reply(xcb_connection_t * c,xcb_xf86dri_query_direct_rendering_capable_cookie_t cookie,xcb_generic_error_t ** e)147971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable_reply (xcb_connection_t *c /**< */,
148971bb1a5SLionel Sambuc xcb_xf86dri_query_direct_rendering_capable_cookie_t cookie /**< */,
149971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
150971bb1a5SLionel Sambuc {
151971bb1a5SLionel Sambuc return (xcb_xf86dri_query_direct_rendering_capable_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
152971bb1a5SLionel Sambuc }
153971bb1a5SLionel Sambuc
154971bb1a5SLionel Sambuc int
xcb_xf86dri_open_connection_sizeof(const void * _buffer)155971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_sizeof (const void *_buffer /**< */)
156971bb1a5SLionel Sambuc {
157971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
158971bb1a5SLionel Sambuc const xcb_xf86dri_open_connection_reply_t *_aux = (xcb_xf86dri_open_connection_reply_t *)_buffer;
159971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
160971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
161971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
162*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
163971bb1a5SLionel Sambuc
164971bb1a5SLionel Sambuc
165971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_xf86dri_open_connection_reply_t);
166971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
167*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
168*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
169971bb1a5SLionel Sambuc /* bus_id */
170971bb1a5SLionel Sambuc xcb_block_len += _aux->bus_id_len * sizeof(char);
171971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
172971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(char);
173971bb1a5SLionel Sambuc /* insert padding */
174971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
175971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
176971bb1a5SLionel Sambuc if (0 != xcb_pad) {
177971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
178971bb1a5SLionel Sambuc xcb_pad = 0;
179971bb1a5SLionel Sambuc }
180971bb1a5SLionel Sambuc xcb_block_len = 0;
181971bb1a5SLionel Sambuc
182971bb1a5SLionel Sambuc return xcb_buffer_len;
183971bb1a5SLionel Sambuc }
184971bb1a5SLionel Sambuc
185971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_cookie_t
xcb_xf86dri_open_connection(xcb_connection_t * c,uint32_t screen)186971bb1a5SLionel Sambuc xcb_xf86dri_open_connection (xcb_connection_t *c /**< */,
187971bb1a5SLionel Sambuc uint32_t screen /**< */)
188971bb1a5SLionel Sambuc {
189971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
190971bb1a5SLionel Sambuc /* count */ 2,
191971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
192971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_OPEN_CONNECTION,
193971bb1a5SLionel Sambuc /* isvoid */ 0
194971bb1a5SLionel Sambuc };
195971bb1a5SLionel Sambuc
196971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
197971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_cookie_t xcb_ret;
198971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_request_t xcb_out;
199971bb1a5SLionel Sambuc
200971bb1a5SLionel Sambuc xcb_out.screen = screen;
201971bb1a5SLionel Sambuc
202971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
203971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
204971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
205971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
206971bb1a5SLionel Sambuc
207971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
208971bb1a5SLionel Sambuc return xcb_ret;
209971bb1a5SLionel Sambuc }
210971bb1a5SLionel Sambuc
211971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_cookie_t
xcb_xf86dri_open_connection_unchecked(xcb_connection_t * c,uint32_t screen)212971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_unchecked (xcb_connection_t *c /**< */,
213971bb1a5SLionel Sambuc uint32_t screen /**< */)
214971bb1a5SLionel Sambuc {
215971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
216971bb1a5SLionel Sambuc /* count */ 2,
217971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
218971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_OPEN_CONNECTION,
219971bb1a5SLionel Sambuc /* isvoid */ 0
220971bb1a5SLionel Sambuc };
221971bb1a5SLionel Sambuc
222971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
223971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_cookie_t xcb_ret;
224971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_request_t xcb_out;
225971bb1a5SLionel Sambuc
226971bb1a5SLionel Sambuc xcb_out.screen = screen;
227971bb1a5SLionel Sambuc
228971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
229971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
230971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
231971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
232971bb1a5SLionel Sambuc
233971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
234971bb1a5SLionel Sambuc return xcb_ret;
235971bb1a5SLionel Sambuc }
236971bb1a5SLionel Sambuc
237971bb1a5SLionel Sambuc char *
xcb_xf86dri_open_connection_bus_id(const xcb_xf86dri_open_connection_reply_t * R)238971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_bus_id (const xcb_xf86dri_open_connection_reply_t *R /**< */)
239971bb1a5SLionel Sambuc {
240971bb1a5SLionel Sambuc return (char *) (R + 1);
241971bb1a5SLionel Sambuc }
242971bb1a5SLionel Sambuc
243971bb1a5SLionel Sambuc int
xcb_xf86dri_open_connection_bus_id_length(const xcb_xf86dri_open_connection_reply_t * R)244971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_bus_id_length (const xcb_xf86dri_open_connection_reply_t *R /**< */)
245971bb1a5SLionel Sambuc {
246971bb1a5SLionel Sambuc return R->bus_id_len;
247971bb1a5SLionel Sambuc }
248971bb1a5SLionel Sambuc
249971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_xf86dri_open_connection_bus_id_end(const xcb_xf86dri_open_connection_reply_t * R)250971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_bus_id_end (const xcb_xf86dri_open_connection_reply_t *R /**< */)
251971bb1a5SLionel Sambuc {
252971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
253971bb1a5SLionel Sambuc i.data = ((char *) (R + 1)) + (R->bus_id_len);
254971bb1a5SLionel Sambuc i.rem = 0;
255971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
256971bb1a5SLionel Sambuc return i;
257971bb1a5SLionel Sambuc }
258971bb1a5SLionel Sambuc
259971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_reply_t *
xcb_xf86dri_open_connection_reply(xcb_connection_t * c,xcb_xf86dri_open_connection_cookie_t cookie,xcb_generic_error_t ** e)260971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_reply (xcb_connection_t *c /**< */,
261971bb1a5SLionel Sambuc xcb_xf86dri_open_connection_cookie_t cookie /**< */,
262971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
263971bb1a5SLionel Sambuc {
264971bb1a5SLionel Sambuc return (xcb_xf86dri_open_connection_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
265971bb1a5SLionel Sambuc }
266971bb1a5SLionel Sambuc
267971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_xf86dri_close_connection_checked(xcb_connection_t * c,uint32_t screen)268971bb1a5SLionel Sambuc xcb_xf86dri_close_connection_checked (xcb_connection_t *c /**< */,
269971bb1a5SLionel Sambuc uint32_t screen /**< */)
270971bb1a5SLionel Sambuc {
271971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
272971bb1a5SLionel Sambuc /* count */ 2,
273971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
274971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_CLOSE_CONNECTION,
275971bb1a5SLionel Sambuc /* isvoid */ 1
276971bb1a5SLionel Sambuc };
277971bb1a5SLionel Sambuc
278971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
279971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
280971bb1a5SLionel Sambuc xcb_xf86dri_close_connection_request_t xcb_out;
281971bb1a5SLionel Sambuc
282971bb1a5SLionel Sambuc xcb_out.screen = screen;
283971bb1a5SLionel Sambuc
284971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
285971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
286971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
287971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
288971bb1a5SLionel Sambuc
289971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
290971bb1a5SLionel Sambuc return xcb_ret;
291971bb1a5SLionel Sambuc }
292971bb1a5SLionel Sambuc
293971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_xf86dri_close_connection(xcb_connection_t * c,uint32_t screen)294971bb1a5SLionel Sambuc xcb_xf86dri_close_connection (xcb_connection_t *c /**< */,
295971bb1a5SLionel Sambuc uint32_t screen /**< */)
296971bb1a5SLionel Sambuc {
297971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
298971bb1a5SLionel Sambuc /* count */ 2,
299971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
300971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_CLOSE_CONNECTION,
301971bb1a5SLionel Sambuc /* isvoid */ 1
302971bb1a5SLionel Sambuc };
303971bb1a5SLionel Sambuc
304971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
305971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
306971bb1a5SLionel Sambuc xcb_xf86dri_close_connection_request_t xcb_out;
307971bb1a5SLionel Sambuc
308971bb1a5SLionel Sambuc xcb_out.screen = screen;
309971bb1a5SLionel Sambuc
310971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
311971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
312971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
313971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
314971bb1a5SLionel Sambuc
315971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
316971bb1a5SLionel Sambuc return xcb_ret;
317971bb1a5SLionel Sambuc }
318971bb1a5SLionel Sambuc
319971bb1a5SLionel Sambuc int
xcb_xf86dri_get_client_driver_name_sizeof(const void * _buffer)320971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_sizeof (const void *_buffer /**< */)
321971bb1a5SLionel Sambuc {
322971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
323971bb1a5SLionel Sambuc const xcb_xf86dri_get_client_driver_name_reply_t *_aux = (xcb_xf86dri_get_client_driver_name_reply_t *)_buffer;
324971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
325971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
326971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
327*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
328971bb1a5SLionel Sambuc
329971bb1a5SLionel Sambuc
330971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_xf86dri_get_client_driver_name_reply_t);
331971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
332*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
333*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
334971bb1a5SLionel Sambuc /* client_driver_name */
335971bb1a5SLionel Sambuc xcb_block_len += _aux->client_driver_name_len * sizeof(char);
336971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
337971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(char);
338971bb1a5SLionel Sambuc /* insert padding */
339971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
340971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
341971bb1a5SLionel Sambuc if (0 != xcb_pad) {
342971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
343971bb1a5SLionel Sambuc xcb_pad = 0;
344971bb1a5SLionel Sambuc }
345971bb1a5SLionel Sambuc xcb_block_len = 0;
346971bb1a5SLionel Sambuc
347971bb1a5SLionel Sambuc return xcb_buffer_len;
348971bb1a5SLionel Sambuc }
349971bb1a5SLionel Sambuc
350971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_cookie_t
xcb_xf86dri_get_client_driver_name(xcb_connection_t * c,uint32_t screen)351971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name (xcb_connection_t *c /**< */,
352971bb1a5SLionel Sambuc uint32_t screen /**< */)
353971bb1a5SLionel Sambuc {
354971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
355971bb1a5SLionel Sambuc /* count */ 2,
356971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
357971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_GET_CLIENT_DRIVER_NAME,
358971bb1a5SLionel Sambuc /* isvoid */ 0
359971bb1a5SLionel Sambuc };
360971bb1a5SLionel Sambuc
361971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
362971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_cookie_t xcb_ret;
363971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_request_t xcb_out;
364971bb1a5SLionel Sambuc
365971bb1a5SLionel Sambuc xcb_out.screen = screen;
366971bb1a5SLionel Sambuc
367971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
368971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
369971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
370971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
371971bb1a5SLionel Sambuc
372971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
373971bb1a5SLionel Sambuc return xcb_ret;
374971bb1a5SLionel Sambuc }
375971bb1a5SLionel Sambuc
376971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_cookie_t
xcb_xf86dri_get_client_driver_name_unchecked(xcb_connection_t * c,uint32_t screen)377971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_unchecked (xcb_connection_t *c /**< */,
378971bb1a5SLionel Sambuc uint32_t screen /**< */)
379971bb1a5SLionel Sambuc {
380971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
381971bb1a5SLionel Sambuc /* count */ 2,
382971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
383971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_GET_CLIENT_DRIVER_NAME,
384971bb1a5SLionel Sambuc /* isvoid */ 0
385971bb1a5SLionel Sambuc };
386971bb1a5SLionel Sambuc
387971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
388971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_cookie_t xcb_ret;
389971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_request_t xcb_out;
390971bb1a5SLionel Sambuc
391971bb1a5SLionel Sambuc xcb_out.screen = screen;
392971bb1a5SLionel Sambuc
393971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
394971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
395971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
396971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
397971bb1a5SLionel Sambuc
398971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
399971bb1a5SLionel Sambuc return xcb_ret;
400971bb1a5SLionel Sambuc }
401971bb1a5SLionel Sambuc
402971bb1a5SLionel Sambuc char *
xcb_xf86dri_get_client_driver_name_client_driver_name(const xcb_xf86dri_get_client_driver_name_reply_t * R)403971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_client_driver_name (const xcb_xf86dri_get_client_driver_name_reply_t *R /**< */)
404971bb1a5SLionel Sambuc {
405971bb1a5SLionel Sambuc return (char *) (R + 1);
406971bb1a5SLionel Sambuc }
407971bb1a5SLionel Sambuc
408971bb1a5SLionel Sambuc int
xcb_xf86dri_get_client_driver_name_client_driver_name_length(const xcb_xf86dri_get_client_driver_name_reply_t * R)409971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_client_driver_name_length (const xcb_xf86dri_get_client_driver_name_reply_t *R /**< */)
410971bb1a5SLionel Sambuc {
411971bb1a5SLionel Sambuc return R->client_driver_name_len;
412971bb1a5SLionel Sambuc }
413971bb1a5SLionel Sambuc
414971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_xf86dri_get_client_driver_name_client_driver_name_end(const xcb_xf86dri_get_client_driver_name_reply_t * R)415971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_client_driver_name_end (const xcb_xf86dri_get_client_driver_name_reply_t *R /**< */)
416971bb1a5SLionel Sambuc {
417971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
418971bb1a5SLionel Sambuc i.data = ((char *) (R + 1)) + (R->client_driver_name_len);
419971bb1a5SLionel Sambuc i.rem = 0;
420971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
421971bb1a5SLionel Sambuc return i;
422971bb1a5SLionel Sambuc }
423971bb1a5SLionel Sambuc
424971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_reply_t *
xcb_xf86dri_get_client_driver_name_reply(xcb_connection_t * c,xcb_xf86dri_get_client_driver_name_cookie_t cookie,xcb_generic_error_t ** e)425971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_reply (xcb_connection_t *c /**< */,
426971bb1a5SLionel Sambuc xcb_xf86dri_get_client_driver_name_cookie_t cookie /**< */,
427971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
428971bb1a5SLionel Sambuc {
429971bb1a5SLionel Sambuc return (xcb_xf86dri_get_client_driver_name_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
430971bb1a5SLionel Sambuc }
431971bb1a5SLionel Sambuc
432971bb1a5SLionel Sambuc xcb_xf86dri_create_context_cookie_t
xcb_xf86dri_create_context(xcb_connection_t * c,uint32_t screen,uint32_t visual,uint32_t context)433971bb1a5SLionel Sambuc xcb_xf86dri_create_context (xcb_connection_t *c /**< */,
434971bb1a5SLionel Sambuc uint32_t screen /**< */,
435971bb1a5SLionel Sambuc uint32_t visual /**< */,
436971bb1a5SLionel Sambuc uint32_t context /**< */)
437971bb1a5SLionel Sambuc {
438971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
439971bb1a5SLionel Sambuc /* count */ 2,
440971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
441971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_CREATE_CONTEXT,
442971bb1a5SLionel Sambuc /* isvoid */ 0
443971bb1a5SLionel Sambuc };
444971bb1a5SLionel Sambuc
445971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
446971bb1a5SLionel Sambuc xcb_xf86dri_create_context_cookie_t xcb_ret;
447971bb1a5SLionel Sambuc xcb_xf86dri_create_context_request_t xcb_out;
448971bb1a5SLionel Sambuc
449971bb1a5SLionel Sambuc xcb_out.screen = screen;
450971bb1a5SLionel Sambuc xcb_out.visual = visual;
451971bb1a5SLionel Sambuc xcb_out.context = context;
452971bb1a5SLionel Sambuc
453971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
454971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
455971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
456971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
457971bb1a5SLionel Sambuc
458971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
459971bb1a5SLionel Sambuc return xcb_ret;
460971bb1a5SLionel Sambuc }
461971bb1a5SLionel Sambuc
462971bb1a5SLionel Sambuc xcb_xf86dri_create_context_cookie_t
xcb_xf86dri_create_context_unchecked(xcb_connection_t * c,uint32_t screen,uint32_t visual,uint32_t context)463971bb1a5SLionel Sambuc xcb_xf86dri_create_context_unchecked (xcb_connection_t *c /**< */,
464971bb1a5SLionel Sambuc uint32_t screen /**< */,
465971bb1a5SLionel Sambuc uint32_t visual /**< */,
466971bb1a5SLionel Sambuc uint32_t context /**< */)
467971bb1a5SLionel Sambuc {
468971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
469971bb1a5SLionel Sambuc /* count */ 2,
470971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
471971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_CREATE_CONTEXT,
472971bb1a5SLionel Sambuc /* isvoid */ 0
473971bb1a5SLionel Sambuc };
474971bb1a5SLionel Sambuc
475971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
476971bb1a5SLionel Sambuc xcb_xf86dri_create_context_cookie_t xcb_ret;
477971bb1a5SLionel Sambuc xcb_xf86dri_create_context_request_t xcb_out;
478971bb1a5SLionel Sambuc
479971bb1a5SLionel Sambuc xcb_out.screen = screen;
480971bb1a5SLionel Sambuc xcb_out.visual = visual;
481971bb1a5SLionel Sambuc xcb_out.context = context;
482971bb1a5SLionel Sambuc
483971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
484971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
485971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
486971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
487971bb1a5SLionel Sambuc
488971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
489971bb1a5SLionel Sambuc return xcb_ret;
490971bb1a5SLionel Sambuc }
491971bb1a5SLionel Sambuc
492971bb1a5SLionel Sambuc xcb_xf86dri_create_context_reply_t *
xcb_xf86dri_create_context_reply(xcb_connection_t * c,xcb_xf86dri_create_context_cookie_t cookie,xcb_generic_error_t ** e)493971bb1a5SLionel Sambuc xcb_xf86dri_create_context_reply (xcb_connection_t *c /**< */,
494971bb1a5SLionel Sambuc xcb_xf86dri_create_context_cookie_t cookie /**< */,
495971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
496971bb1a5SLionel Sambuc {
497971bb1a5SLionel Sambuc return (xcb_xf86dri_create_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
498971bb1a5SLionel Sambuc }
499971bb1a5SLionel Sambuc
500971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_xf86dri_destroy_context_checked(xcb_connection_t * c,uint32_t screen,uint32_t context)501971bb1a5SLionel Sambuc xcb_xf86dri_destroy_context_checked (xcb_connection_t *c /**< */,
502971bb1a5SLionel Sambuc uint32_t screen /**< */,
503971bb1a5SLionel Sambuc uint32_t context /**< */)
504971bb1a5SLionel Sambuc {
505971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
506971bb1a5SLionel Sambuc /* count */ 2,
507971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
508971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_DESTROY_CONTEXT,
509971bb1a5SLionel Sambuc /* isvoid */ 1
510971bb1a5SLionel Sambuc };
511971bb1a5SLionel Sambuc
512971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
513971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
514971bb1a5SLionel Sambuc xcb_xf86dri_destroy_context_request_t xcb_out;
515971bb1a5SLionel Sambuc
516971bb1a5SLionel Sambuc xcb_out.screen = screen;
517971bb1a5SLionel Sambuc xcb_out.context = context;
518971bb1a5SLionel Sambuc
519971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
520971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
521971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
522971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
523971bb1a5SLionel Sambuc
524971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
525971bb1a5SLionel Sambuc return xcb_ret;
526971bb1a5SLionel Sambuc }
527971bb1a5SLionel Sambuc
528971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_xf86dri_destroy_context(xcb_connection_t * c,uint32_t screen,uint32_t context)529971bb1a5SLionel Sambuc xcb_xf86dri_destroy_context (xcb_connection_t *c /**< */,
530971bb1a5SLionel Sambuc uint32_t screen /**< */,
531971bb1a5SLionel Sambuc uint32_t context /**< */)
532971bb1a5SLionel Sambuc {
533971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
534971bb1a5SLionel Sambuc /* count */ 2,
535971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
536971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_DESTROY_CONTEXT,
537971bb1a5SLionel Sambuc /* isvoid */ 1
538971bb1a5SLionel Sambuc };
539971bb1a5SLionel Sambuc
540971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
541971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
542971bb1a5SLionel Sambuc xcb_xf86dri_destroy_context_request_t xcb_out;
543971bb1a5SLionel Sambuc
544971bb1a5SLionel Sambuc xcb_out.screen = screen;
545971bb1a5SLionel Sambuc xcb_out.context = context;
546971bb1a5SLionel Sambuc
547971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
548971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
549971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
550971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
551971bb1a5SLionel Sambuc
552971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
553971bb1a5SLionel Sambuc return xcb_ret;
554971bb1a5SLionel Sambuc }
555971bb1a5SLionel Sambuc
556971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable_cookie_t
xcb_xf86dri_create_drawable(xcb_connection_t * c,uint32_t screen,uint32_t drawable)557971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable (xcb_connection_t *c /**< */,
558971bb1a5SLionel Sambuc uint32_t screen /**< */,
559971bb1a5SLionel Sambuc uint32_t drawable /**< */)
560971bb1a5SLionel Sambuc {
561971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
562971bb1a5SLionel Sambuc /* count */ 2,
563971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
564971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_CREATE_DRAWABLE,
565971bb1a5SLionel Sambuc /* isvoid */ 0
566971bb1a5SLionel Sambuc };
567971bb1a5SLionel Sambuc
568971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
569971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable_cookie_t xcb_ret;
570971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable_request_t xcb_out;
571971bb1a5SLionel Sambuc
572971bb1a5SLionel Sambuc xcb_out.screen = screen;
573971bb1a5SLionel Sambuc xcb_out.drawable = drawable;
574971bb1a5SLionel Sambuc
575971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
576971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
577971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
578971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
579971bb1a5SLionel Sambuc
580971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
581971bb1a5SLionel Sambuc return xcb_ret;
582971bb1a5SLionel Sambuc }
583971bb1a5SLionel Sambuc
584971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable_cookie_t
xcb_xf86dri_create_drawable_unchecked(xcb_connection_t * c,uint32_t screen,uint32_t drawable)585971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable_unchecked (xcb_connection_t *c /**< */,
586971bb1a5SLionel Sambuc uint32_t screen /**< */,
587971bb1a5SLionel Sambuc uint32_t drawable /**< */)
588971bb1a5SLionel Sambuc {
589971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
590971bb1a5SLionel Sambuc /* count */ 2,
591971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
592971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_CREATE_DRAWABLE,
593971bb1a5SLionel Sambuc /* isvoid */ 0
594971bb1a5SLionel Sambuc };
595971bb1a5SLionel Sambuc
596971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
597971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable_cookie_t xcb_ret;
598971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable_request_t xcb_out;
599971bb1a5SLionel Sambuc
600971bb1a5SLionel Sambuc xcb_out.screen = screen;
601971bb1a5SLionel Sambuc xcb_out.drawable = drawable;
602971bb1a5SLionel Sambuc
603971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
604971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
605971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
606971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
607971bb1a5SLionel Sambuc
608971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
609971bb1a5SLionel Sambuc return xcb_ret;
610971bb1a5SLionel Sambuc }
611971bb1a5SLionel Sambuc
612971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable_reply_t *
xcb_xf86dri_create_drawable_reply(xcb_connection_t * c,xcb_xf86dri_create_drawable_cookie_t cookie,xcb_generic_error_t ** e)613971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable_reply (xcb_connection_t *c /**< */,
614971bb1a5SLionel Sambuc xcb_xf86dri_create_drawable_cookie_t cookie /**< */,
615971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
616971bb1a5SLionel Sambuc {
617971bb1a5SLionel Sambuc return (xcb_xf86dri_create_drawable_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
618971bb1a5SLionel Sambuc }
619971bb1a5SLionel Sambuc
620971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_xf86dri_destroy_drawable_checked(xcb_connection_t * c,uint32_t screen,uint32_t drawable)621971bb1a5SLionel Sambuc xcb_xf86dri_destroy_drawable_checked (xcb_connection_t *c /**< */,
622971bb1a5SLionel Sambuc uint32_t screen /**< */,
623971bb1a5SLionel Sambuc uint32_t drawable /**< */)
624971bb1a5SLionel Sambuc {
625971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
626971bb1a5SLionel Sambuc /* count */ 2,
627971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
628971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_DESTROY_DRAWABLE,
629971bb1a5SLionel Sambuc /* isvoid */ 1
630971bb1a5SLionel Sambuc };
631971bb1a5SLionel Sambuc
632971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
633971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
634971bb1a5SLionel Sambuc xcb_xf86dri_destroy_drawable_request_t xcb_out;
635971bb1a5SLionel Sambuc
636971bb1a5SLionel Sambuc xcb_out.screen = screen;
637971bb1a5SLionel Sambuc xcb_out.drawable = drawable;
638971bb1a5SLionel Sambuc
639971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
640971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
641971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
642971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
643971bb1a5SLionel Sambuc
644971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
645971bb1a5SLionel Sambuc return xcb_ret;
646971bb1a5SLionel Sambuc }
647971bb1a5SLionel Sambuc
648971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_xf86dri_destroy_drawable(xcb_connection_t * c,uint32_t screen,uint32_t drawable)649971bb1a5SLionel Sambuc xcb_xf86dri_destroy_drawable (xcb_connection_t *c /**< */,
650971bb1a5SLionel Sambuc uint32_t screen /**< */,
651971bb1a5SLionel Sambuc uint32_t drawable /**< */)
652971bb1a5SLionel Sambuc {
653971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
654971bb1a5SLionel Sambuc /* count */ 2,
655971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
656971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_DESTROY_DRAWABLE,
657971bb1a5SLionel Sambuc /* isvoid */ 1
658971bb1a5SLionel Sambuc };
659971bb1a5SLionel Sambuc
660971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
661971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
662971bb1a5SLionel Sambuc xcb_xf86dri_destroy_drawable_request_t xcb_out;
663971bb1a5SLionel Sambuc
664971bb1a5SLionel Sambuc xcb_out.screen = screen;
665971bb1a5SLionel Sambuc xcb_out.drawable = drawable;
666971bb1a5SLionel Sambuc
667971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
668971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
669971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
670971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
671971bb1a5SLionel Sambuc
672971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
673971bb1a5SLionel Sambuc return xcb_ret;
674971bb1a5SLionel Sambuc }
675971bb1a5SLionel Sambuc
676971bb1a5SLionel Sambuc int
xcb_xf86dri_get_drawable_info_sizeof(const void * _buffer)677971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_sizeof (const void *_buffer /**< */)
678971bb1a5SLionel Sambuc {
679971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
680971bb1a5SLionel Sambuc const xcb_xf86dri_get_drawable_info_reply_t *_aux = (xcb_xf86dri_get_drawable_info_reply_t *)_buffer;
681971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
682971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
683971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
684*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
685971bb1a5SLionel Sambuc
686971bb1a5SLionel Sambuc
687971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_xf86dri_get_drawable_info_reply_t);
688971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
689*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
690*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
691971bb1a5SLionel Sambuc /* clip_rects */
692971bb1a5SLionel Sambuc xcb_block_len += _aux->num_clip_rects * sizeof(xcb_xf86dri_drm_clip_rect_t);
693971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
694971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_xf86dri_drm_clip_rect_t);
695971bb1a5SLionel Sambuc /* insert padding */
696971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
697971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
698971bb1a5SLionel Sambuc if (0 != xcb_pad) {
699971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
700971bb1a5SLionel Sambuc xcb_pad = 0;
701971bb1a5SLionel Sambuc }
702971bb1a5SLionel Sambuc xcb_block_len = 0;
703971bb1a5SLionel Sambuc /* back_clip_rects */
704971bb1a5SLionel Sambuc xcb_block_len += _aux->num_back_clip_rects * sizeof(xcb_xf86dri_drm_clip_rect_t);
705971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
706971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_xf86dri_drm_clip_rect_t);
707971bb1a5SLionel Sambuc /* insert padding */
708971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
709971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
710971bb1a5SLionel Sambuc if (0 != xcb_pad) {
711971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
712971bb1a5SLionel Sambuc xcb_pad = 0;
713971bb1a5SLionel Sambuc }
714971bb1a5SLionel Sambuc xcb_block_len = 0;
715971bb1a5SLionel Sambuc
716971bb1a5SLionel Sambuc return xcb_buffer_len;
717971bb1a5SLionel Sambuc }
718971bb1a5SLionel Sambuc
719971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_cookie_t
xcb_xf86dri_get_drawable_info(xcb_connection_t * c,uint32_t screen,uint32_t drawable)720971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info (xcb_connection_t *c /**< */,
721971bb1a5SLionel Sambuc uint32_t screen /**< */,
722971bb1a5SLionel Sambuc uint32_t drawable /**< */)
723971bb1a5SLionel Sambuc {
724971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
725971bb1a5SLionel Sambuc /* count */ 2,
726971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
727971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_GET_DRAWABLE_INFO,
728971bb1a5SLionel Sambuc /* isvoid */ 0
729971bb1a5SLionel Sambuc };
730971bb1a5SLionel Sambuc
731971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
732971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_cookie_t xcb_ret;
733971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_request_t xcb_out;
734971bb1a5SLionel Sambuc
735971bb1a5SLionel Sambuc xcb_out.screen = screen;
736971bb1a5SLionel Sambuc xcb_out.drawable = drawable;
737971bb1a5SLionel Sambuc
738971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
739971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
740971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
741971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].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_xf86dri_get_drawable_info_cookie_t
xcb_xf86dri_get_drawable_info_unchecked(xcb_connection_t * c,uint32_t screen,uint32_t drawable)748971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_unchecked (xcb_connection_t *c /**< */,
749971bb1a5SLionel Sambuc uint32_t screen /**< */,
750971bb1a5SLionel Sambuc uint32_t drawable /**< */)
751971bb1a5SLionel Sambuc {
752971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
753971bb1a5SLionel Sambuc /* count */ 2,
754971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
755971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_GET_DRAWABLE_INFO,
756971bb1a5SLionel Sambuc /* isvoid */ 0
757971bb1a5SLionel Sambuc };
758971bb1a5SLionel Sambuc
759971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
760971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_cookie_t xcb_ret;
761971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_request_t xcb_out;
762971bb1a5SLionel Sambuc
763971bb1a5SLionel Sambuc xcb_out.screen = screen;
764971bb1a5SLionel Sambuc xcb_out.drawable = drawable;
765971bb1a5SLionel Sambuc
766971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
767971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
768971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
769971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
770971bb1a5SLionel Sambuc
771971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
772971bb1a5SLionel Sambuc return xcb_ret;
773971bb1a5SLionel Sambuc }
774971bb1a5SLionel Sambuc
775971bb1a5SLionel Sambuc xcb_xf86dri_drm_clip_rect_t *
xcb_xf86dri_get_drawable_info_clip_rects(const xcb_xf86dri_get_drawable_info_reply_t * R)776971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_clip_rects (const xcb_xf86dri_get_drawable_info_reply_t *R /**< */)
777971bb1a5SLionel Sambuc {
778971bb1a5SLionel Sambuc return (xcb_xf86dri_drm_clip_rect_t *) (R + 1);
779971bb1a5SLionel Sambuc }
780971bb1a5SLionel Sambuc
781971bb1a5SLionel Sambuc int
xcb_xf86dri_get_drawable_info_clip_rects_length(const xcb_xf86dri_get_drawable_info_reply_t * R)782971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_clip_rects_length (const xcb_xf86dri_get_drawable_info_reply_t *R /**< */)
783971bb1a5SLionel Sambuc {
784971bb1a5SLionel Sambuc return R->num_clip_rects;
785971bb1a5SLionel Sambuc }
786971bb1a5SLionel Sambuc
787971bb1a5SLionel Sambuc xcb_xf86dri_drm_clip_rect_iterator_t
xcb_xf86dri_get_drawable_info_clip_rects_iterator(const xcb_xf86dri_get_drawable_info_reply_t * R)788971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_clip_rects_iterator (const xcb_xf86dri_get_drawable_info_reply_t *R /**< */)
789971bb1a5SLionel Sambuc {
790971bb1a5SLionel Sambuc xcb_xf86dri_drm_clip_rect_iterator_t i;
791971bb1a5SLionel Sambuc i.data = (xcb_xf86dri_drm_clip_rect_t *) (R + 1);
792971bb1a5SLionel Sambuc i.rem = R->num_clip_rects;
793971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
794971bb1a5SLionel Sambuc return i;
795971bb1a5SLionel Sambuc }
796971bb1a5SLionel Sambuc
797971bb1a5SLionel Sambuc xcb_xf86dri_drm_clip_rect_t *
xcb_xf86dri_get_drawable_info_back_clip_rects(const xcb_xf86dri_get_drawable_info_reply_t * R)798971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_back_clip_rects (const xcb_xf86dri_get_drawable_info_reply_t *R /**< */)
799971bb1a5SLionel Sambuc {
800971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_xf86dri_drm_clip_rect_end(xcb_xf86dri_get_drawable_info_clip_rects_iterator(R));
801971bb1a5SLionel Sambuc return (xcb_xf86dri_drm_clip_rect_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xf86dri_drm_clip_rect_t, prev.index) + 0);
802971bb1a5SLionel Sambuc }
803971bb1a5SLionel Sambuc
804971bb1a5SLionel Sambuc int
xcb_xf86dri_get_drawable_info_back_clip_rects_length(const xcb_xf86dri_get_drawable_info_reply_t * R)805971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_back_clip_rects_length (const xcb_xf86dri_get_drawable_info_reply_t *R /**< */)
806971bb1a5SLionel Sambuc {
807971bb1a5SLionel Sambuc return R->num_back_clip_rects;
808971bb1a5SLionel Sambuc }
809971bb1a5SLionel Sambuc
810971bb1a5SLionel Sambuc xcb_xf86dri_drm_clip_rect_iterator_t
xcb_xf86dri_get_drawable_info_back_clip_rects_iterator(const xcb_xf86dri_get_drawable_info_reply_t * R)811971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_back_clip_rects_iterator (const xcb_xf86dri_get_drawable_info_reply_t *R /**< */)
812971bb1a5SLionel Sambuc {
813971bb1a5SLionel Sambuc xcb_xf86dri_drm_clip_rect_iterator_t i;
814971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_xf86dri_drm_clip_rect_end(xcb_xf86dri_get_drawable_info_clip_rects_iterator(R));
815971bb1a5SLionel Sambuc i.data = (xcb_xf86dri_drm_clip_rect_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xf86dri_drm_clip_rect_t, prev.index));
816971bb1a5SLionel Sambuc i.rem = R->num_back_clip_rects;
817971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
818971bb1a5SLionel Sambuc return i;
819971bb1a5SLionel Sambuc }
820971bb1a5SLionel Sambuc
821971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_reply_t *
xcb_xf86dri_get_drawable_info_reply(xcb_connection_t * c,xcb_xf86dri_get_drawable_info_cookie_t cookie,xcb_generic_error_t ** e)822971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_reply (xcb_connection_t *c /**< */,
823971bb1a5SLionel Sambuc xcb_xf86dri_get_drawable_info_cookie_t cookie /**< */,
824971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
825971bb1a5SLionel Sambuc {
826971bb1a5SLionel Sambuc return (xcb_xf86dri_get_drawable_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
827971bb1a5SLionel Sambuc }
828971bb1a5SLionel Sambuc
829971bb1a5SLionel Sambuc int
xcb_xf86dri_get_device_info_sizeof(const void * _buffer)830971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_sizeof (const void *_buffer /**< */)
831971bb1a5SLionel Sambuc {
832971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
833971bb1a5SLionel Sambuc const xcb_xf86dri_get_device_info_reply_t *_aux = (xcb_xf86dri_get_device_info_reply_t *)_buffer;
834971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
835971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
836971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
837*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
838971bb1a5SLionel Sambuc
839971bb1a5SLionel Sambuc
840971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_xf86dri_get_device_info_reply_t);
841971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
842*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
843*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
844971bb1a5SLionel Sambuc /* device_private */
845971bb1a5SLionel Sambuc xcb_block_len += _aux->device_private_size * sizeof(uint32_t);
846971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
847971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
848971bb1a5SLionel Sambuc /* insert padding */
849971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
850971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
851971bb1a5SLionel Sambuc if (0 != xcb_pad) {
852971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
853971bb1a5SLionel Sambuc xcb_pad = 0;
854971bb1a5SLionel Sambuc }
855971bb1a5SLionel Sambuc xcb_block_len = 0;
856971bb1a5SLionel Sambuc
857971bb1a5SLionel Sambuc return xcb_buffer_len;
858971bb1a5SLionel Sambuc }
859971bb1a5SLionel Sambuc
860971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_cookie_t
xcb_xf86dri_get_device_info(xcb_connection_t * c,uint32_t screen)861971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info (xcb_connection_t *c /**< */,
862971bb1a5SLionel Sambuc uint32_t screen /**< */)
863971bb1a5SLionel Sambuc {
864971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
865971bb1a5SLionel Sambuc /* count */ 2,
866971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
867971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_GET_DEVICE_INFO,
868971bb1a5SLionel Sambuc /* isvoid */ 0
869971bb1a5SLionel Sambuc };
870971bb1a5SLionel Sambuc
871971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
872971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_cookie_t xcb_ret;
873971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_request_t xcb_out;
874971bb1a5SLionel Sambuc
875971bb1a5SLionel Sambuc xcb_out.screen = screen;
876971bb1a5SLionel Sambuc
877971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
878971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
879971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
880971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
881971bb1a5SLionel Sambuc
882971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
883971bb1a5SLionel Sambuc return xcb_ret;
884971bb1a5SLionel Sambuc }
885971bb1a5SLionel Sambuc
886971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_cookie_t
xcb_xf86dri_get_device_info_unchecked(xcb_connection_t * c,uint32_t screen)887971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_unchecked (xcb_connection_t *c /**< */,
888971bb1a5SLionel Sambuc uint32_t screen /**< */)
889971bb1a5SLionel Sambuc {
890971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
891971bb1a5SLionel Sambuc /* count */ 2,
892971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
893971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_GET_DEVICE_INFO,
894971bb1a5SLionel Sambuc /* isvoid */ 0
895971bb1a5SLionel Sambuc };
896971bb1a5SLionel Sambuc
897971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
898971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_cookie_t xcb_ret;
899971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_request_t xcb_out;
900971bb1a5SLionel Sambuc
901971bb1a5SLionel Sambuc xcb_out.screen = screen;
902971bb1a5SLionel Sambuc
903971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
904971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
905971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
906971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
907971bb1a5SLionel Sambuc
908971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
909971bb1a5SLionel Sambuc return xcb_ret;
910971bb1a5SLionel Sambuc }
911971bb1a5SLionel Sambuc
912971bb1a5SLionel Sambuc uint32_t *
xcb_xf86dri_get_device_info_device_private(const xcb_xf86dri_get_device_info_reply_t * R)913971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_device_private (const xcb_xf86dri_get_device_info_reply_t *R /**< */)
914971bb1a5SLionel Sambuc {
915971bb1a5SLionel Sambuc return (uint32_t *) (R + 1);
916971bb1a5SLionel Sambuc }
917971bb1a5SLionel Sambuc
918971bb1a5SLionel Sambuc int
xcb_xf86dri_get_device_info_device_private_length(const xcb_xf86dri_get_device_info_reply_t * R)919971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_device_private_length (const xcb_xf86dri_get_device_info_reply_t *R /**< */)
920971bb1a5SLionel Sambuc {
921971bb1a5SLionel Sambuc return R->device_private_size;
922971bb1a5SLionel Sambuc }
923971bb1a5SLionel Sambuc
924971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_xf86dri_get_device_info_device_private_end(const xcb_xf86dri_get_device_info_reply_t * R)925971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_device_private_end (const xcb_xf86dri_get_device_info_reply_t *R /**< */)
926971bb1a5SLionel Sambuc {
927971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
928971bb1a5SLionel Sambuc i.data = ((uint32_t *) (R + 1)) + (R->device_private_size);
929971bb1a5SLionel Sambuc i.rem = 0;
930971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
931971bb1a5SLionel Sambuc return i;
932971bb1a5SLionel Sambuc }
933971bb1a5SLionel Sambuc
934971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_reply_t *
xcb_xf86dri_get_device_info_reply(xcb_connection_t * c,xcb_xf86dri_get_device_info_cookie_t cookie,xcb_generic_error_t ** e)935971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_reply (xcb_connection_t *c /**< */,
936971bb1a5SLionel Sambuc xcb_xf86dri_get_device_info_cookie_t cookie /**< */,
937971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
938971bb1a5SLionel Sambuc {
939971bb1a5SLionel Sambuc return (xcb_xf86dri_get_device_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
940971bb1a5SLionel Sambuc }
941971bb1a5SLionel Sambuc
942971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection_cookie_t
xcb_xf86dri_auth_connection(xcb_connection_t * c,uint32_t screen,uint32_t magic)943971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection (xcb_connection_t *c /**< */,
944971bb1a5SLionel Sambuc uint32_t screen /**< */,
945971bb1a5SLionel Sambuc uint32_t magic /**< */)
946971bb1a5SLionel Sambuc {
947971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
948971bb1a5SLionel Sambuc /* count */ 2,
949971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
950971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_AUTH_CONNECTION,
951971bb1a5SLionel Sambuc /* isvoid */ 0
952971bb1a5SLionel Sambuc };
953971bb1a5SLionel Sambuc
954971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
955971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection_cookie_t xcb_ret;
956971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection_request_t xcb_out;
957971bb1a5SLionel Sambuc
958971bb1a5SLionel Sambuc xcb_out.screen = screen;
959971bb1a5SLionel Sambuc xcb_out.magic = magic;
960971bb1a5SLionel Sambuc
961971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
962971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
963971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
964971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
965971bb1a5SLionel Sambuc
966971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
967971bb1a5SLionel Sambuc return xcb_ret;
968971bb1a5SLionel Sambuc }
969971bb1a5SLionel Sambuc
970971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection_cookie_t
xcb_xf86dri_auth_connection_unchecked(xcb_connection_t * c,uint32_t screen,uint32_t magic)971971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection_unchecked (xcb_connection_t *c /**< */,
972971bb1a5SLionel Sambuc uint32_t screen /**< */,
973971bb1a5SLionel Sambuc uint32_t magic /**< */)
974971bb1a5SLionel Sambuc {
975971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
976971bb1a5SLionel Sambuc /* count */ 2,
977971bb1a5SLionel Sambuc /* ext */ &xcb_xf86dri_id,
978971bb1a5SLionel Sambuc /* opcode */ XCB_XF86DRI_AUTH_CONNECTION,
979971bb1a5SLionel Sambuc /* isvoid */ 0
980971bb1a5SLionel Sambuc };
981971bb1a5SLionel Sambuc
982971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
983971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection_cookie_t xcb_ret;
984971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection_request_t xcb_out;
985971bb1a5SLionel Sambuc
986971bb1a5SLionel Sambuc xcb_out.screen = screen;
987971bb1a5SLionel Sambuc xcb_out.magic = magic;
988971bb1a5SLionel Sambuc
989971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
990971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
991971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
992971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
993971bb1a5SLionel Sambuc
994971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
995971bb1a5SLionel Sambuc return xcb_ret;
996971bb1a5SLionel Sambuc }
997971bb1a5SLionel Sambuc
998971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection_reply_t *
xcb_xf86dri_auth_connection_reply(xcb_connection_t * c,xcb_xf86dri_auth_connection_cookie_t cookie,xcb_generic_error_t ** e)999971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection_reply (xcb_connection_t *c /**< */,
1000971bb1a5SLionel Sambuc xcb_xf86dri_auth_connection_cookie_t cookie /**< */,
1001971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1002971bb1a5SLionel Sambuc {
1003971bb1a5SLionel Sambuc return (xcb_xf86dri_auth_connection_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1004971bb1a5SLionel Sambuc }
1005971bb1a5SLionel Sambuc
1006