From ca6a57d5ea0e89fa8a6a55869cd91af5144fc367 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 3 Apr 2018 19:05:45 +0100 Subject: [PATCH] sna: Skip shadow redisplay if flips still pending We shouldn't even be attempting to redisplay if there are flips pending, so exit early and expect to be called again after the pending flips complete. Exiting early avoids having to call sna_mode_wakeup() in what used to be a potentially recursive manner (see commit af36a4ab78cc "sna: Defer submission of the next shadow frame until halfway through"). Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 07c7ad61..71500734 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -9045,6 +9045,12 @@ void sna_mode_redisplay(struct sna *sna) if (sna->mode.dirty) return; + if (sna->mode.flip_active) { + DBG(("%s: %d outstanding flips\n", + __FUNCTION__, sna->mode.flip_active)); + return; + } + region = DamageRegion(sna->mode.shadow_damage); if (RegionNil(region)) return; @@ -9054,23 +9060,6 @@ void sna_mode_redisplay(struct sna *sna) region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2)); - if (sna->mode.flip_active) { - DBG(("%s: checking for %d outstanding flip completions\n", - __FUNCTION__, sna->mode.flip_active)); - - sna->mode.dirty = true; - while (sna->mode.flip_active && sna_mode_wakeup(sna)) - ; - sna->mode.dirty = false; - - DBG(("%s: now %d outstanding flip completions (enabled? %d)\n", - __FUNCTION__, - sna->mode.flip_active, - sna->mode.shadow_enabled)); - if (sna->mode.flip_active || !sna->mode.shadow_enabled) - return; - } - if (!move_crtc_to_gpu(sna)) { DBG(("%s: forcing scanout update using the CPU\n", __FUNCTION__)); if (!sna_pixmap_move_to_cpu(sna->front, MOVE_READ))