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

Chris Wilson ickle at kemper.freedesktop.org
Wed Sep 23 02:54:32 PDT 2015


 src/sna/kgem.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

New commits:
commit f0fd4d500de03c30c7ce19915f85acadd1ca4e5d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Sep 23 10:52:42 2015 +0100

    sna: Explicitly retire any buffers underneath the static_request
    
    If we are forced to use the static_request (reserved for allocation
    failure), we dispatch the execbuffer synchronously and expect no buffers
    to be present afterwards. Rather than just assert that this is so, we
    should clean up the buffer list!
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index ed1ec58..b975bfc 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3091,7 +3091,6 @@ static bool __kgem_retire_rq(struct kgem *kgem, struct kgem_request *rq)
 		}
 
 		bo->domain = DOMAIN_NONE;
-		bo->gtt_dirty = false;
 		bo->rq = NULL;
 		if (bo->refcnt)
 			continue;
@@ -3335,6 +3334,7 @@ static void kgem_commit(struct kgem *kgem)
 		bo->binding.offset = 0;
 		bo->domain = DOMAIN_GPU;
 		bo->gpu_dirty = false;
+		bo->gtt_dirty = false;
 
 		if (bo->proxy) {
 			/* proxies are not used for domain tracking */
@@ -3358,6 +3358,23 @@ static void kgem_commit(struct kgem *kgem)
 			kgem_throttle(kgem);
 		}
 
+		while (!list_is_empty(&rq->buffers)) {
+			bo = list_first_entry(&rq->buffers,
+					      struct kgem_bo,
+					      request);
+
+			assert(RQ(bo->rq) == rq);
+			assert(bo->exec == NULL);
+			assert(bo->domain == DOMAIN_GPU);
+
+			list_del(&bo->request);
+			bo->domain = DOMAIN_NONE;
+			bo->rq = NULL;
+
+			if (bo->refcnt == 0)
+				_kgem_bo_destroy(kgem, bo);
+		}
+
 		kgem_retire(kgem);
 		assert(list_is_empty(&rq->buffers));
 


More information about the xorg-commit mailing list