1 /* Generated by wayland-scanner 1.11.90 */
3 #ifndef DRM_CLIENT_PROTOCOL_H
4 #define DRM_CLIENT_PROTOCOL_H
8 #include "wayland-client.h"
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
21 * Copyright © 2008-2011 Kristian Høgsberg
22 * Copyright © 2010-2011 Intel Corporation
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
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
50 * @page page_iface_wl_drm wl_drm
51 * @section page_iface_wl_drm_api API
52 * See @ref iface_wl_drm.
55 * @defgroup iface_wl_drm The wl_drm interface
57 extern const struct wl_interface wl_drm_interface;
59 #ifndef WL_DRM_ERROR_ENUM
60 #define WL_DRM_ERROR_ENUM
62 WL_DRM_ERROR_AUTHENTICATE_FAIL = 0,
63 WL_DRM_ERROR_INVALID_FORMAT = 1,
64 WL_DRM_ERROR_INVALID_NAME = 2,
66 #endif /* WL_DRM_ERROR_ENUM */
68 #ifndef WL_DRM_FORMAT_ENUM
69 #define WL_DRM_FORMAT_ENUM
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,
130 #endif /* WL_DRM_FORMAT_ENUM */
132 #ifndef WL_DRM_CAPABILITY_ENUM
133 #define WL_DRM_CAPABILITY_ENUM
135 * @ingroup iface_wl_drm
136 * wl_drm capability bitmask
138 * Bitmask of capabilities.
140 enum wl_drm_capability {
142 * wl_drm prime available
144 WL_DRM_CAPABILITY_PRIME = 1,
146 #endif /* WL_DRM_CAPABILITY_ENUM */
149 * @ingroup iface_wl_drm
150 * @struct wl_drm_listener
152 struct wl_drm_listener {
155 void (*device)(void *data,
156 struct wl_drm *wl_drm,
160 void (*format)(void *data,
161 struct wl_drm *wl_drm,
165 void (*authenticated)(void *data,
166 struct wl_drm *wl_drm);
169 void (*capabilities)(void *data,
170 struct wl_drm *wl_drm,
175 * @ingroup wl_drm_iface
178 wl_drm_add_listener(struct wl_drm *wl_drm,
179 const struct wl_drm_listener *listener, void *data)
181 return wl_proxy_add_listener((struct wl_proxy *) wl_drm,
182 (void (**)(void)) listener, data);
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
191 * @ingroup iface_wl_drm
193 #define WL_DRM_AUTHENTICATE_SINCE_VERSION 1
195 * @ingroup iface_wl_drm
197 #define WL_DRM_CREATE_BUFFER_SINCE_VERSION 1
199 * @ingroup iface_wl_drm
201 #define WL_DRM_CREATE_PLANAR_BUFFER_SINCE_VERSION 1
203 * @ingroup iface_wl_drm
205 #define WL_DRM_CREATE_PRIME_BUFFER_SINCE_VERSION 2
207 /** @ingroup iface_wl_drm */
209 wl_drm_set_user_data(struct wl_drm *wl_drm, void *user_data)
211 wl_proxy_set_user_data((struct wl_proxy *) wl_drm, user_data);
214 /** @ingroup iface_wl_drm */
216 wl_drm_get_user_data(struct wl_drm *wl_drm)
218 return wl_proxy_get_user_data((struct wl_proxy *) wl_drm);
221 static inline uint32_t
222 wl_drm_get_version(struct wl_drm *wl_drm)
224 return wl_proxy_get_version((struct wl_proxy *) wl_drm);
227 /** @ingroup iface_wl_drm */
229 wl_drm_destroy(struct wl_drm *wl_drm)
231 wl_proxy_destroy((struct wl_proxy *) wl_drm);
235 * @ingroup iface_wl_drm
238 wl_drm_authenticate(struct wl_drm *wl_drm, uint32_t id)
240 wl_proxy_marshal((struct wl_proxy *) wl_drm,
241 WL_DRM_AUTHENTICATE, id);
245 * @ingroup iface_wl_drm
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)
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);
255 return (struct wl_buffer *) id;
259 * @ingroup iface_wl_drm
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)
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);
269 return (struct wl_buffer *) id;
273 * @ingroup iface_wl_drm
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)
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);
283 return (struct wl_buffer *) id;