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 <[email protected]>
---
 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

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to