[PATCH] present: Cancel the copy on unflip when aborting a pending flip

Chris Wilson chris at chris-wilson.co.uk
Mon Feb 16 03:51:59 PST 2015


If we handle a vblank notification and perform a copy whilst a flip is
still pending, we mark the pending flip for abort. After marking the
next flip completion for abortion, we then proceed to copy the requested
region into the restored Window drawable. However, when we then process
the unflip for the aborted Pixmap we copy the contents of flip pixmap
over top of the previously copied region - overwriting it with stale
data.

A simplish hack that seems to prevent this is to mark the flip_window as
NULL during set_abort so that unflip skips the copy back over the
updated contents.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 present/present.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/present/present.c b/present/present.c
index 9a283d4..e9ccfb8 100644
--- a/present/present.c
+++ b/present/present.c
@@ -401,10 +401,12 @@ present_set_abort_flip(ScreenPtr screen)
      * 2D applications drawing to the wrong pixmap.
      */
 
-    if (screen_priv->flip_window)
+    if (screen_priv->flip_window) {
         present_set_tree_pixmap(screen_priv->flip_window,
                                 screen_priv->flip_pixmap,
                                 pixmap);
+	screen_priv->flip_window = NULL;
+    }
 
     if (screen->root)
         present_set_tree_pixmap(screen->root, NULL, pixmap);
-- 
2.1.4



More information about the xorg-devel mailing list