Blame SOURCES/0002-present-wnmd-Free-flip_queue-entries-in-present_wnmd.patch

315c3e
From 732507ed3255dff3970c5f92bd6ea13bf877e637 Mon Sep 17 00:00:00 2001
315c3e
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
315c3e
Date: Thu, 25 Jun 2020 18:11:31 +0200
315c3e
Subject: [PATCH xserver 2/4] present/wnmd: Free flip_queue entries in
315c3e
 present_wnmd_clear_window_flip
315c3e
MIME-Version: 1.0
315c3e
Content-Type: text/plain; charset=UTF-8
315c3e
Content-Transfer-Encoding: 8bit
315c3e
315c3e
When present_wnmd_clear_window_flip is done, present_destroy_window
315c3e
frees struct present_window_priv, and the events in the flip queue
315c3e
become unreachable. So if we don't free them first, they're leaked.
315c3e
315c3e
Also drop the call to present_wnmd_set_abort_flip, which just sets a
315c3e
flag in struct present_window_priv and thus can't have any observable
315c3e
effect after present_destroy_window.
315c3e
315c3e
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1042
315c3e
Reviewed-by: Dave Airlie <airlied@redhat.com>
315c3e
(cherry picked from commit 1bdedc8dbb9d035b85444c2558a137470ff52113)
315c3e
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
315c3e
---
315c3e
 present/present_screen.c | 6 +++---
315c3e
 1 file changed, 3 insertions(+), 3 deletions(-)
315c3e
315c3e
diff --git a/present/present_screen.c b/present/present_screen.c
315c3e
index c435f55f4..bfd30b8ba 100644
315c3e
--- a/present/present_screen.c
315c3e
+++ b/present/present_screen.c
315c3e
@@ -115,9 +115,9 @@ present_wnmd_clear_window_flip(WindowPtr window)
315c3e
     present_window_priv_ptr     window_priv = present_window_priv(window);
315c3e
     present_vblank_ptr          vblank, tmp;
315c3e
 
315c3e
-    if (window_priv->flip_pending) {
315c3e
-        present_wnmd_set_abort_flip(window);
315c3e
-        window_priv->flip_pending->window = NULL;
315c3e
+    xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->flip_queue, event_queue) {
315c3e
+        present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence);
315c3e
+        present_vblank_destroy(vblank);
315c3e
     }
315c3e
 
315c3e
     xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->idle_queue, event_queue) {
315c3e
-- 
315c3e
2.26.2
315c3e