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

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