summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-12 11:22:06 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-12 12:23:34 +0000
commit2a22990968aebd53a7bfeaf19e58ee609b980e5f (patch)
tree7815941e75ee21f8ff8cee0bc065b9755519c99c
parent1c0e9916caef6594511009c8cb79071ac0d82090 (diff)
sna: Prevent 60Hz wakeups if the client stops in mid-render
Only continue to wake up if the scanout remains active. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b3bea6af..7c620594 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -9757,20 +9757,26 @@ static void _sna_accel_disarm_timer(struct sna *sna, int id) { }
static bool sna_accel_flush(struct sna *sna)
{
struct sna_pixmap *priv = sna_accel_scanout(sna);
- bool nothing_to_do = priv->cpu_damage == NULL && sna->kgem.nbatch == 0;
bool need_throttle = priv->gpu_bo->rq;
+ bool busy = priv->cpu_damage || need_throttle;
- DBG(("%s (time=%ld), nothing_to_do=%d, busy? %d\n",
+ DBG(("%s (time=%ld), cpu damage? %p, exec? %d nbatch=%d, busy? %d, need_throttle=%d\n",
__FUNCTION__, (long)GetTimeInMillis(),
- nothing_to_do, sna->kgem.busy));
+ priv->cpu_damage,
+ priv->gpu_bo->exec != NULL,
+ sna->kgem.nbatch,
+ sna->kgem.busy, need_throttle));
- if (nothing_to_do && !sna->kgem.busy)
+ if (!sna->kgem.busy && !busy)
_sna_accel_disarm_timer(sna, FLUSH_TIMER);
+ sna->kgem.busy = busy;
+
if (priv->cpu_damage)
sna_pixmap_move_to_gpu(priv->pixmap, MOVE_READ);
- sna->kgem.busy = !nothing_to_do;
+
kgem_bo_flush(&sna->kgem, priv->gpu_bo);
sna->kgem.flush_now = 0;
+
return need_throttle;
}