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

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