aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_request.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_request.c')
-rw-r--r--drivers/gpu/drm/i915/i915_request.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 09ed48833b54..a492385b2089 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -732,13 +732,13 @@ i915_request_alloc(struct intel_engine_cs *engine, struct i915_gem_context *ctx)
732 rq = kmem_cache_alloc(i915->requests, 732 rq = kmem_cache_alloc(i915->requests,
733 GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN); 733 GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
734 if (unlikely(!rq)) { 734 if (unlikely(!rq)) {
735 i915_retire_requests(i915);
736
735 /* Ratelimit ourselves to prevent oom from malicious clients */ 737 /* Ratelimit ourselves to prevent oom from malicious clients */
736 ret = i915_gem_wait_for_idle(i915, 738 rq = i915_gem_active_raw(&ce->ring->timeline->last_request,
737 I915_WAIT_LOCKED | 739 &i915->drm.struct_mutex);
738 I915_WAIT_INTERRUPTIBLE, 740 if (rq)
739 MAX_SCHEDULE_TIMEOUT); 741 cond_synchronize_rcu(rq->rcustate);
740 if (ret)
741 goto err_unreserve;
742 742
743 /* 743 /*
744 * We've forced the client to stall and catch up with whatever 744 * We've forced the client to stall and catch up with whatever
@@ -758,6 +758,8 @@ i915_request_alloc(struct intel_engine_cs *engine, struct i915_gem_context *ctx)
758 } 758 }
759 } 759 }
760 760
761 rq->rcustate = get_state_synchronize_rcu();
762
761 INIT_LIST_HEAD(&rq->active_list); 763 INIT_LIST_HEAD(&rq->active_list);
762 rq->i915 = i915; 764 rq->i915 = i915;
763 rq->engine = engine; 765 rq->engine = engine;