File: 0004-Check-the-interface-from-libva-first.patch

package info (click to toggle)
intel-vaapi-driver 2.3.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 23,480 kB
  • sloc: ansic: 181,828; asm: 20,806; cpp: 15,306; pascal: 5,836; makefile: 1,857; python: 153; xml: 146; sh: 51
file content (80 lines) | stat: -rw-r--r-- 2,946 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From: Haihao Xiang <haihao.xiang@intel.com>
Date: Fri, 7 Dec 2018 13:31:43 +0800
Subject: Check the interface from libva first

And bump libva dependency to 1.4.0

This fixes https://github.com/intel/intel-vaapi-driver/issues/419

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 configure.ac              |  2 +-
 src/i965_output_wayland.c | 27 ++++++++++++++++-----------
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1604105..7893cb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,7 @@ m4_append([intel_vaapi_driver_version], intel_vaapi_driver_pre_version, [.pre])
 ])
 
 # libva minimum version requirement
-m4_define([va_api_version], [1.1.0])
+m4_define([va_api_version], [1.4.0])
 
 # libdrm minimum version requirement
 m4_define([libdrm_version], [2.4.52])
diff --git a/src/i965_output_wayland.c b/src/i965_output_wayland.c
index 122db95..a637552 100644
--- a/src/i965_output_wayland.c
+++ b/src/i965_output_wayland.c
@@ -397,6 +397,7 @@ i965_output_wayland_init(VADriverContextP ctx)
     struct i965_driver_data * const i965 = i965_driver_data(ctx);
     struct dso_handle *dso_handle;
     struct wl_vtable *wl_vtable;
+    struct VADriverVTableWayland * const vtable = ctx->vtable_wayland;
 
     static const struct dso_symbol libegl_symbols[] = {
         {
@@ -465,25 +466,29 @@ i965_output_wayland_init(VADriverContextP ctx)
     if (!i965->wl_output)
         goto error;
 
-    i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME);
-    if (!i965->wl_output->libegl_handle) {
-        i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME_FALLBACK);
-        if (!i965->wl_output->libegl_handle)
+    wl_vtable = &i965->wl_output->vtable;
+
+    if (vtable->wl_interface)
+        wl_vtable->drm_interface = vtable->wl_interface;
+    else {
+        i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME);
+        if (!i965->wl_output->libegl_handle) {
+            i965->wl_output->libegl_handle = dso_open(LIBEGL_NAME_FALLBACK);
+            if (!i965->wl_output->libegl_handle)
+                goto error;
+        }
+
+        dso_handle = i965->wl_output->libegl_handle;
+        if (!dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
+                             libegl_symbols))
             goto error;
     }
 
-    dso_handle = i965->wl_output->libegl_handle;
-    wl_vtable  = &i965->wl_output->vtable;
-    if (!dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
-                         libegl_symbols))
-        goto error;
-
     i965->wl_output->libwl_client_handle = dso_open(LIBWAYLAND_CLIENT_NAME);
     if (!i965->wl_output->libwl_client_handle)
         goto error;
 
     dso_handle = i965->wl_output->libwl_client_handle;
-    wl_vtable  = &i965->wl_output->vtable;
     if (!dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
                          libwl_client_symbols))
         goto error;