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

Chris Wilson ickle at kemper.freedesktop.org
Thu Mar 14 03:36:14 PDT 2013


 src/sna/kgem.c        |   10 ++++++----
 src/sna/sna_accel.c   |    2 ++
 src/sna/sna_display.c |    1 +
 3 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 92023f39a9c8897e5a978f44b7970773b118f628
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Mar 14 09:42:37 2013 +0000

    sna: Add a few more assertions to track userptr through the caches
    
    i.e. make sure they don't end up in any caches.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 8d3e9df..538231f 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1514,6 +1514,7 @@ inline static void kgem_bo_move_to_inactive(struct kgem *kgem,
 	assert(!bo->proxy);
 	assert(!bo->io);
 	assert(!bo->scanout);
+	assert(!bo->snoop);
 	assert(!bo->needs_flush);
 	assert(list_is_empty(&bo->vma));
 	ASSERT_IDLE(kgem, bo->handle);
@@ -1647,6 +1648,9 @@ static void kgem_bo_move_to_scanout(struct kgem *kgem, struct kgem_bo *bo)
 
 static void kgem_bo_move_to_snoop(struct kgem *kgem, struct kgem_bo *bo)
 {
+	assert(bo->reusable);
+	assert(!bo->flush);
+	assert(!bo->needs_flush);
 	assert(bo->refcnt == 0);
 	assert(bo->exec == NULL);
 
@@ -1738,14 +1742,12 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
 
 	if (bo->snoop && !bo->flush) {
 		DBG(("%s: handle=%d is snooped\n", __FUNCTION__, bo->handle));
-		assert(!bo->flush);
+		assert(bo->reusable);
 		assert(list_is_empty(&bo->list));
 		if (bo->exec == NULL && bo->rq && !__kgem_busy(kgem, bo->handle))
 			__kgem_bo_clear_busy(bo);
-		if (bo->rq == NULL) {
-			assert(!bo->needs_flush);
+		if (bo->rq == NULL)
 			kgem_bo_move_to_snoop(kgem, bo);
-		}
 		return;
 	}
 
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index ead4692..ea7dc7a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4463,6 +4463,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
 							    box, n, COPY_LAST);
 
 				kgem_bo_sync__cpu(&sna->kgem, src_bo);
+				assert(src_bo->rq == NULL);
 				kgem_bo_destroy(&sna->kgem, src_bo);
 			}
 
@@ -13534,6 +13535,7 @@ sna_get_image_blt(DrawablePtr drawable,
 					    COPY_LAST);
 
 		kgem_bo_sync__cpu(&sna->kgem, dst_bo);
+		assert(dst_bo->rq == NULL);
 		kgem_bo_destroy(&sna->kgem, dst_bo);
 	}
 
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5d14af7..a80a3c1 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -136,6 +136,7 @@ static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,
 
 	assert(bo->refcnt);
 	assert(bo->proxy == NULL);
+	assert(!bo->snoop);
 	if (bo->delta) {
 		DBG(("%s: reusing fb=%d for handle=%d\n",
 		     __FUNCTION__, bo->delta, bo->handle));


More information about the xorg-commit mailing list