OSDN Git Service

da267e8cfa48334e7245cb22847d5dc2e134b285
[android-x86/hardware-intel-common-libva.git] / va / wayland / wayland-drm-client-protocol.h
1 /* Generated by wayland-scanner 1.11.90 */
2
3 #ifndef DRM_CLIENT_PROTOCOL_H
4 #define DRM_CLIENT_PROTOCOL_H
5
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-client.h"
9
10 #ifdef  __cplusplus
11 extern "C" {
12 #endif
13
14 /**
15  * @page page_drm The drm protocol
16  * @section page_ifaces_drm Interfaces
17  * - @subpage page_iface_wl_drm - 
18  * @section page_copyright_drm Copyright
19  * <pre>
20  *
21  * Copyright © 2008-2011 Kristian Høgsberg
22  * Copyright © 2010-2011 Intel Corporation
23  *
24  * Permission to use, copy, modify, distribute, and sell this
25  * software and its documentation for any purpose is hereby granted
26  * without fee, provided that\n the above copyright notice appear in
27  * all copies and that both that copyright notice and this permission
28  * notice appear in supporting documentation, and that the name of
29  * the copyright holders not be used in advertising or publicity
30  * pertaining to distribution of the software without specific,
31  * written prior permission.  The copyright holders make no
32  * representations about the suitability of this software for any
33  * purpose.  It is provided "as is" without express or implied
34  * warranty.
35  *
36  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
37  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
38  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
39  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
40  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
41  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
42  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
43  * THIS SOFTWARE.
44  * </pre>
45  */
46 struct wl_buffer;
47 struct wl_drm;
48
49 /**
50  * @page page_iface_wl_drm wl_drm
51  * @section page_iface_wl_drm_api API
52  * See @ref iface_wl_drm.
53  */
54 /**
55  * @defgroup iface_wl_drm The wl_drm interface
56  */
57 extern const struct wl_interface wl_drm_interface;
58
59 #ifndef WL_DRM_ERROR_ENUM
60 #define WL_DRM_ERROR_ENUM
61 enum wl_drm_error {
62         WL_DRM_ERROR_AUTHENTICATE_FAIL = 0,
63         WL_DRM_ERROR_INVALID_FORMAT = 1,
64         WL_DRM_ERROR_INVALID_NAME = 2,
65 };
66 #endif /* WL_DRM_ERROR_ENUM */
67
68 #ifndef WL_DRM_FORMAT_ENUM
69 #define WL_DRM_FORMAT_ENUM
70 enum wl_drm_format {
71         WL_DRM_FORMAT_C8 = 0x20203843,
72         WL_DRM_FORMAT_RGB332 = 0x38424752,
73         WL_DRM_FORMAT_BGR233 = 0x38524742,
74         WL_DRM_FORMAT_XRGB4444 = 0x32315258,
75         WL_DRM_FORMAT_XBGR4444 = 0x32314258,
76         WL_DRM_FORMAT_RGBX4444 = 0x32315852,
77         WL_DRM_FORMAT_BGRX4444 = 0x32315842,
78         WL_DRM_FORMAT_ARGB4444 = 0x32315241,
79         WL_DRM_FORMAT_ABGR4444 = 0x32314241,
80         WL_DRM_FORMAT_RGBA4444 = 0x32314152,
81         WL_DRM_FORMAT_BGRA4444 = 0x32314142,
82         WL_DRM_FORMAT_XRGB1555 = 0x35315258,
83         WL_DRM_FORMAT_XBGR1555 = 0x35314258,
84         WL_DRM_FORMAT_RGBX5551 = 0x35315852,
85         WL_DRM_FORMAT_BGRX5551 = 0x35315842,
86         WL_DRM_FORMAT_ARGB1555 = 0x35315241,
87         WL_DRM_FORMAT_ABGR1555 = 0x35314241,
88         WL_DRM_FORMAT_RGBA5551 = 0x35314152,
89         WL_DRM_FORMAT_BGRA5551 = 0x35314142,
90         WL_DRM_FORMAT_RGB565 = 0x36314752,
91         WL_DRM_FORMAT_BGR565 = 0x36314742,
92         WL_DRM_FORMAT_RGB888 = 0x34324752,
93         WL_DRM_FORMAT_BGR888 = 0x34324742,
94         WL_DRM_FORMAT_XRGB8888 = 0x34325258,
95         WL_DRM_FORMAT_XBGR8888 = 0x34324258,
96         WL_DRM_FORMAT_RGBX8888 = 0x34325852,
97         WL_DRM_FORMAT_BGRX8888 = 0x34325842,
98         WL_DRM_FORMAT_ARGB8888 = 0x34325241,
99         WL_DRM_FORMAT_ABGR8888 = 0x34324241,
100         WL_DRM_FORMAT_RGBA8888 = 0x34324152,
101         WL_DRM_FORMAT_BGRA8888 = 0x34324142,
102         WL_DRM_FORMAT_XRGB2101010 = 0x30335258,
103         WL_DRM_FORMAT_XBGR2101010 = 0x30334258,
104         WL_DRM_FORMAT_RGBX1010102 = 0x30335852,
105         WL_DRM_FORMAT_BGRX1010102 = 0x30335842,
106         WL_DRM_FORMAT_ARGB2101010 = 0x30335241,
107         WL_DRM_FORMAT_ABGR2101010 = 0x30334241,
108         WL_DRM_FORMAT_RGBA1010102 = 0x30334152,
109         WL_DRM_FORMAT_BGRA1010102 = 0x30334142,
110         WL_DRM_FORMAT_YUYV = 0x56595559,
111         WL_DRM_FORMAT_YVYU = 0x55595659,
112         WL_DRM_FORMAT_UYVY = 0x59565955,
113         WL_DRM_FORMAT_VYUY = 0x59555956,
114         WL_DRM_FORMAT_AYUV = 0x56555941,
115         WL_DRM_FORMAT_NV12 = 0x3231564e,
116         WL_DRM_FORMAT_NV21 = 0x3132564e,
117         WL_DRM_FORMAT_NV16 = 0x3631564e,
118         WL_DRM_FORMAT_NV61 = 0x3136564e,
119         WL_DRM_FORMAT_YUV410 = 0x39565559,
120         WL_DRM_FORMAT_YVU410 = 0x39555659,
121         WL_DRM_FORMAT_YUV411 = 0x31315559,
122         WL_DRM_FORMAT_YVU411 = 0x31315659,
123         WL_DRM_FORMAT_YUV420 = 0x32315559,
124         WL_DRM_FORMAT_YVU420 = 0x32315659,
125         WL_DRM_FORMAT_YUV422 = 0x36315559,
126         WL_DRM_FORMAT_YVU422 = 0x36315659,
127         WL_DRM_FORMAT_YUV444 = 0x34325559,
128         WL_DRM_FORMAT_YVU444 = 0x34325659,
129 };
130 #endif /* WL_DRM_FORMAT_ENUM */
131
132 #ifndef WL_DRM_CAPABILITY_ENUM
133 #define WL_DRM_CAPABILITY_ENUM
134 /**
135  * @ingroup iface_wl_drm
136  * wl_drm capability bitmask
137  *
138  * Bitmask of capabilities.
139  */
140 enum wl_drm_capability {
141         /**
142          * wl_drm prime available
143          */
144         WL_DRM_CAPABILITY_PRIME = 1,
145 };
146 #endif /* WL_DRM_CAPABILITY_ENUM */
147
148 /**
149  * @ingroup iface_wl_drm
150  * @struct wl_drm_listener
151  */
152 struct wl_drm_listener {
153         /**
154          */
155         void (*device)(void *data,
156                        struct wl_drm *wl_drm,
157                        const char *name);
158         /**
159          */
160         void (*format)(void *data,
161                        struct wl_drm *wl_drm,
162                        uint32_t format);
163         /**
164          */
165         void (*authenticated)(void *data,
166                               struct wl_drm *wl_drm);
167         /**
168          */
169         void (*capabilities)(void *data,
170                              struct wl_drm *wl_drm,
171                              uint32_t value);
172 };
173
174 /**
175  * @ingroup wl_drm_iface
176  */
177 static inline int
178 wl_drm_add_listener(struct wl_drm *wl_drm,
179                     const struct wl_drm_listener *listener, void *data)
180 {
181         return wl_proxy_add_listener((struct wl_proxy *) wl_drm,
182                                      (void (**)(void)) listener, data);
183 }
184
185 #define WL_DRM_AUTHENTICATE 0
186 #define WL_DRM_CREATE_BUFFER 1
187 #define WL_DRM_CREATE_PLANAR_BUFFER 2
188 #define WL_DRM_CREATE_PRIME_BUFFER 3
189
190 /**
191  * @ingroup iface_wl_drm
192  */
193 #define WL_DRM_AUTHENTICATE_SINCE_VERSION 1
194 /**
195  * @ingroup iface_wl_drm
196  */
197 #define WL_DRM_CREATE_BUFFER_SINCE_VERSION 1
198 /**
199  * @ingroup iface_wl_drm
200  */
201 #define WL_DRM_CREATE_PLANAR_BUFFER_SINCE_VERSION 1
202 /**
203  * @ingroup iface_wl_drm
204  */
205 #define WL_DRM_CREATE_PRIME_BUFFER_SINCE_VERSION 2
206
207 /** @ingroup iface_wl_drm */
208 static inline void
209 wl_drm_set_user_data(struct wl_drm *wl_drm, void *user_data)
210 {
211         wl_proxy_set_user_data((struct wl_proxy *) wl_drm, user_data);
212 }
213
214 /** @ingroup iface_wl_drm */
215 static inline void *
216 wl_drm_get_user_data(struct wl_drm *wl_drm)
217 {
218         return wl_proxy_get_user_data((struct wl_proxy *) wl_drm);
219 }
220
221 static inline uint32_t
222 wl_drm_get_version(struct wl_drm *wl_drm)
223 {
224         return wl_proxy_get_version((struct wl_proxy *) wl_drm);
225 }
226
227 /** @ingroup iface_wl_drm */
228 static inline void
229 wl_drm_destroy(struct wl_drm *wl_drm)
230 {
231         wl_proxy_destroy((struct wl_proxy *) wl_drm);
232 }
233
234 /**
235  * @ingroup iface_wl_drm
236  */
237 static inline void
238 wl_drm_authenticate(struct wl_drm *wl_drm, uint32_t id)
239 {
240         wl_proxy_marshal((struct wl_proxy *) wl_drm,
241                          WL_DRM_AUTHENTICATE, id);
242 }
243
244 /**
245  * @ingroup iface_wl_drm
246  */
247 static inline struct wl_buffer *
248 wl_drm_create_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, int32_t height, uint32_t stride, uint32_t format)
249 {
250         struct wl_proxy *id;
251
252         id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_drm,
253                          WL_DRM_CREATE_BUFFER, &wl_buffer_interface, NULL, name, width, height, stride, format);
254
255         return (struct wl_buffer *) id;
256 }
257
258 /**
259  * @ingroup iface_wl_drm
260  */
261 static inline struct wl_buffer *
262 wl_drm_create_planar_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, int32_t height, uint32_t format, int32_t offset0, int32_t stride0, int32_t offset1, int32_t stride1, int32_t offset2, int32_t stride2)
263 {
264         struct wl_proxy *id;
265
266         id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_drm,
267                          WL_DRM_CREATE_PLANAR_BUFFER, &wl_buffer_interface, NULL, name, width, height, format, offset0, stride0, offset1, stride1, offset2, stride2);
268
269         return (struct wl_buffer *) id;
270 }
271
272 /**
273  * @ingroup iface_wl_drm
274  */
275 static inline struct wl_buffer *
276 wl_drm_create_prime_buffer(struct wl_drm *wl_drm, int32_t name, int32_t width, int32_t height, uint32_t format, int32_t offset0, int32_t stride0, int32_t offset1, int32_t stride1, int32_t offset2, int32_t stride2)
277 {
278         struct wl_proxy *id;
279
280         id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_drm,
281                          WL_DRM_CREATE_PRIME_BUFFER, &wl_buffer_interface, NULL, name, width, height, format, offset0, stride0, offset1, stride1, offset2, stride2);
282
283         return (struct wl_buffer *) id;
284 }
285
286 #ifdef  __cplusplus
287 }
288 #endif
289
290 #endif