[PATCH 06/77] drm/i915: Rearrange gen8_cs_irq_handler

Chris Wilson chris at chris-wilson.co.uk
Thu May 10 13:22:13 UTC 2018


After using direct submission from the irq handler, it is very likely
that the ENGINE_IRQ_EXECLISTS bit is unset and so we do not need to
test it first. It also follows that we then want to do a direct
submission evertime the irq_posted bit is set, and can use that as our
boolean rather than a separate local.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_irq.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index e1b3a7575fe7..570dec996aa7 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1463,27 +1463,18 @@ static void
 gen8_cs_irq_handler(struct intel_engine_cs *engine, u32 iir)
 {
 	struct intel_engine_execlists * const execlists = &engine->execlists;
-	bool tasklet = false;
 
 	if (iir & GT_CONTEXT_SWITCH_INTERRUPT && READ_ONCE(execlists->active))
-		tasklet = !test_and_set_bit(ENGINE_IRQ_EXECLIST,
-					    &engine->irq_posted);
+		set_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted);
 
 	if (iir & GT_RENDER_USER_INTERRUPT) {
+		if (USES_GUC_SUBMISSION(engine->i915))
+			set_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted);
+
 		notify_ring(engine);
-		/*
-		 * notify_ring() may trigger direct submission onto this
-		 * engine, clearing the ENGINE_IRQ_EXECLIST bit. In that
-		 * case, we don't want to resubmit and so clear the tasklet
-		 * boolean. GuC never sets the ENGINE_IRQ_EXECLIST bit and
-		 * so when using the GuC this equates to an unconditional
-		 * setting of tasklet to true.
-		 */
-		if (!test_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted))
-			tasklet = USES_GUC_SUBMISSION(engine->i915);
 	}
 
-	if (tasklet)
+	if (test_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted))
 		i915_tasklet(&execlists->tasklet);
 }
 
-- 
2.17.0



More information about the Intel-gfx-trybot mailing list