xf86-video-intel: src/sna/sna_display.c src/sna/sna_dri2.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Feb 23 09:36:06 UTC 2016


 src/sna/sna_display.c |    2 ++
 src/sna/sna_dri2.c    |    7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 64b1b1f10da59f15a91141c9f76d7d09517f8ea8
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 23 09:32:57 2016 +0000

    sna/dri2: Ensure the flipqueue is drained on pageflip failure
    
    If we fail to queue a flip for a CRTC, we attempt to restore the
    original mode. However, if the failure is on a second CRTC, the queued
    flip on the first will still complete causing us to process the event
    twice.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=94250
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index a1e1ffb..4870429 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -6374,6 +6374,8 @@ static void sna_mode_restore(struct sna *sna)
 		}
 	}
 	sna_mode_wakeup(sna);
+	while (sna->mode.flip_active && sna_mode_wakeup(sna))
+		;
 	update_flush_interval(sna);
 	sna_cursors_reload(sna);
 	sna->mode.dirty = false;
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index fcfbd9d..9398c0a 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1914,6 +1914,7 @@ sna_dri2_flip(struct sna_dri2_event *info)
 		return false;
 	}
 
+	assert(!info->queued);
 	if (!sna_page_flip(info->sna, bo, sna_dri2_flip_handler,
 			   info->type == FLIP_ASYNC ? NULL : info))
 		return false;
@@ -2797,6 +2798,7 @@ sna_dri2_flip_continue(struct sna_dri2_event *info)
 	if (bo != sna_pixmap(info->sna->front)->gpu_bo)
 		return false;
 
+	assert(!info->queued);
 	if (!sna_page_flip(info->sna, bo, sna_dri2_flip_handler, info))
 		return false;
 
@@ -2868,8 +2870,9 @@ static void sna_dri2_flip_event(struct sna_dri2_event *flip)
 {
 	struct sna *sna = flip->sna;
 
-	DBG(("%s flip=%p (pipe=%d, event=%d)\n", __FUNCTION__, flip, flip->pipe, flip->type));
-	assert(flip->queued);
+	DBG(("%s flip=%p (pipe=%d, event=%d, queued?=%d)\n", __FUNCTION__, flip, flip->pipe, flip->type, flip->queued));
+	if (!flip->queued) /* pageflip died whilst being queued */
+		return;
 	flip->queued = false;
 
 	if (sna->dri2.flip_pending == flip)


More information about the xorg-commit mailing list