0001-Check-the-interface-from-libva-first.patch 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. From 3db0c4838fe30fcee5beb8b31ca67d5cf7d77fb3 Mon Sep 17 00:00:00 2001
  2. From: Haihao Xiang <haihao.xiang@intel.com>
  3. Date: Fri, 7 Dec 2018 13:31:43 +0800
  4. Subject: [PATCH 1/1] Check the interface from libva first
  5. This fixes https://github.com/intel/intel-vaapi-driver/issues/419
  6. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
  7. [james.hilliard1@gmail.com: backport from upstream commit
  8. f139dafa59172d40543f2ec469a035d3de9fdc6a]
  9. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
  10. ---
  11. src/i965_output_wayland.c | 27 ++++++++++++++++-----------
  12. 1 file changed, 16 insertions(+), 11 deletions(-)
  13. diff --git a/src/i965_output_wayland.c b/src/i965_output_wayland.c
  14. index 122db95..a637552 100644
  15. --- a/src/i965_output_wayland.c
  16. +++ b/src/i965_output_wayland.c
  17. @@ -397,6 +397,7 @@ i965_output_wayland_init(VADriverContextP ctx)
  18. struct i965_driver_data * const i965 = i965_driver_data(ctx);
  19. struct dso_handle *dso_handle;
  20. struct wl_vtable *wl_vtable;
  21. + struct VADriverVTableWayland * const vtable = ctx->vtable_wayland;
  22. static const struct dso_symbol libegl_symbols[] = {
  23. {
  24. @@ -465,25 +466,29 @@ i965_output_wayland_init(VADriverContextP ctx)
  25. if (!i965->wl_output)
  26. goto error;
  27. - i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME);
  28. - if (!i965->wl_output->libegl_handle) {
  29. - i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME_FALLBACK);
  30. - if (!i965->wl_output->libegl_handle)
  31. + wl_vtable = &i965->wl_output->vtable;
  32. +
  33. + if (vtable->wl_interface)
  34. + wl_vtable->drm_interface = vtable->wl_interface;
  35. + else {
  36. + i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME);
  37. + if (!i965->wl_output->libegl_handle) {
  38. + i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME_FALLBACK);
  39. + if (!i965->wl_output->libegl_handle)
  40. + goto error;
  41. + }
  42. +
  43. + dso_handle = i965->wl_output->libegl_handle;
  44. + if (!dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
  45. + libegl_symbols))
  46. goto error;
  47. }
  48. - dso_handle = i965->wl_output->libegl_handle;
  49. - wl_vtable = &i965->wl_output->vtable;
  50. - if (!dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
  51. - libegl_symbols))
  52. - goto error;
  53. -
  54. i965->wl_output->libwl_client_handle = dso_open(LIBWAYLAND_CLIENT_NAME);
  55. if (!i965->wl_output->libwl_client_handle)
  56. goto error;
  57. dso_handle = i965->wl_output->libwl_client_handle;
  58. - wl_vtable = &i965->wl_output->vtable;
  59. if (!dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
  60. libwl_client_symbols))
  61. goto error;
  62. --
  63. 2.7.4