From 9115406b651eb11779f37c4b048d55188b9d6e02 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 30 Oct 2014 19:21:02 +0000 Subject: sna: Retire all requests when a bo is found to be not busy Signed-off-by: Chris Wilson --- src/sna/kgem.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/sna/kgem.h') diff --git a/src/sna/kgem.h b/src/sna/kgem.h index bea518f8..c77866f4 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -618,6 +618,7 @@ static inline bool kgem_bo_is_busy(struct kgem_bo *bo) return bo->rq; } +void __kgem_retire_requests_upto(struct kgem *kgem, struct kgem_request *rq); static inline bool __kgem_bo_is_busy(struct kgem *kgem, struct kgem_bo *bo) { DBG(("%s: handle=%d, domain: %d exec? %d, rq? %d\n", __FUNCTION__, @@ -627,8 +628,12 @@ static inline bool __kgem_bo_is_busy(struct kgem *kgem, struct kgem_bo *bo) if (bo->exec) return true; - if (bo->rq && !__kgem_busy(kgem, bo->handle)) - __kgem_bo_clear_busy(bo); + if (bo->rq && !__kgem_busy(kgem, bo->handle)) { + __kgem_retire_requests_upto(kgem, bo->rq); + assert(list_is_empty(&bo->request)); + assert(bo->rq == NULL); + assert(bo->domain == DOMAIN_NONE); + } return kgem_bo_is_busy(bo); } -- cgit v1.2.3