diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-14 10:40:39 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-14 10:40:39 +0100 |
commit | f5f3135e3cc1f4740508773cfefca0954aed2fd3 (patch) | |
tree | e13ec9ca2e85a7f2316602a34e3cb06f60bc2066 | |
parent | 020d84d2d09c71a8209dd774a0735a3c11cb148d (diff) |
sna: Ensure that the scanout is flushed before we sleep
So that we do not see any delayed rendering on i965+.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 10737573..963ff9ba 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3793,7 +3793,7 @@ static Bool sna_accel_do_expire(struct sna *sna) { return sna->kgem.need_expire; static void _sna_accel_disarm_timer(struct sna *sna, int id) { } #endif -static void sna_accel_flush(struct sna *sna) +static bool sna_accel_flush(struct sna *sna) { struct sna_pixmap *priv = sna_accel_scanout(sna); bool nothing_to_do = @@ -3802,13 +3802,12 @@ static void sna_accel_flush(struct sna *sna) DBG(("%s (time=%ld), nothing_to_do=%d\n", __FUNCTION__, (long)GetTimeInMillis(), nothing_to_do)); - if (nothing_to_do) { + if (nothing_to_do) _sna_accel_disarm_timer(sna, FLUSH_TIMER); - return; - } - - sna_pixmap_move_to_gpu(priv->pixmap); + else + sna_pixmap_move_to_gpu(priv->pixmap); kgem_bo_flush(&sna->kgem, priv->gpu_bo); + return !nothing_to_do; } static void sna_accel_expire(struct sna *sna) @@ -3955,8 +3954,8 @@ static void sna_accel_throttle(struct sna *sna) void sna_accel_block_handler(struct sna *sna) { if (sna_accel_do_flush(sna)) { - sna_accel_flush(sna); - sna_accel_throttle(sna); + if (sna_accel_flush(sna)) + sna_accel_throttle(sna); } if (sna_accel_do_expire(sna)) |