From 84d0790453089be5d1034037065df1ea37ad48fe Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 14 May 2014 11:37:51 +0100 Subject: sna: After disabling the TearFree shadow, flush any pending flips If we complete a flip after resizing and recreating the TearFree shadow, we may process the flip completion events whilst the output is only partially reconfigured. Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 5ac46f56..20b2f8e1 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -3240,6 +3240,14 @@ sna_mode_resize(ScrnInfoPtr scrn, int width, int height) scrn->virtualY = height; scrn->displayWidth = width; + /* Flush pending shadow updates */ + if (sna->mode.shadow_flip) { + DBG(("%s: waiting for %d outstanding TearFree flips\n", + __FUNCTION__, sna->mode.shadow_flip)); + while (sna->mode.shadow_flip && sna_mode_wait_for_event(sna)) + sna_mode_wakeup(sna); + } + /* Only update the CRTCs if we are in control */ if (!scrn->vtSema) return TRUE; -- cgit v1.2.3