diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-11-08 20:14:50 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-11-08 20:14:50 +0000 |
commit | 54b3adc23fbfdc5f6983bca2bcd01de2404911cf (patch) | |
tree | 3a12f6f627b3ee19f70d036a1bc73170d0625389 /src/sna | |
parent | 7fc15ec3975e3a99a6bbb869c07172cdee6e5f63 (diff) |
sna: Simply retire-requests
Since we have the ring member available in the request structure, let's
use it directly rather than attempt a more fragile method of recomputing
it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/kgem.c | 8 | ||||
-rw-r--r-- | src/sna/kgem.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index b80fde73..ac4da4b8 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -3275,18 +3275,18 @@ bool __kgem_ring_is_idle(struct kgem *kgem, int ring) bool __kgem_retire_requests_upto(struct kgem *kgem, struct kgem_bo *bo) { - struct kgem_request *rq = bo->rq, *tmp; - struct list *requests = &kgem->requests[RQ_RING(rq) == KGEM_BLT]; + struct kgem_request * const rq = RQ(bo->rq), *tmp; + struct list *requests = &kgem->requests[rq->ring]; - DBG(("%s(handle=%d)\n", __FUNCTION__, bo->handle)); + DBG(("%s(handle=%d, ring=%d)\n", __FUNCTION__, bo->handle, rq->ring)); - rq = RQ(rq); assert(rq != &kgem->static_request); if (rq == (struct kgem_request *)kgem) { __kgem_bo_clear_busy(bo); return false; } + assert(rq->ring < ARRAY_SIZE(kgem->requests)); do { tmp = list_first_entry(requests, struct kgem_request, list); assert(tmp->ring == rq->ring); diff --git a/src/sna/kgem.h b/src/sna/kgem.h index 9e6db0f2..6cf877cf 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -104,7 +104,7 @@ struct kgem_request { struct list list; struct kgem_bo *bo; struct list buffers; - int ring; + unsigned ring; }; enum { |