Blame SOURCES/0004-xwayland-eglstream-Prefer-EGLstream-if-available.patch

7984e5
From bdc00ba749ac6cde35c025f5f6b1a5b49c1f4960 Mon Sep 17 00:00:00 2001
7984e5
From: Olivier Fourdan <ofourdan@redhat.com>
7984e5
Date: Wed, 17 Nov 2021 09:56:52 +0100
7984e5
Subject: [PATCH xserver 4/4] xwayland/eglstream: Prefer EGLstream if available
7984e5
MIME-Version: 1.0
7984e5
Content-Type: text/plain; charset=UTF-8
7984e5
Content-Transfer-Encoding: 8bit
7984e5
7984e5
Currently, when given the choice, Xwayland will pick the GBM backend
7984e5
over the EGLstream backend if both are available, unless the command
7984e5
line option “-eglstream” is specified.
7984e5
7984e5
The NVIDIA proprietary driver had no support for GBM until driver series
7984e5
495, but starting with the driver series 495, both can be used.
7984e5
7984e5
But there are other requirements with the rest of the stack, typically
7984e5
Mesa, egl-wayland, libglvnd as documented in the NVIDIA driver.
7984e5
7984e5
So if the NVIDIA driver series 495 gets installed, Xwayland will pick
7984e5
the GBM backend even if EGLstream is available and may fail to render
7984e5
properly.
7984e5
7984e5
To avoid that issue, prefer EGLstream if EGLstream and all the Wayland
7984e5
interfaces are available, and fallback to GBM automatically unless
7984e5
“-eglstream” was specified.
7984e5
7984e5
With this, the compositor, given the choice, can decide which actual
7984e5
backend Xwayland would use by advertising (or not) the Wayland
7984e5
"wl_eglstream_controller" interface.
7984e5
7984e5
This change has no impact on compositors which do not have support for
7984e5
EGLstream in the first place.
7984e5
7984e5
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
7984e5
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
7984e5
(cherry picked from commit 6dd9709bd85cf5de4067887818c864220b951355)
7984e5
---
7984e5
 hw/xwayland/xwayland-glamor.c | 8 ++------
7984e5
 1 file changed, 2 insertions(+), 6 deletions(-)
7984e5
7984e5
diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
7984e5
index b34eafabb..f46b677f5 100644
7984e5
--- a/hw/xwayland/xwayland-glamor.c
7984e5
+++ b/hw/xwayland/xwayland-glamor.c
7984e5
@@ -441,14 +441,10 @@ xwl_glamor_select_eglstream_backend(struct xwl_screen *xwl_screen)
7984e5
 void
7984e5
 xwl_glamor_select_backend(struct xwl_screen *xwl_screen, Bool use_eglstream)
7984e5
 {
7984e5
-    if (use_eglstream) {
7984e5
-        if (!xwl_glamor_select_eglstream_backend(xwl_screen))
7984e5
+    if (!xwl_glamor_select_eglstream_backend(xwl_screen)) {
7984e5
+        if (!use_eglstream)
7984e5
             xwl_glamor_select_gbm_backend(xwl_screen);
7984e5
     }
7984e5
-    else {
7984e5
-        if (!xwl_glamor_select_gbm_backend(xwl_screen))
7984e5
-            xwl_glamor_select_eglstream_backend(xwl_screen);
7984e5
-    }
7984e5
 }
7984e5
 
7984e5
 Bool
7984e5
-- 
7984e5
2.33.1
7984e5