[PATCH] drm/i915: avoid false fence signaling when enabling preemption

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In i915_request_wait(), it adds a local intel_wait variable into rb tree
of waiters. However, when the corresponding request is preempted, the
seqno of this wait will not be updated, which will lead to a false
signaling to the request and cause the i915_request_wait() to return
early before the request is really completed.

In this patch, we check if the seqno in wait is same as the request
before we signal the fence, and thus fix the above issue.

Signed-off-by: Min He <min.he@xxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 828f310..1ef961d 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1121,7 +1121,7 @@ static void notify_ring(struct intel_engine_cs *engine)
 	}
 	spin_unlock(&engine->breadcrumbs.irq_lock);
 
-	if (rq) {
+	if (rq && intel_wait_check_request(wait, rq)) {
 		dma_fence_signal(&rq->fence);
 		GEM_BUG_ON(!i915_request_completed(rq));
 		i915_request_put(rq);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux