Blame SOURCES/0024-xwayland-eglstream-Use-nvidia-for-GLVND.patch

d05f4b
From 430eb872784c04e825126e0d7454f3a5bbefff70 Mon Sep 17 00:00:00 2001
d05f4b
From: Olivier Fourdan <ofourdan@redhat.com>
d05f4b
Date: Mon, 17 May 2021 18:20:57 +0200
d05f4b
Subject: [PATCH xserver 24/27] xwayland/eglstream: Use "nvidia" for GLVND
d05f4b
MIME-Version: 1.0
d05f4b
Content-Type: text/plain; charset=UTF-8
d05f4b
Content-Transfer-Encoding: 8bit
d05f4b
d05f4b
If the EGLStream backend is able to use hardware acceleration with the
d05f4b
NVIDIA closed source driver, we should use the "nvidia" GLX
d05f4b
implementation instead of the one from Mesa to take advantage of the
d05f4b
NVIDIA hardware accelerated rendering.
d05f4b
d05f4b
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
d05f4b
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
d05f4b
(cherry picked from commit fae58e9b03696a3890f9c876306c68ffa6f9ff30)
d05f4b
---
d05f4b
 hw/xwayland/xwayland-glamor-eglstream.c | 8 +++++---
d05f4b
 1 file changed, 5 insertions(+), 3 deletions(-)
d05f4b
d05f4b
diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c
d05f4b
index c583a1390..5e89849ff 100644
d05f4b
--- a/hw/xwayland/xwayland-glamor-eglstream.c
d05f4b
+++ b/hw/xwayland/xwayland-glamor-eglstream.c
d05f4b
@@ -1195,9 +1195,11 @@ xwl_glamor_eglstream_init_egl(struct xwl_screen *xwl_screen)
d05f4b
 
d05f4b
     xwl_eglstream_init_shaders(xwl_screen);
d05f4b
 
d05f4b
-    if (epoxy_has_gl_extension("GL_OES_EGL_image") &&
d05f4b
-        !dri3_screen_init(xwl_screen->screen, &xwl_dri3_info)) {
d05f4b
-        ErrorF("DRI3 initialization failed. Performance will be affected.\n");
d05f4b
+    if (epoxy_has_gl_extension("GL_OES_EGL_image")) {
d05f4b
+        if (dri3_screen_init(xwl_screen->screen, &xwl_dri3_info))
d05f4b
+            xwl_screen->glvnd_vendor = "nvidia";
d05f4b
+        else
d05f4b
+            ErrorF("DRI3 initialization failed. Performance will be affected.\n");
d05f4b
     }
d05f4b
 
d05f4b
     return TRUE;
d05f4b
-- 
d05f4b
2.31.1
d05f4b