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

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