2
1

0001-Add-pointer-to-struct-wl_interface-for-driver-to-use.patch 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From 62bad1239d8ea1bb269ca69d3469aa267f57cdec Mon Sep 17 00:00:00 2001
  2. From: Haihao Xiang <haihao.xiang@intel.com>
  3. Date: Fri, 7 Dec 2018 13:25:41 +0800
  4. Subject: [PATCH] Add pointer to struct wl_interface for driver to use
  5. See https://github.com/intel/intel-vaapi-driver/issues/419 for the
  6. information
  7. Note: don't export the interface symbol in case others may reuse it.
  8. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
  9. [james.hilliard1@gmail.com: backport from upstream commit
  10. 62bad1239d8ea1bb269ca69d3469aa267f57cdec]
  11. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
  12. ---
  13. va/wayland/va_backend_wayland.h | 10 +++++++++-
  14. va/wayland/va_wayland_drm.c | 4 ++++
  15. 2 files changed, 13 insertions(+), 1 deletion(-)
  16. diff --git a/va/wayland/va_backend_wayland.h b/va/wayland/va_backend_wayland.h
  17. index 9e5740a..906d4bf 100644
  18. --- a/va/wayland/va_backend_wayland.h
  19. +++ b/va/wayland/va_backend_wayland.h
  20. @@ -64,8 +64,16 @@ struct VADriverVTableWayland {
  21. /** \brief Indicate whether buffer sharing with prime fd is supported. */
  22. unsigned int has_prime_sharing;
  23. + /**
  24. + * Pointer to an implementation of struct wl_interface
  25. + *
  26. + * It is set by libva-wayland when a context is created, then the backend
  27. + * driver may reuse it.
  28. + */
  29. + const void *wl_interface;
  30. +
  31. /** \brief Reserved bytes for future use, must be zero */
  32. - unsigned long reserved[8];
  33. + unsigned long reserved[7];
  34. };
  35. #endif /* VA_BACKEND_WAYLAND_H */
  36. diff --git a/va/wayland/va_wayland_drm.c b/va/wayland/va_wayland_drm.c
  37. index 8e22695..4cd3f6c 100644
  38. --- a/va/wayland/va_wayland_drm.c
  39. +++ b/va/wayland/va_wayland_drm.c
  40. @@ -136,6 +136,7 @@ va_wayland_drm_destroy(VADisplayContextP pDisplayContext)
  41. struct VADriverVTableWayland *vtable = ctx->vtable_wayland;
  42. vtable->has_prime_sharing = 0;
  43. + vtable->wl_interface = NULL;
  44. wl_drm_ctx->is_authenticated = 0;
  45. @@ -222,6 +223,8 @@ va_wayland_drm_create(VADisplayContextP pDisplayContext)
  46. struct VADriverVTableWayland *vtable = ctx->vtable_wayland;
  47. struct wl_display *wrapped_display = NULL;
  48. + vtable->wl_interface = NULL;
  49. +
  50. wl_drm_ctx = malloc(sizeof(*wl_drm_ctx));
  51. if (!wl_drm_ctx) {
  52. va_wayland_error("could not allocate wl_drm_ctx");
  53. @@ -300,6 +303,7 @@ va_wayland_drm_create(VADisplayContextP pDisplayContext)
  54. goto end;
  55. }
  56. + vtable->wl_interface = &wl_drm_interface;
  57. result = true;
  58. end:
  59. --
  60. 2.7.4