hardware/intel/common/libva
Revisión | 62bad1239d8ea1bb269ca69d3469aa267f57cdec (tree) |
---|---|
Tiempo | 2018-12-26 17:08:34 |
Autor | Haihao Xiang <haihao.xiang@inte...> |
Commiter | Xiang, Haihao |
Add pointer to struct wl_interface for driver to use
See https://github.com/intel/intel-vaapi-driver/issues/419 for the
information
Note: don't export the interface symbol in case others may reuse it.
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
@@ -64,8 +64,16 @@ struct VADriverVTableWayland { | ||
64 | 64 | /** \brief Indicate whether buffer sharing with prime fd is supported. */ |
65 | 65 | unsigned int has_prime_sharing; |
66 | 66 | |
67 | + /** | |
68 | + * Pointer to an implementation of struct wl_interface | |
69 | + * | |
70 | + * It is set by libva-wayland when a context is created, then the backend | |
71 | + * driver may reuse it. | |
72 | + */ | |
73 | + const void *wl_interface; | |
74 | + | |
67 | 75 | /** \brief Reserved bytes for future use, must be zero */ |
68 | - unsigned long reserved[8]; | |
76 | + unsigned long reserved[7]; | |
69 | 77 | }; |
70 | 78 | |
71 | 79 | #endif /* VA_BACKEND_WAYLAND_H */ |
@@ -136,6 +136,7 @@ va_wayland_drm_destroy(VADisplayContextP pDisplayContext) | ||
136 | 136 | struct VADriverVTableWayland *vtable = ctx->vtable_wayland; |
137 | 137 | |
138 | 138 | vtable->has_prime_sharing = 0; |
139 | + vtable->wl_interface = NULL; | |
139 | 140 | |
140 | 141 | wl_drm_ctx->is_authenticated = 0; |
141 | 142 |
@@ -222,6 +223,8 @@ va_wayland_drm_create(VADisplayContextP pDisplayContext) | ||
222 | 223 | struct VADriverVTableWayland *vtable = ctx->vtable_wayland; |
223 | 224 | struct wl_display *wrapped_display = NULL; |
224 | 225 | |
226 | + vtable->wl_interface = NULL; | |
227 | + | |
225 | 228 | wl_drm_ctx = malloc(sizeof(*wl_drm_ctx)); |
226 | 229 | if (!wl_drm_ctx) { |
227 | 230 | va_wayland_error("could not allocate wl_drm_ctx"); |
@@ -300,6 +303,7 @@ va_wayland_drm_create(VADisplayContextP pDisplayContext) | ||
300 | 303 | goto end; |
301 | 304 | } |
302 | 305 | |
306 | + vtable->wl_interface = &wl_drm_interface; | |
303 | 307 | result = true; |
304 | 308 | |
305 | 309 | end: |