From d26036d40e77e8f40c8d08659f95a8a5dfac07ed Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 29 Oct 2013 16:20:14 +0000 Subject: [PATCH] sna: Always run the retire_buffers during ring_idle As we know that we had a request to retire, we know that we may make progress retiring active buffers. Signed-off-by: Chris Wilson --- src/sna/kgem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 875dc53..99a4cf9 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -2178,7 +2178,7 @@ static bool __kgem_retire_rq(struct kgem *kgem, struct kgem_request *rq) DBG(("%s: moving %d to flushing\n", __FUNCTION__, bo->handle)); list_add(&bo->request, &kgem->flushing); - bo->rq = (void *)kgem; + bo->rq = MAKE_REQUEST(kgem, RQ_RING(bo->rq)); continue; } @@ -2310,8 +2310,8 @@ bool __kgem_ring_is_idle(struct kgem *kgem, int ring) DBG(("%s: ring=%d idle (handle=%d)\n", __FUNCTION__, ring, rq->bo->handle)); - if (kgem_retire__requests_ring(kgem, ring)) - kgem_retire__buffers(kgem); + kgem_retire__requests_ring(kgem, ring); + kgem_retire__buffers(kgem); assert(list_is_empty(&kgem->requests[ring])); return true; @@ -2435,6 +2435,7 @@ static void kgem_finish_buffers(struct kgem *kgem) (kgem->has_llc || bo->mmapped == MMAPPED_GTT || bo->base.snoop)) { DBG(("%s: retaining upload buffer (%d/%d)\n", __FUNCTION__, bo->used, bytes(&bo->base))); + assert(bo->base.rq); assert(used >= bo->used); bo->used = used; list_move(&bo->base.list, -- 2.7.4