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@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2015-09-23 10:52:42 +01:00
parent 31d42ed563
commit f0fd4d500d
1 changed files with 18 additions and 1 deletions

View File

@ -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));