summaryrefslogtreecommitdiff
path: root/src/sna/sna_dri2.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-02-23 09:32:57 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-02-23 09:32:57 +0000
commit64b1b1f10da59f15a91141c9f76d7d09517f8ea8 (patch)
tree90cbfa1be5b68daf4cf0a21837c70b99b1e68f08 /src/sna/sna_dri2.c
parent05320318fb940247d8749da8330215d19f41d84e (diff)
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@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri2.c')
-rw-r--r--src/sna/sna_dri2.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index fcfbd9d9..9398c0a8 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)