From 1a5e4fb725da2eb25cf7f476290c02e9880a4efc Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 6 Jan 2013 17:08:56 +0000 Subject: [PATCH] sna: Only disable upon a failed pageflip after at least one pipe flips If we have yet to update a pipe for a pageflip, then the state remains consistent and we can fallback to a blit without disabling any pipes. If we fail after flipping a pipe, then unless we disable an output the state becomes inconsistent (the pipes disagree on what the attached fb is). Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index c66bb47d..4ff4d8ff 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -2539,6 +2539,12 @@ static int do_page_flip(struct sna *sna, struct kgem_bo *bo, DBG(("%s: flip [fb=%d] on crtc %d [%d] failed - %d\n", __FUNCTION__, arg.fb_id, i, crtc->id, errno)); disable: + if (count == 0) + return 0; + + xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR, + "%s: page flipping failed, disabling CRTC:%d (pipe=%d)\n", + __FUNCTION__, crtc->id, crtc->pipe); sna_crtc_disable(config->crtc[i]); continue; } @@ -3288,6 +3294,9 @@ void sna_mode_redisplay(struct sna *sna) DBG(("%s: flip [fb=%d] on crtc %d [%d, pipe=%d] failed - %d\n", __FUNCTION__, arg.fb_id, i, crtc->id, crtc->pipe, errno)); disable: + xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR, + "%s: page flipping failed, disabling CRTC:%d (pipe=%d)\n", + __FUNCTION__, crtc->id, crtc->pipe); sna_crtc_disable(config->crtc[i]); continue; }