diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-04-03 19:05:45 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-04-03 19:08:21 +0100 |
commit | ca6a57d5ea0e89fa8a6a55869cd91af5144fc367 (patch) | |
tree | 05daa1c4bde07a09f9cd867f018715b48cc7ba32 | |
parent | 0a8a852940d69bfa306da6e5744f616b8f8d8ee5 (diff) |
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 <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_display.c | 23 |
1 files 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)) |