summaryrefslogtreecommitdiff
path: root/va/wayland
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2018-12-07 13:25:41 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2018-12-26 16:08:34 +0800
commit62bad1239d8ea1bb269ca69d3469aa267f57cdec (patch)
tree5918f714daeef509c370b9ef0d23377b59e357f7 /va/wayland
parente4cd982197a4f0131a6a5a43dd83f69f0a724db7 (diff)
downloadlibva-62bad1239d8ea1bb269ca69d3469aa267f57cdec.tar.gz
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>
Diffstat (limited to 'va/wayland')
-rw-r--r--va/wayland/va_backend_wayland.h10
-rw-r--r--va/wayland/va_wayland_drm.c4
2 files changed, 13 insertions, 1 deletions
diff --git a/va/wayland/va_backend_wayland.h b/va/wayland/va_backend_wayland.h
index 9e5740a..906d4bf 100644
--- a/va/wayland/va_backend_wayland.h
+++ b/va/wayland/va_backend_wayland.h
@@ -64,8 +64,16 @@ struct VADriverVTableWayland {
/** \brief Indicate whether buffer sharing with prime fd is supported. */
unsigned int has_prime_sharing;
+ /**
+ * Pointer to an implementation of struct wl_interface
+ *
+ * It is set by libva-wayland when a context is created, then the backend
+ * driver may reuse it.
+ */
+ const void *wl_interface;
+
/** \brief Reserved bytes for future use, must be zero */
- unsigned long reserved[8];
+ unsigned long reserved[7];
};
#endif /* VA_BACKEND_WAYLAND_H */
diff --git a/va/wayland/va_wayland_drm.c b/va/wayland/va_wayland_drm.c
index 8e22695..4cd3f6c 100644
--- a/va/wayland/va_wayland_drm.c
+++ b/va/wayland/va_wayland_drm.c
@@ -136,6 +136,7 @@ va_wayland_drm_destroy(VADisplayContextP pDisplayContext)
struct VADriverVTableWayland *vtable = ctx->vtable_wayland;
vtable->has_prime_sharing = 0;
+ vtable->wl_interface = NULL;
wl_drm_ctx->is_authenticated = 0;
@@ -222,6 +223,8 @@ va_wayland_drm_create(VADisplayContextP pDisplayContext)
struct VADriverVTableWayland *vtable = ctx->vtable_wayland;
struct wl_display *wrapped_display = NULL;
+ vtable->wl_interface = NULL;
+
wl_drm_ctx = malloc(sizeof(*wl_drm_ctx));
if (!wl_drm_ctx) {
va_wayland_error("could not allocate wl_drm_ctx");
@@ -300,6 +303,7 @@ va_wayland_drm_create(VADisplayContextP pDisplayContext)
goto end;
}
+ vtable->wl_interface = &wl_drm_interface;
result = true;
end: