summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-02-08 09:47:42 +0000
committerAdam Jackson <ajax@redhat.com>2015-12-09 10:45:49 -0500
commitcc0cefed4f098ce6e933f2142a4fee93df5f652d (patch)
tree44244121d3345074b9b323a5518ab1032d292671
parentcfeea6382b5aaac0dcf59d88f7735b0703c9929f (diff)
present: Do not replace Pixmaps on redirected Window on unflip
When unflipping, we may find that our flip window has been redirected. If we replace the redirected Window with the Screen Pixmap we then have mutliple fullscreen Windows believing that their own the Screen Pixmap - multiple fullscreen Windows that are being flipped by Clients, and so continue to flip causing popping between e.g. the compositor and the game. [ajax: Fix up present_execute() hunk to account for changes introduced in fe07ec19e212a68076560d243a2a935c54589068] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (cherry picked from commit 72f0724cdc65dc9abbbf70b9feb6cce7c2b9f8a0)
-rw-r--r--present/present.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/present/present.c b/present/present.c
index c55a56e7c..66e0f21b3 100644
--- a/present/present.c
+++ b/present/present.c
@@ -374,12 +374,17 @@ present_set_tree_pixmap_visit(WindowPtr window, void *data)
}
static void
-present_set_tree_pixmap(WindowPtr window, PixmapPtr pixmap)
+present_set_tree_pixmap(WindowPtr window,
+ PixmapPtr expected,
+ PixmapPtr pixmap)
{
struct pixmap_visit visit;
ScreenPtr screen = window->drawable.pScreen;
visit.old = (*screen->GetWindowPixmap)(window);
+ if (expected && visit.old != expected)
+ return;
+
visit.new = pixmap;
if (visit.old == visit.new)
return;
@@ -390,6 +395,7 @@ static void
present_set_abort_flip(ScreenPtr screen)
{
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+ PixmapPtr pixmap = (*screen->GetScreenPixmap)(screen);
/* Switch back to using the screen pixmap now to avoid
* 2D applications drawing to the wrong pixmap.
@@ -397,10 +403,11 @@ present_set_abort_flip(ScreenPtr screen)
if (screen_priv->flip_window)
present_set_tree_pixmap(screen_priv->flip_window,
- (*screen->GetScreenPixmap)(screen));
+ screen_priv->flip_pixmap,
+ pixmap);
if (screen->root)
- present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen));
+ present_set_tree_pixmap(screen->root, NULL, pixmap);
screen_priv->flip_pending->abort_flip = TRUE;
}
@@ -414,10 +421,12 @@ present_unflip(ScreenPtr screen)
assert (!screen_priv->unflip_event_id);
assert (!screen_priv->flip_pending);
- if (screen_priv->flip_window)
- present_set_tree_pixmap(screen_priv->flip_window, pixmap);
+ if (screen_priv->flip_pixmap && screen_priv->flip_window)
+ present_set_tree_pixmap(screen_priv->flip_window,
+ screen_priv->flip_pixmap,
+ pixmap);
- present_set_tree_pixmap(screen->root, pixmap);
+ present_set_tree_pixmap(screen->root, NULL, pixmap);
/* Update the screen pixmap with the current flip pixmap contents
*/
@@ -644,9 +653,10 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
*/
if (screen_priv->flip_window && screen_priv->flip_window != window)
present_set_tree_pixmap(screen_priv->flip_window,
- (*screen->GetScreenPixmap)(screen));
- present_set_tree_pixmap(vblank->window, vblank->pixmap);
- present_set_tree_pixmap(screen->root, vblank->pixmap);
+ screen_priv->flip_pixmap,
+ (*screen->GetScreenPixmap)(screen));
+ present_set_tree_pixmap(vblank->window, NULL, vblank->pixmap);
+ present_set_tree_pixmap(screen->root, NULL, vblank->pixmap);
/* Report update region as damaged
*/