diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-05-17 17:26:30 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-05-18 04:35:17 -0400 |
commit | 4e0d64dba816adf18c17488d38ede67a3d0e9b40 (patch) | |
tree | 76243fca2f9e23ab2f127f6d5aa1fc636c83f0b5 /drivers/gpu/drm/i915/i915_request.c | |
parent | c8af5274c3cbacb0905a26bcdef85901216e1134 (diff) |
drm/i915: Move request->ctx aside
In the next patch, we want to store the intel_context pointer inside
i915_request, as it is frequently access via a convoluted dance when
submitting the request to hw. Having two context pointers inside
i915_request leads to confusion so first rename the existing
i915_gem_context pointer to i915_request.gem_context.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180517212633.24934-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_request.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_request.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index 8928894dd9c7..fe8810a6a339 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c | |||
@@ -384,7 +384,7 @@ static void __retire_engine_request(struct intel_engine_cs *engine, | |||
384 | */ | 384 | */ |
385 | if (engine->last_retired_context) | 385 | if (engine->last_retired_context) |
386 | intel_context_unpin(engine->last_retired_context, engine); | 386 | intel_context_unpin(engine->last_retired_context, engine); |
387 | engine->last_retired_context = rq->ctx; | 387 | engine->last_retired_context = rq->gem_context; |
388 | } | 388 | } |
389 | 389 | ||
390 | static void __retire_engine_upto(struct intel_engine_cs *engine, | 390 | static void __retire_engine_upto(struct intel_engine_cs *engine, |
@@ -455,8 +455,8 @@ static void i915_request_retire(struct i915_request *request) | |||
455 | i915_request_remove_from_client(request); | 455 | i915_request_remove_from_client(request); |
456 | 456 | ||
457 | /* Retirement decays the ban score as it is a sign of ctx progress */ | 457 | /* Retirement decays the ban score as it is a sign of ctx progress */ |
458 | atomic_dec_if_positive(&request->ctx->ban_score); | 458 | atomic_dec_if_positive(&request->gem_context->ban_score); |
459 | intel_context_unpin(request->ctx, request->engine); | 459 | intel_context_unpin(request->gem_context, request->engine); |
460 | 460 | ||
461 | __retire_engine_upto(request->engine, request); | 461 | __retire_engine_upto(request->engine, request); |
462 | 462 | ||
@@ -760,7 +760,7 @@ i915_request_alloc(struct intel_engine_cs *engine, struct i915_gem_context *ctx) | |||
760 | INIT_LIST_HEAD(&rq->active_list); | 760 | INIT_LIST_HEAD(&rq->active_list); |
761 | rq->i915 = i915; | 761 | rq->i915 = i915; |
762 | rq->engine = engine; | 762 | rq->engine = engine; |
763 | rq->ctx = ctx; | 763 | rq->gem_context = ctx; |
764 | rq->ring = ring; | 764 | rq->ring = ring; |
765 | rq->timeline = ring->timeline; | 765 | rq->timeline = ring->timeline; |
766 | GEM_BUG_ON(rq->timeline == &engine->timeline); | 766 | GEM_BUG_ON(rq->timeline == &engine->timeline); |
@@ -814,7 +814,7 @@ i915_request_alloc(struct intel_engine_cs *engine, struct i915_gem_context *ctx) | |||
814 | goto err_unwind; | 814 | goto err_unwind; |
815 | 815 | ||
816 | /* Keep a second pin for the dual retirement along engine and ring */ | 816 | /* Keep a second pin for the dual retirement along engine and ring */ |
817 | __intel_context_pin(rq->ctx, engine); | 817 | __intel_context_pin(rq->gem_context, engine); |
818 | 818 | ||
819 | /* Check that we didn't interrupt ourselves with a new request */ | 819 | /* Check that we didn't interrupt ourselves with a new request */ |
820 | GEM_BUG_ON(rq->timeline->seqno != rq->fence.seqno); | 820 | GEM_BUG_ON(rq->timeline->seqno != rq->fence.seqno); |
@@ -1113,7 +1113,7 @@ void __i915_request_add(struct i915_request *request, bool flush_caches) | |||
1113 | local_bh_disable(); | 1113 | local_bh_disable(); |
1114 | rcu_read_lock(); /* RCU serialisation for set-wedged protection */ | 1114 | rcu_read_lock(); /* RCU serialisation for set-wedged protection */ |
1115 | if (engine->schedule) | 1115 | if (engine->schedule) |
1116 | engine->schedule(request, &request->ctx->sched); | 1116 | engine->schedule(request, &request->gem_context->sched); |
1117 | rcu_read_unlock(); | 1117 | rcu_read_unlock(); |
1118 | i915_sw_fence_commit(&request->submit); | 1118 | i915_sw_fence_commit(&request->submit); |
1119 | local_bh_enable(); /* Kick the execlists tasklet if just scheduled */ | 1119 | local_bh_enable(); /* Kick the execlists tasklet if just scheduled */ |