diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-14 16:13:33 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-16 10:01:09 +0100 |
commit | 3a7d6afd85f85b8b10bf0c08b7b5fa5265624850 (patch) | |
tree | dc8ed89160c6dcfd3fae5be80a6d16f99ef91dcc /src | |
parent | f71447998cc8e22570cd5641bcf008cb68e9f4a3 (diff) |
sna: Do not cache the current crtc bo after performing the setcrtc
When doing a SETCRTC as a fallack for a failed pageflip, do not use the
then current CRTC bo as the next bo for pageflipping - as then we will
render into it prior to flipping and so cause tearing.
References: https://bugs.freedesktop.org/show_bug.cgi?id=95401
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_display.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 2c6059d2..080efbe2 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -8734,7 +8734,6 @@ void sna_mode_redisplay(struct sna *sna) sna_crtc->bo = kgem_bo_reference(bo); sna_crtc->bo->active_scanout++; - sna_crtc->cache_bo = kgem_bo_reference(bo); } else { BoxRec box; DrawableRec tmp; @@ -8762,10 +8761,10 @@ disable1: __FUNCTION__, __sna_crtc_id(sna_crtc), __sna_crtc_pipe(sna_crtc)); sna_crtc_disable(crtc, false); } - - kgem_bo_destroy(&sna->kgem, bo); - sna_crtc->cache_bo = NULL; } + + kgem_bo_destroy(&sna->kgem, bo); + sna_crtc->cache_bo = NULL; continue; } sna->mode.flip_active++; @@ -8778,6 +8777,8 @@ disable1: sna_crtc->flip_serial = sna_crtc->mode_serial; sna_crtc->flip_pending = true; + assert_scanout(&sna->kgem, sna_crtc->bo, + crtc->mode.HDisplay, crtc->mode.VDisplay); sna_crtc->cache_bo = kgem_bo_reference(sna_crtc->bo); DBG(("%s: recording flip on CRTC:%d handle=%d, active_scanout=%d, serial=%d\n", __FUNCTION__, __sna_crtc_id(sna_crtc), sna_crtc->flip_bo->handle, sna_crtc->flip_bo->active_scanout, sna_crtc->flip_serial)); |