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

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