Blame SOURCES/0023-xwayland-Add-preferred-GLVND-vendor-to-xwl_screen.patch

d05f4b
From 4c01758cbe7db02d84ac0cba0c626e855bf927d6 Mon Sep 17 00:00:00 2001
d05f4b
From: Olivier Fourdan <ofourdan@redhat.com>
d05f4b
Date: Thu, 20 May 2021 12:11:42 +0200
d05f4b
Subject: [PATCH xserver 23/27] xwayland: Add preferred GLVND vendor to
d05f4b
 xwl_screen
d05f4b
MIME-Version: 1.0
d05f4b
Content-Type: text/plain; charset=UTF-8
d05f4b
Content-Transfer-Encoding: 8bit
d05f4b
d05f4b
If Xwayland's EGLstream backend supports hardware acceleration with the
d05f4b
NVIDIA closed-source driver, the GLX library also needs to be one
d05f4b
shipped by NVIDIA, that's what GLVND is for.
d05f4b
d05f4b
Add a new member to the xwl_screen that the backend can optionally set
d05f4b
to the preferred GLVND vendor to use.
d05f4b
d05f4b
If not set, "mesa" is assumed.
d05f4b
d05f4b
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
d05f4b
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
d05f4b
(cherry picked from commit 24fc8aea1e4bbaba780f1a316fba797a0198f603)
d05f4b
---
d05f4b
 hw/xwayland/xwayland-glx.c    | 3 +++
d05f4b
 hw/xwayland/xwayland-screen.h | 3 +++
d05f4b
 2 files changed, 6 insertions(+)
d05f4b
d05f4b
diff --git a/hw/xwayland/xwayland-glx.c b/hw/xwayland/xwayland-glx.c
d05f4b
index 7e2a87fc1..eba8946ab 100644
d05f4b
--- a/hw/xwayland/xwayland-glx.c
d05f4b
+++ b/hw/xwayland/xwayland-glx.c
d05f4b
@@ -378,6 +378,9 @@ egl_screen_probe(ScreenPtr pScreen)
d05f4b
         return NULL;
d05f4b
     }
d05f4b
 
d05f4b
+    if (!screen->base.glvnd && xwl_screen->glvnd_vendor)
d05f4b
+        screen->base.glvnd = strdup(xwl_screen->glvnd_vendor);
d05f4b
+
d05f4b
     if (!screen->base.glvnd)
d05f4b
         screen->base.glvnd = strdup("mesa");
d05f4b
 
d05f4b
diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h
d05f4b
index 5fe4712bd..b965dddd7 100644
d05f4b
--- a/hw/xwayland/xwayland-screen.h
d05f4b
+++ b/hw/xwayland/xwayland-screen.h
d05f4b
@@ -107,6 +107,9 @@ struct xwl_screen {
d05f4b
     struct glamor_context *glamor_ctx;
d05f4b
 
d05f4b
     Atom allow_commits_prop;
d05f4b
+
d05f4b
+    /* The preferred GLVND vendor. If NULL, "mesa" is assumed. */
d05f4b
+    const char *glvnd_vendor;
d05f4b
 };
d05f4b
 
d05f4b
 /* Apps which use randr/vidmode to change the mode when going fullscreen,
d05f4b
-- 
d05f4b
2.31.1
d05f4b