drm/i915: Reduce breadcrumb lock coverage for intel_engine_enable_signaling()
Since intel_engine_enable_signaling() is now only called via fence_enable_sw_signaling(), we can rely on it to provide serialisation and run-once for us and so make ourselves slightly simpler. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: http://patchwork.freedesktop.org/patch/msgid/1469432687-22756-2-git-send-email-chris@chris-wilson.co.uk Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1469530913-17180-1-git-send-email-chris@chris-wilson.co.uk
This commit is contained in:
parent
d2b9448f96
commit
4a50d20e10
@ -480,19 +480,15 @@ void intel_engine_enable_signaling(struct drm_i915_gem_request *request)
|
|||||||
struct rb_node *parent, **p;
|
struct rb_node *parent, **p;
|
||||||
bool first, wakeup;
|
bool first, wakeup;
|
||||||
|
|
||||||
if (unlikely(READ_ONCE(request->signaling.wait.tsk)))
|
/* locked by fence_enable_sw_signaling() */
|
||||||
return;
|
assert_spin_locked(&request->lock);
|
||||||
|
|
||||||
spin_lock(&b->lock);
|
|
||||||
if (unlikely(request->signaling.wait.tsk)) {
|
|
||||||
wakeup = false;
|
|
||||||
goto unlock;
|
|
||||||
}
|
|
||||||
|
|
||||||
request->signaling.wait.tsk = b->signaler;
|
request->signaling.wait.tsk = b->signaler;
|
||||||
request->signaling.wait.seqno = request->fence.seqno;
|
request->signaling.wait.seqno = request->fence.seqno;
|
||||||
i915_gem_request_get(request);
|
i915_gem_request_get(request);
|
||||||
|
|
||||||
|
spin_lock(&b->lock);
|
||||||
|
|
||||||
/* First add ourselves into the list of waiters, but register our
|
/* First add ourselves into the list of waiters, but register our
|
||||||
* bottom-half as the signaller thread. As per usual, only the oldest
|
* bottom-half as the signaller thread. As per usual, only the oldest
|
||||||
* waiter (not just signaller) is tasked as the bottom-half waking
|
* waiter (not just signaller) is tasked as the bottom-half waking
|
||||||
@ -525,7 +521,6 @@ void intel_engine_enable_signaling(struct drm_i915_gem_request *request)
|
|||||||
if (first)
|
if (first)
|
||||||
smp_store_mb(b->first_signal, request);
|
smp_store_mb(b->first_signal, request);
|
||||||
|
|
||||||
unlock:
|
|
||||||
spin_unlock(&b->lock);
|
spin_unlock(&b->lock);
|
||||||
|
|
||||||
if (wakeup)
|
if (wakeup)
|
||||||
|
Loading…
Reference in New Issue
Block a user