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

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