diff options
author | Chris Wilson | 2018-05-17 23:26:33 +0200 |
---|---|---|
committer | Chris Wilson | 2018-05-18 10:35:28 +0200 |
commit | 867985d4a4319819a971645a262f3340f7d30343 (patch) | |
tree | 8bbbe810feb8fa2b2ddbd67a6fd7c67be87dd7b8 /drivers/gpu/drm/i915/intel_ringbuffer.c | |
parent | drm/i915: Store a pointer to intel_context in i915_request (diff) | |
download | kernel-qcow2-linux-867985d4a4319819a971645a262f3340f7d30343.tar.gz kernel-qcow2-linux-867985d4a4319819a971645a262f3340f7d30343.tar.xz kernel-qcow2-linux-867985d4a4319819a971645a262f3340f7d30343.zip |
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/intel_ringbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 0c0c9f531e4e..001cf6bcb349 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -1195,12 +1195,6 @@ static void intel_ring_context_destroy(struct intel_context *ce) static void intel_ring_context_unpin(struct intel_context *ce) { - lockdep_assert_held(&ce->gem_context->i915->drm.struct_mutex); - GEM_BUG_ON(ce->pin_count == 0); - - if (--ce->pin_count) - return; - if (ce->state) { ce->state->obj->pin_global--; i915_vma_unpin(ce->state); |