summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-10-01 20:11:47 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-01 20:39:09 +0100
commitdc1ec0dd1a5f66114ee4249309d3a283ad84d584 (patch)
treee47c1d730c82d8b91b0fa764c146f87aa11594e4
parentc6acf1325833b8679ef09ab74f0cb0fd82a8cd92 (diff)
sna/accel: Only disable the flush migitration if nothing changed
Previously we ignored updating the scanout in place, and so we were not amoritizing the shadow cost of common core rendering operations. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index e8370507..683bd1b2 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3428,14 +3428,19 @@ static void _sna_accel_disarm_timer(struct sna *sna, int id) { }
static void sna_accel_flush(struct sna *sna)
{
struct sna_pixmap *priv = sna_accel_scanout(sna);
+ bool nothing_to_do =
+ priv->cpu_damage == NULL && priv->gpu_bo->rq == NULL;
- DBG(("%s (time=%ld)\n", __FUNCTION__, (long)GetTimeInMillis()));
+ DBG(("%s (time=%ld), nothing_to_do=%d\n",
+ __FUNCTION__, (long)GetTimeInMillis(), nothing_to_do));
+
+ if (nothing_to_do) {
+ _sna_accel_disarm_timer(sna, FLUSH_TIMER);
+ return;
+ }
sna_pixmap_move_to_gpu(priv->pixmap);
kgem_bo_flush(&sna->kgem, priv->gpu_bo);
-
- if (priv->gpu_bo->rq == NULL)
- _sna_accel_disarm_timer(sna, FLUSH_TIMER);
}
static void sna_accel_expire(struct sna *sna)