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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-05-14 11:37:51 +01:00
parent 68181f0b53
commit 84d0790453
1 changed files with 8 additions and 0 deletions

View File

@ -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;