Blame SOURCES/0003-modesetting-Clear-new-screen-pixmap-storage-on-RandR.patch

61240a
From 5489029ff6508b37d71d47d905d744c436a49563 Mon Sep 17 00:00:00 2001
61240a
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
61240a
Date: Tue, 26 Nov 2019 17:17:12 +0100
61240a
Subject: [PATCH xserver 3/3] modesetting: Clear new screen pixmap storage on
61240a
 RandR resize
61240a
MIME-Version: 1.0
61240a
Content-Type: text/plain; charset=UTF-8
61240a
Content-Transfer-Encoding: 8bit
61240a
61240a
Fixes random garbage being visible intermittently.
61240a
61240a
Reviewed-by: Adam Jackson <ajax@redhat.com>
61240a
(Cherry picked from commit 9ba13bac9dd076f166ff0d063fc144b904a40d12)
61240a
61240a
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
61240a
---
61240a
 hw/xfree86/drivers/modesetting/drmmode_display.c | 15 +++++++++++++++
61240a
 1 file changed, 15 insertions(+)
61240a
61240a
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
61240a
index 8786d13a3..eca058258 100644
61240a
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
61240a
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
61240a
@@ -1795,6 +1795,19 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
61240a
                                              &drmmode_crtc->prime_pixmap);
61240a
 }
61240a
 
61240a
+static void
61240a
+drmmode_clear_pixmap(PixmapPtr pixmap)
61240a
+{
61240a
+    ScreenPtr screen = pixmap->drawable.pScreen;
61240a
+    GCPtr gc;
61240a
+
61240a
+    gc = GetScratchGC(pixmap->drawable.depth, screen);
61240a
+    if (gc) {
61240a
+        miClearDrawable(&pixmap->drawable, gc);
61240a
+        FreeScratchGC(gc);
61240a
+    }
61240a
+}
61240a
+
61240a
 static void *
61240a
 drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
61240a
 {
61240a
@@ -3179,6 +3192,8 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
61240a
     if (!drmmode_glamor_handle_new_screen_pixmap(drmmode))
61240a
         goto fail;
61240a
 
61240a
+    drmmode_clear_pixmap(ppix);
61240a
+
61240a
     for (i = 0; i < xf86_config->num_crtc; i++) {
61240a
         xf86CrtcPtr crtc = xf86_config->crtc[i];
61240a
 
61240a
-- 
61240a
2.24.0
61240a