Blame SOURCES/0016-xwayland-eglstream-Do-not-commit-without-surface.patch

5f5628
From 9601f2cc5c94b9db4c7f8da404dae53b9609c995 Mon Sep 17 00:00:00 2001
5f5628
From: Olivier Fourdan <ofourdan@redhat.com>
5f5628
Date: Mon, 19 Apr 2021 18:11:19 +0200
5f5628
Subject: [PATCH xserver 16/27] xwayland/eglstream: Do not commit without
5f5628
 surface
5f5628
MIME-Version: 1.0
5f5628
Content-Type: text/plain; charset=UTF-8
5f5628
Content-Transfer-Encoding: 8bit
5f5628
5f5628
The EGL surface for the xwl_pixmap is created once the stream is ready
5f5628
and valid.
5f5628
5f5628
If the pixmap's EGL surface fails, for whatever reason, the xwl_pixmap
5f5628
will be unusable and will end up as an invalid wl_buffer.
5f5628
5f5628
Make sure we do not allow commits in that case and recreate the
5f5628
xwl_pixmap/stream.
5f5628
5f5628
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
5f5628
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
5f5628
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1156
5f5628
(cherry picked from commit 098e0f52c088c6eb52c7e54c5a11cefabd480908)
5f5628
---
5f5628
 hw/xwayland/xwayland-glamor-eglstream.c | 9 ++++++++-
5f5628
 1 file changed, 8 insertions(+), 1 deletion(-)
5f5628
5f5628
diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c
5f5628
index 399a691d3..ce066cd9e 100644
5f5628
--- a/hw/xwayland/xwayland-glamor-eglstream.c
5f5628
+++ b/hw/xwayland/xwayland-glamor-eglstream.c
5f5628
@@ -670,7 +670,14 @@ xwl_glamor_eglstream_allow_commits(struct xwl_window *xwl_window)
5f5628
 
5f5628
             return FALSE;
5f5628
         } else {
5f5628
-            return TRUE;
5f5628
+            if (xwl_pixmap->surface != EGL_NO_SURFACE)
5f5628
+                return TRUE;
5f5628
+
5f5628
+            /* The pending stream got removed, we have a xwl_pixmap and
5f5628
+             * yet we do not have a surface.
5f5628
+             * So something went wrong with the surface creation, retry.
5f5628
+             */
5f5628
+            xwl_eglstream_destroy_pixmap_stream(xwl_pixmap);
5f5628
         }
5f5628
     }
5f5628
 
5f5628
-- 
5f5628
2.31.1
5f5628