From c7517c4fe2c3025b08fa72ed81886b9544d008ba Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 6 Feb 2015 22:16:26 +0000 Subject: [PATCH] sna/present: Restrict pending flip check to enqueueing Present checks for a flip-compatible Pixmap prior to deciding whether to queue the flip after a pending flip, and at that point we do not want to reject a potential flip due to outstanding flips. That is only of restriction only applies when we request the kernel to perform the flip, so more the check to the corresponding position. Signed-off-by: Chris Wilson --- src/sna/sna_present.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/sna/sna_present.c b/src/sna/sna_present.c index 90d08b57..96d43c8f 100644 --- a/src/sna/sna_present.c +++ b/src/sna/sna_present.c @@ -213,11 +213,6 @@ check_flip__crtc(struct sna *sna, return false; } - if (sna->mode.flip_active) { - DBG(("%s: flips still pending\n", __FUNCTION__)); - return false; - } - return true; } @@ -414,6 +409,7 @@ sna_present_flip(RRCrtcPtr crtc, PixmapPtr pixmap, Bool sync_flip) { + struct sna *sna = to_sna_from_pixmap(pixmap); struct kgem_bo *bo; DBG(("%s(pipe=%d, event=%lld, msc=%lld, pixmap=%ld, sync?=%d)\n", @@ -423,12 +419,17 @@ sna_present_flip(RRCrtcPtr crtc, (long long)target_msc, pixmap->drawable.serialNumber, sync_flip)); - if (!check_flip__crtc(to_sna_from_pixmap(pixmap), crtc)) { + if (!check_flip__crtc(sna, crtc)) { DBG(("%s: flip invalid for CRTC\n", __FUNCTION__)); return FALSE; } - assert(to_sna_from_pixmap(pixmap)->present.unflip == 0); + if (sna->mode.flip_active) { + DBG(("%s: flips still pending\n", __FUNCTION__)); + return false; + } + + assert(sna->present.unflip == 0); bo = get_flip_bo(pixmap); if (bo == NULL) {