Blame SOURCES/0021-xwayland-eglstream-allow-commits-to-dma-buf-backed-p.patch

d05f4b
From 64deb9471c7d9cad4c2ec1de1fba6a35c9af8e68 Mon Sep 17 00:00:00 2001
d05f4b
From: Erik Kurzinger <ekurzinger@nvidia.com>
d05f4b
Date: Fri, 14 May 2021 08:26:49 -0400
d05f4b
Subject: [PATCH xserver 21/27] xwayland/eglstream: allow commits to dma-buf
d05f4b
 backed pixmaps
d05f4b
MIME-Version: 1.0
d05f4b
Content-Type: text/plain; charset=UTF-8
d05f4b
Content-Transfer-Encoding: 8bit
d05f4b
d05f4b
As of commit 098e0f52 xwl_glamor_eglstream_allow_commits will not allow commits
d05f4b
if the xwl_pixmap does not have an EGLSurface. This is valid for pixmaps backed
d05f4b
by an EGLStream, however pixmaps backed by a dma-buf for OpenGL or Vulkan
d05f4b
rendering will never have an EGLSurface.  Unlike EGLStream backed pixmaps,
d05f4b
though, glamor will render directly to the buffer that Xwayland passes to the
d05f4b
compositor. Hence, they don't require the intermediate copy in
d05f4b
xwl_glamor_eglstream_post_damage that EGLStream backed pixmaps do, so there is
d05f4b
no need for an EGLSurface.
d05f4b
d05f4b
Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
d05f4b
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
d05f4b
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
d05f4b
(cherry picked from commit 3d33d885fcd1215a74c1819278cf6f9557c9860b)
d05f4b
---
d05f4b
 hw/xwayland/xwayland-glamor-eglstream.c | 3 ++-
d05f4b
 1 file changed, 2 insertions(+), 1 deletion(-)
d05f4b
d05f4b
diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c
d05f4b
index 2094d293a..2d0827709 100644
d05f4b
--- a/hw/xwayland/xwayland-glamor-eglstream.c
d05f4b
+++ b/hw/xwayland/xwayland-glamor-eglstream.c
d05f4b
@@ -681,7 +681,8 @@ xwl_glamor_eglstream_allow_commits(struct xwl_window *xwl_window)
d05f4b
 
d05f4b
             return FALSE;
d05f4b
         } else {
d05f4b
-            if (xwl_pixmap->surface != EGL_NO_SURFACE)
d05f4b
+            if (xwl_pixmap->surface != EGL_NO_SURFACE ||
d05f4b
+                xwl_pixmap->type == XWL_PIXMAP_DMA_BUF)
d05f4b
                 return TRUE;
d05f4b
 
d05f4b
             /* The pending stream got removed, we have a xwl_pixmap and
d05f4b
-- 
d05f4b
2.31.1
d05f4b