xf86-video-intel: src/sna/kgem.c src/sna/kgem.h src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Nov 4 02:31:13 PDT 2011


 src/sna/kgem.c      |    2 +-
 src/sna/kgem.h      |    1 +
 src/sna/sna_accel.c |    4 ++++
 3 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 7e8c9a5b8b1625fdfe885740c36da3f4c1373ee6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Nov 2 14:02:56 2011 +0000

    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 at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 046df15..abf7e82 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 a2258e1..0453ac5 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 bea7788..9e1f75f 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;
 }
 


More information about the xorg-commit mailing list