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

Chris Wilson ickle at kemper.freedesktop.org
Mon Dec 10 08:24:38 PST 2012


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

New commits:
commit 8c3b82f207bc8cf697646d3324cb4103da3b7856
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Dec 10 16:20:52 2012 +0000

    sna: Avoid reusing the same 'busy' bit for two different meanings.
    
    Oops, I thought the 'busy' bit was now used and apparently forgot it is
    used to control the periodic flushing...
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index eef2f56..a730e96 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1254,7 +1254,6 @@ static void kgem_add_bo(struct kgem *kgem, struct kgem_bo *bo)
 
 	/* XXX is it worth working around gcc here? */
 	kgem->flush |= bo->flush;
-	kgem->busy |= bo->scanout;
 }
 
 static uint32_t kgem_end_batch(struct kgem *kgem)
@@ -1943,6 +1942,8 @@ static void kgem_commit(struct kgem *kgem)
 			bo->rq = NULL;
 			bo->exec = NULL;
 		}
+
+		kgem->scanout_busy |= bo->scanout;
 	}
 
 	if (rq == &_kgem_static_request) {
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 21398bf..212b94e 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -155,6 +155,7 @@ struct kgem {
 	uint32_t need_purge:1;
 	uint32_t need_retire:1;
 	uint32_t need_throttle:1;
+	uint32_t scanout_busy:1;
 	uint32_t busy:1;
 
 	uint32_t has_userptr :1;
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 43ed159..d2f132c 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -14380,7 +14380,8 @@ void sna_accel_block_handler(struct sna *sna, struct timeval **tv)
 		UpdateCurrentTimeIf();
 
 	if (sna->kgem.nbatch &&
-	    (sna->kgem.busy || kgem_ring_is_idle(&sna->kgem, sna->kgem.ring))) {
+	    (sna->kgem.scanout_busy ||
+	     kgem_ring_is_idle(&sna->kgem, sna->kgem.ring))) {
 		DBG(("%s: GPU idle, flushing\n", __FUNCTION__));
 		_kgem_submit(&sna->kgem);
 	}
@@ -14433,7 +14434,7 @@ set_tv:
 		}
 	}
 
-	sna->kgem.busy = false;
+	sna->kgem.scanout_busy = false;
 }
 
 void sna_accel_wakeup_handler(struct sna *sna)


More information about the xorg-commit mailing list