diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-04-30 09:15:01 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-04-30 11:01:13 -0400 |
commit | ab82a0635cdf0b91a134aaae34abd4e864595c5b (patch) | |
tree | c5efbac1f010e49c5d2a19f2d29be6be23dd7325 /drivers/gpu/drm/i915/i915_request.c | |
parent | 52d7f16e5543ca892ae2393a716083d209ce3b36 (diff) |
drm/i915: Wrap engine->context_pin() and engine->context_unpin()
Make life easier in upcoming patches by moving the context_pin and
context_unpin vfuncs into inline helpers.
v2: Fixup mock_engine to mark the context as pinned on use.
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/20180430131503.5375-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.c | 6 |
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 b1993d4a1a53..9358f2cf0c32 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c | |||
@@ -409,7 +409,7 @@ static void i915_request_retire(struct i915_request *request) | |||
409 | * the subsequent request. | 409 | * the subsequent request. |
410 | */ | 410 | */ |
411 | if (engine->last_retired_context) | 411 | if (engine->last_retired_context) |
412 | engine->context_unpin(engine, engine->last_retired_context); | 412 | intel_context_unpin(engine->last_retired_context, engine); |
413 | engine->last_retired_context = request->ctx; | 413 | engine->last_retired_context = request->ctx; |
414 | 414 | ||
415 | spin_lock_irq(&request->lock); | 415 | spin_lock_irq(&request->lock); |
@@ -638,7 +638,7 @@ i915_request_alloc(struct intel_engine_cs *engine, struct i915_gem_context *ctx) | |||
638 | * GGTT space, so do this first before we reserve a seqno for | 638 | * GGTT space, so do this first before we reserve a seqno for |
639 | * ourselves. | 639 | * ourselves. |
640 | */ | 640 | */ |
641 | ring = engine->context_pin(engine, ctx); | 641 | ring = intel_context_pin(ctx, engine); |
642 | if (IS_ERR(ring)) | 642 | if (IS_ERR(ring)) |
643 | return ERR_CAST(ring); | 643 | return ERR_CAST(ring); |
644 | GEM_BUG_ON(!ring); | 644 | GEM_BUG_ON(!ring); |
@@ -787,7 +787,7 @@ err_unwind: | |||
787 | err_unreserve: | 787 | err_unreserve: |
788 | unreserve_gt(i915); | 788 | unreserve_gt(i915); |
789 | err_unpin: | 789 | err_unpin: |
790 | engine->context_unpin(engine, ctx); | 790 | intel_context_unpin(ctx, engine); |
791 | return ERR_PTR(ret); | 791 | return ERR_PTR(ret); |
792 | } | 792 | } |
793 | 793 | ||