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

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