summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/selftests/mock_engine.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-05-18 00:26:33 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2018-05-18 11:35:28 +0300
commit867985d4a4319819a971645a262f3340f7d30343 (patch)
tree8bbbe810feb8fa2b2ddbd67a6fd7c67be87dd7b8 /drivers/gpu/drm/i915/selftests/mock_engine.c
parent1fc44d9b1afb0afe46acd99bdfdf793805a850e1 (diff)
downloadlinux-867985d4a4319819a971645a262f3340f7d30343.tar.xz
drm/i915: Pull the context->pin_count dec into the common intel_context_unpin
As all backends implement the same pin_count mechanism and do a dec-and-test as their first step, pull that into the common intel_context_unpin(). This also pulls into the caller, eliminating the indirect call in the usual steady state case. The intel_context_pin() side is a little more complicated as it combines the lookup/alloc as well as pinning the state, and so is left for a later date. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180517212633.24934-4-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/selftests/mock_engine.c')
-rw-r--r--drivers/gpu/drm/i915/selftests/mock_engine.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/selftests/mock_engine.c b/drivers/gpu/drm/i915/selftests/mock_engine.c
index 33eddfc1f8ce..f1ac7453053e 100644
--- a/drivers/gpu/drm/i915/selftests/mock_engine.c
+++ b/drivers/gpu/drm/i915/selftests/mock_engine.c
@@ -74,9 +74,6 @@ static void hw_delay_complete(struct timer_list *t)
static void mock_context_unpin(struct intel_context *ce)
{
- if (--ce->pin_count)
- return;
-
i915_gem_context_put(ce->gem_context);
}