427.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. From 0abb7a1c938437000bfca1a9b3706884467c681e 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] 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. ---
  8. src/i965_output_wayland.c | 27 ++++++++++++++++-----------
  9. 1 file changed, 16 insertions(+), 11 deletions(-)
  10. diff --git a/src/i965_output_wayland.c b/src/i965_output_wayland.c
  11. index 122db953..a637552e 100644
  12. --- a/src/i965_output_wayland.c
  13. +++ b/src/i965_output_wayland.c
  14. @@ -397,6 +397,7 @@ i965_output_wayland_init(VADriverContextP ctx)
  15. struct i965_driver_data * const i965 = i965_driver_data(ctx);
  16. struct dso_handle *dso_handle;
  17. struct wl_vtable *wl_vtable;
  18. + struct VADriverVTableWayland * const vtable = ctx->vtable_wayland;
  19. static const struct dso_symbol libegl_symbols[] = {
  20. {
  21. @@ -465,25 +466,29 @@ i965_output_wayland_init(VADriverContextP ctx)
  22. if (!i965->wl_output)
  23. goto error;
  24. - i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME);
  25. - if (!i965->wl_output->libegl_handle) {
  26. - i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME_FALLBACK);
  27. - if (!i965->wl_output->libegl_handle)
  28. + wl_vtable = &i965->wl_output->vtable;
  29. +
  30. + if (vtable->wl_interface)
  31. + wl_vtable->drm_interface = vtable->wl_interface;
  32. + else {
  33. + i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME);
  34. + if (!i965->wl_output->libegl_handle) {
  35. + i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME_FALLBACK);
  36. + if (!i965->wl_output->libegl_handle)
  37. + goto error;
  38. + }
  39. +
  40. + dso_handle = i965->wl_output->libegl_handle;
  41. + if (!dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
  42. + libegl_symbols))
  43. goto error;
  44. }
  45. - dso_handle = i965->wl_output->libegl_handle;
  46. - wl_vtable = &i965->wl_output->vtable;
  47. - if (!dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
  48. - libegl_symbols))
  49. - goto error;
  50. -
  51. i965->wl_output->libwl_client_handle = dso_open(LIBWAYLAND_CLIENT_NAME);
  52. if (!i965->wl_output->libwl_client_handle)
  53. goto error;
  54. dso_handle = i965->wl_output->libwl_client_handle;
  55. - wl_vtable = &i965->wl_output->vtable;
  56. if (!dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
  57. libwl_client_symbols))
  58. goto error;