diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-02 14:02:56 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-04 09:32:21 +0000 |
commit | 7e8c9a5b8b1625fdfe885740c36da3f4c1373ee6 (patch) | |
tree | 58e16c1a2655044be03b7d4d593409e25ccc9197 | |
parent | 5b21838471651a59d3e425c05a389c3f9196e21d (diff) |
sna: Submit the batch on the next blockhander if operation overflows
If an operation overflows from one batch into another, we submit the
complete batch and begin a new. That new batch will not be submitted
unless it is filled or on the next delayed flush update. This can cause
a flicker as a large operation is broken up, such as performing a
CopyArea through a Clipmask. So if we submit a full batch during a flush
interval, immediately flush any partial batch at the next blockhandler.
This stops rude Santa flashing Rudolf in xsnow!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 2 | ||||
-rw-r--r-- | src/sna/kgem.h | 1 | ||||
-rw-r--r-- | src/sna/sna_accel.c | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 046df150..abf7e82a 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1044,7 +1044,7 @@ void _kgem_submit(struct kgem *kgem) kgem_cleanup(kgem); kgem_reset(kgem); - kgem->busy = 1; + kgem->flush_now = kgem->busy = 1; } void kgem_throttle(struct kgem *kgem) diff --git a/src/sna/kgem.h b/src/sna/kgem.h index a2258e18..0453ac51 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -113,6 +113,7 @@ struct kgem { uint32_t need_expire:1; uint32_t need_purge:1; uint32_t need_retire:1; + uint32_t flush_now:1; uint32_t busy:1; uint32_t has_vmap :1; diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index bea77887..9e1f75fe 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -8036,6 +8036,9 @@ static Bool sna_accel_do_flush(struct sna *sna) struct itimerspec to; struct sna_pixmap *priv; + if (sna->kgem.flush_now) + return TRUE; + return_if_timer_active(FLUSH_TIMER); priv = sna_accel_scanout(sna); @@ -8132,6 +8135,7 @@ static bool sna_accel_flush(struct sna *sna) sna_pixmap_move_to_gpu(priv->pixmap); sna->kgem.busy = !nothing_to_do; kgem_bo_flush(&sna->kgem, priv->gpu_bo); + sna->kgem.flush_now = 0; return !nothing_to_do; } |