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

Chris Wilson ickle at kemper.freedesktop.org
Wed Sep 25 04:07:38 PDT 2013


 src/sna/kgem.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit a934b2455a7b67d124903ab086a323169f0b4d69
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Sep 25 12:06:56 2013 +0100

    sna: Add a few more asserts around tracking of bo->exec vs bo->request
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index d46f967..336bd7d 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1777,8 +1777,10 @@ inline static void kgem_bo_remove_from_active(struct kgem *kgem,
 
 	list_del(&bo->list);
 	assert(bo->rq != NULL);
-	if (bo->rq == (void *)kgem)
+	if (bo->rq == (void *)kgem) {
+		assert(bo->exec == NULL);
 		list_del(&bo->request);
+	}
 	assert(list_is_empty(&bo->vma));
 }
 
@@ -1940,6 +1942,10 @@ void kgem_bo_undo(struct kgem *kgem, struct kgem_bo *bo)
 	bo->refcnt++;
 	kgem_reset(kgem);
 	bo->refcnt--;
+
+	assert(kgem->nreloc == 0);
+	assert(kgem->nexec == 0);
+	assert(bo->exec == NULL);
 }
 
 static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
@@ -2172,6 +2178,7 @@ static bool __kgem_retire_rq(struct kgem *kgem, struct kgem_request *rq)
 	}
 
 	assert(rq->bo->rq == NULL);
+	assert(rq->bo->exec == NULL);
 	assert(list_is_empty(&rq->bo->request));
 
 	if (--rq->bo->refcnt == 0) {
@@ -3288,8 +3295,10 @@ retry_large:
 				goto discard;
 
 			list_del(&bo->list);
-			if (bo->rq == (void *)kgem)
+			if (bo->rq == (void *)kgem) {
+				assert(bo->exec == NULL);
 				list_del(&bo->request);
+			}
 
 			bo->delta = 0;
 			assert_tiling(kgem, bo);
@@ -3851,6 +3860,7 @@ __kgem_bo_create_as_display(struct kgem *kgem, int size, int tiling, int pitch)
 	bo->domain = DOMAIN_NONE;
 
 	if (__kgem_busy(kgem, bo->handle)) {
+		assert(bo->exec == NULL);
 		list_add(&bo->request, &kgem->flushing);
 		bo->rq = (void *)kgem;
 	}
@@ -4063,6 +4073,7 @@ large_inactive:
 				assert(!bo->scanout);
 				assert(for_cpu ? bo->map__cpu : bo->map__gtt);
 				assert(bo->rq == NULL);
+				assert(bo->exec == NULL);
 				assert(list_is_empty(&bo->request));
 				assert(bo->flush == false);
 				assert_tiling(kgem, bo);


More information about the xorg-commit mailing list