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 af36a4ab78
"sna: Defer submission of the next shadow frame until halfway through").
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
0a8a852940
commit
ca6a57d5ea
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue