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

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