Commit e3be4079 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Only signal from interrupt when requested

Avoid calling dma_fence_signal() from inside the interrupt if we haven't
enabled signaling on the request.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180627201304.15817-4-chris@chris-wilson.co.uk
parent 78796877
...@@ -1182,7 +1182,8 @@ static void notify_ring(struct intel_engine_cs *engine) ...@@ -1182,7 +1182,8 @@ static void notify_ring(struct intel_engine_cs *engine)
if (i915_seqno_passed(seqno, wait->seqno)) { if (i915_seqno_passed(seqno, wait->seqno)) {
struct i915_request *waiter = wait->request; struct i915_request *waiter = wait->request;
if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, if (waiter &&
!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
&waiter->fence.flags) && &waiter->fence.flags) &&
intel_wait_check_request(wait, waiter)) intel_wait_check_request(wait, waiter))
rq = i915_request_get(waiter); rq = i915_request_get(waiter);
...@@ -1205,8 +1206,11 @@ static void notify_ring(struct intel_engine_cs *engine) ...@@ -1205,8 +1206,11 @@ static void notify_ring(struct intel_engine_cs *engine)
spin_unlock(&engine->breadcrumbs.irq_lock); spin_unlock(&engine->breadcrumbs.irq_lock);
if (rq) { if (rq) {
dma_fence_signal(&rq->fence); spin_lock(&rq->lock);
dma_fence_signal_locked(&rq->fence);
GEM_BUG_ON(!i915_request_completed(rq)); GEM_BUG_ON(!i915_request_completed(rq));
spin_unlock(&rq->lock);
i915_request_put(rq); i915_request_put(rq);
} }
......
...@@ -1285,7 +1285,7 @@ long i915_request_wait(struct i915_request *rq, ...@@ -1285,7 +1285,7 @@ long i915_request_wait(struct i915_request *rq,
if (flags & I915_WAIT_LOCKED) if (flags & I915_WAIT_LOCKED)
add_wait_queue(errq, &reset); add_wait_queue(errq, &reset);
intel_wait_init(&wait, rq); intel_wait_init(&wait);
restart: restart:
do { do {
......
...@@ -928,11 +928,10 @@ static inline u32 intel_hws_preempt_done_address(struct intel_engine_cs *engine) ...@@ -928,11 +928,10 @@ static inline u32 intel_hws_preempt_done_address(struct intel_engine_cs *engine)
/* intel_breadcrumbs.c -- user interrupt bottom-half for waiters */ /* intel_breadcrumbs.c -- user interrupt bottom-half for waiters */
int intel_engine_init_breadcrumbs(struct intel_engine_cs *engine); int intel_engine_init_breadcrumbs(struct intel_engine_cs *engine);
static inline void intel_wait_init(struct intel_wait *wait, static inline void intel_wait_init(struct intel_wait *wait)
struct i915_request *rq)
{ {
wait->tsk = current; wait->tsk = current;
wait->request = rq; wait->request = NULL;
} }
static inline void intel_wait_init_for_seqno(struct intel_wait *wait, u32 seqno) static inline void intel_wait_init_for_seqno(struct intel_wait *wait, u32 seqno)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment