[Intel-gfx] [PATCH 6/8] drm/i915/guc: Keep the engine awake until the tasklet is idle

Chris Wilson chris at chris-wilson.co.uk
Mon Aug 12 09:10:43 UTC 2019


For the guc, we need to keep the engine awake (and not parked) and not
just the gt. If we let the engine park, we disable the irq and stop
processing the tasklet, leaving state outstanding inside the tasklet.

The downside is, of course, we now have to wait until the tasklet is run
before we consider the engine idle.

Reported-by: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
index 5bf838223cf9..52edfe8d1c60 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -534,9 +534,10 @@ static inline int rq_prio(const struct i915_request *rq)
 
 static struct i915_request *schedule_in(struct i915_request *rq, int idx)
 {
+	GEM_BUG_ON(!intel_engine_pm_is_awake(rq->engine));
 	trace_i915_request_in(rq, idx);
 
-	intel_gt_pm_get(rq->engine->gt);
+	intel_engine_pm_get(rq->engine);
 	return i915_request_get(rq);
 }
 
@@ -544,7 +545,7 @@ static void schedule_out(struct i915_request *rq)
 {
 	trace_i915_request_out(rq);
 
-	intel_gt_pm_put(rq->engine->gt);
+	intel_engine_pm_put(rq->engine);
 	i915_request_put(rq);
 }
 
@@ -610,8 +611,6 @@ static void guc_submission_tasklet(unsigned long data)
 	struct i915_request **port, *rq;
 	unsigned long flags;
 
-	spin_lock_irqsave(&engine->active.lock, flags);
-
 	for (port = execlists->inflight; (rq = *port); port++) {
 		if (!i915_request_completed(rq))
 			break;
@@ -624,8 +623,8 @@ static void guc_submission_tasklet(unsigned long data)
 		memmove(execlists->inflight, port, rem * sizeof(*port));
 	}
 
+	spin_lock_irqsave(&engine->active.lock, flags);
 	__guc_dequeue(engine);
-
 	spin_unlock_irqrestore(&engine->active.lock, flags);
 }
 
-- 
2.23.0.rc1



More information about the Intel-gfx mailing list