aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_request.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-05-03 15:51:15 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2018-05-04 02:26:56 -0400
commit7c572e1bdf8dea0c84ce8da01a84cdaa26d8e138 (patch)
tree56154468d357d3dd7fcaba0478ca50db613c68a1 /drivers/gpu/drm/i915/i915_request.c
parent3365e2268b6bc3d9fa6550f2deaf1b6a537f8732 (diff)
drm/i915: Keep one request in our ring_list
Don't pre-emptively retire the oldest request in our ring's list if it is the only request. We keep various bits of state alive using the active reference from the request and would rather transfer that state over to a new request rather than the more involved process of retiring and reacquiring it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180503195115.22309-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_request.c')
-rw-r--r--drivers/gpu/drm/i915/i915_request.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 63bb61089be5..d68739b94dac 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -695,9 +695,9 @@ i915_request_alloc(struct intel_engine_cs *engine, struct i915_gem_context *ctx)
695 goto err_unreserve; 695 goto err_unreserve;
696 696
697 /* Move our oldest request to the slab-cache (if not in use!) */ 697 /* Move our oldest request to the slab-cache (if not in use!) */
698 rq = list_first_entry_or_null(&ring->request_list, 698 rq = list_first_entry(&ring->request_list, typeof(*rq), ring_link);
699 typeof(*rq), ring_link); 699 if (!list_is_last(&rq->ring_link, &ring->request_list) &&
700 if (rq && i915_request_completed(rq)) 700 i915_request_completed(rq))
701 i915_request_retire(rq); 701 i915_request_retire(rq);
702 702
703 /* 703 /*