Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 693452 - x11-libs/libva-intel-driver wayland fix for libva
Summary: x11-libs/libva-intel-driver wayland fix for libva
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alexis Ballier
URL: https://github.com/intel/intel-vaapi-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-03 22:49 UTC by Vladi
Modified: 2019-11-29 01:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladi 2019-09-03 22:49:42 UTC
Hi, there is a issue with mpv and other vaapi players using libva on wayland. Here is the issue on github. https://github.com/intel/intel-vaapi-driver/issues/419

Adding below to my /etc/portage/patches fixes the issue

❯ cat /etc/portage/patches/x11-libs/libva-intel-driver/wayland.patch 
From 0abb7a1c938437000bfca1a9b3706884467c681e Mon Sep 17 00:00:00 2001
From: Haihao Xiang <haihao.xiang@intel.com>
Date: Fri, 7 Dec 2018 13:31:43 +0800
Subject: [PATCH] Check the interface from libva first

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

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 src/i965_output_wayland.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/src/i965_output_wayland.c b/src/i965_output_wayland.c
index 122db953..a637552e 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;
Comment 1 Matt Turner gentoo-dev 2019-09-04 01:04:58 UTC
I've asked them to make a release in https://github.com/intel/intel-vaapi-driver/issues/449
Comment 2 Oleh 2019-11-15 18:40:14 UTC
i tested upstream fix and on pure wayland session 
mpv plays video with vaapi acceleration nicely. it would be nice to have the patch included downstream, though it's understandable that it could be of minor non-X11 usage case for the revision bump.
Comment 3 Matt Turner gentoo-dev 2019-11-29 01:08:39 UTC
I pushed the 2.4.0_pre1 release into Gentoo, which includes this patch.