Blame SOURCES/0020-xwayland-eglstream-Set-ALU-to-GXCopy-for-blitting.patch

4c4b8b
From 9519ebe96344ec64e8f18eae2420df101c446a1a Mon Sep 17 00:00:00 2001
4c4b8b
From: Olivier Fourdan <ofourdan@redhat.com>
4c4b8b
Date: Fri, 30 Apr 2021 16:23:10 +0200
4c4b8b
Subject: [PATCH xserver 20/27] xwayland/eglstream: Set ALU to GXCopy for
4c4b8b
 blitting
4c4b8b
MIME-Version: 1.0
4c4b8b
Content-Type: text/plain; charset=UTF-8
4c4b8b
Content-Transfer-Encoding: 8bit
4c4b8b
4c4b8b
The EGLstream backend's post damage function uses a shader and
4c4b8b
glDrawArrays() to copy the data from the glamor's pixmap texture prior
4c4b8b
to do the eglSwapBuffers().
4c4b8b
4c4b8b
However, glDrawArrays() can be affected by the GL state, and therefore
4c4b8b
not reliably produce the expected copy, causing the content of the
4c4b8b
buffer to be corrupted.
4c4b8b
4c4b8b
Make sure to set the ALU to GXCopy prior to call glDrawArrays() to get
4c4b8b
the expected result.
4c4b8b
4c4b8b
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
4c4b8b
Suggested-by: Michel Dänzer <mdaenzer@redhat.com>
4c4b8b
(cherry picked from commit 012350e3db47fef0404346f55968032e62004fcf)
4c4b8b
---
4c4b8b
 hw/xwayland/xwayland-glamor-eglstream.c | 3 +++
4c4b8b
 1 file changed, 3 insertions(+)
4c4b8b
4c4b8b
diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c
4c4b8b
index 64f4e31f5..2094d293a 100644
4c4b8b
--- a/hw/xwayland/xwayland-glamor-eglstream.c
4c4b8b
+++ b/hw/xwayland/xwayland-glamor-eglstream.c
4c4b8b
@@ -33,6 +33,7 @@
4c4b8b
 #define EGL_NO_X11
4c4b8b
 #include <glamor_egl.h>
4c4b8b
 #include <glamor.h>
4c4b8b
+#include <glamor_priv.h>
4c4b8b
 #include <glamor_transform.h>
4c4b8b
 #include <glamor_transfer.h>
4c4b8b
 
4c4b8b
@@ -727,6 +728,8 @@ xwl_glamor_eglstream_post_damage(struct xwl_window *xwl_window,
4c4b8b
      * won't actually draw to it
4c4b8b
      */
4c4b8b
     xwl_glamor_egl_make_current(xwl_screen);
4c4b8b
+    glamor_set_alu(xwl_screen->screen, GXcopy);
4c4b8b
+
4c4b8b
     glBindFramebuffer(GL_FRAMEBUFFER, 0);
4c4b8b
 
4c4b8b
     if (eglGetCurrentSurface(EGL_READ) != xwl_pixmap->surface ||
4c4b8b
-- 
4c4b8b
2.31.1
4c4b8b