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

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