hardware/intel/common/libva
Revision | 91359d182e2dcadf76d0cf9b5c801887819c9af0 (tree) |
---|---|
Time | 2016-10-31 10:42:26 |
Author | Xiang, Haihao <haihao.xiang@inte...> |
Commiter | Xiang, Haihao |
New wayland-drm.xml
Update wayland-drm-client-protocol.h as well
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit d8719fb8b2d999c3de64def3a801778021c71f84)
@@ -14,7 +14,7 @@ extern "C" { | ||
14 | 14 | /** |
15 | 15 | * @page page_drm The drm protocol |
16 | 16 | * @section page_ifaces_drm Interfaces |
17 | - * - @subpage page_iface_wl_drm - | |
17 | + * - @subpage page_iface_wl_drm - | |
18 | 18 | * @section page_copyright_drm Copyright |
19 | 19 | * <pre> |
20 | 20 | * |
@@ -129,6 +129,22 @@ enum wl_drm_format { | ||
129 | 129 | }; |
130 | 130 | #endif /* WL_DRM_FORMAT_ENUM */ |
131 | 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 | + | |
132 | 148 | /** |
133 | 149 | * @ingroup iface_wl_drm |
134 | 150 | * @struct wl_drm_listener |
@@ -148,6 +164,11 @@ struct wl_drm_listener { | ||
148 | 164 | */ |
149 | 165 | void (*authenticated)(void *data, |
150 | 166 | struct wl_drm *wl_drm); |
167 | + /** | |
168 | + */ | |
169 | + void (*capabilities)(void *data, | |
170 | + struct wl_drm *wl_drm, | |
171 | + uint32_t value); | |
151 | 172 | }; |
152 | 173 | |
153 | 174 | /** |
@@ -164,6 +185,7 @@ wl_drm_add_listener(struct wl_drm *wl_drm, | ||
164 | 185 | #define WL_DRM_AUTHENTICATE 0 |
165 | 186 | #define WL_DRM_CREATE_BUFFER 1 |
166 | 187 | #define WL_DRM_CREATE_PLANAR_BUFFER 2 |
188 | +#define WL_DRM_CREATE_PRIME_BUFFER 3 | |
167 | 189 | |
168 | 190 | /** |
169 | 191 | * @ingroup iface_wl_drm |
@@ -177,6 +199,10 @@ wl_drm_add_listener(struct wl_drm *wl_drm, | ||
177 | 199 | * @ingroup iface_wl_drm |
178 | 200 | */ |
179 | 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 | |
180 | 206 | |
181 | 207 | /** @ingroup iface_wl_drm */ |
182 | 208 | static inline void |
@@ -243,6 +269,20 @@ wl_drm_create_planar_buffer(struct wl_drm *wl_drm, uint32_t name, int32_t width, | ||
243 | 269 | return (struct wl_buffer *) id; |
244 | 270 | } |
245 | 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 | + | |
246 | 286 | #ifdef __cplusplus |
247 | 287 | } |
248 | 288 | #endif |
@@ -29,7 +29,7 @@ | ||
29 | 29 | |
30 | 30 | <!-- drm support. This object is created by the server and published |
31 | 31 | using the display's global event. --> |
32 | - <interface name="wl_drm" version="1"> | |
32 | + <interface name="wl_drm" version="2"> | |
33 | 33 | <enum name="error"> |
34 | 34 | <entry name="authenticate_fail" value="0"/> |
35 | 35 | <entry name="invalid_format" value="1"/> |
@@ -150,6 +150,36 @@ | ||
150 | 150 | |
151 | 151 | <!-- Raised if the authenticate request succeeded --> |
152 | 152 | <event name="authenticated"/> |
153 | + | |
154 | + <enum name="capability" since="2"> | |
155 | + <description summary="wl_drm capability bitmask"> | |
156 | + Bitmask of capabilities. | |
157 | + </description> | |
158 | + <entry name="prime" value="1" summary="wl_drm prime available"/> | |
159 | + </enum> | |
160 | + | |
161 | + <event name="capabilities"> | |
162 | + <arg name="value" type="uint"/> | |
163 | + </event> | |
164 | + | |
165 | + <!-- Version 2 additions --> | |
166 | + | |
167 | + <!-- Create a wayland buffer for the prime fd. Use for regular and planar | |
168 | + buffers. Pass 0 for offset and stride for unused planes. --> | |
169 | + <request name="create_prime_buffer" since="2"> | |
170 | + <arg name="id" type="new_id" interface="wl_buffer"/> | |
171 | + <arg name="name" type="fd"/> | |
172 | + <arg name="width" type="int"/> | |
173 | + <arg name="height" type="int"/> | |
174 | + <arg name="format" type="uint"/> | |
175 | + <arg name="offset0" type="int"/> | |
176 | + <arg name="stride0" type="int"/> | |
177 | + <arg name="offset1" type="int"/> | |
178 | + <arg name="stride1" type="int"/> | |
179 | + <arg name="offset2" type="int"/> | |
180 | + <arg name="stride2" type="int"/> | |
181 | + </request> | |
182 | + | |
153 | 183 | </interface> |
154 | 184 | |
155 | 185 | </protocol> |