All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 07/10] drm/i915: Rearrange gen8_cs_irq_handler
Date: Mon, 14 May 2018 10:37:07 +0100	[thread overview]
Message-ID: <20180514093710.7730-8-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20180514093710.7730-1-chris@chris-wilson.co.uk>

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@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_irq.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index e1b3a7575fe7..034c603867e6 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1459,31 +1459,21 @@ static void snb_gt_irq_handler(struct drm_i915_private *dev_priv,
 		ivybridge_parity_error_irq_handler(dev_priv, gt_iir);
 }
 
-static void
-gen8_cs_irq_handler(struct intel_engine_cs *engine, u32 iir)
+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 (engine && test_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted))
 		i915_tasklet(&execlists->tasklet);
 }
 
-- 
2.17.0

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

  parent reply	other threads:[~2018-05-14  9:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14  9:37 Direct execlists submission Chris Wilson
2018-05-14  9:37 ` [PATCH 01/10] drm/i915: Mark up nested spinlocks Chris Wilson
2018-05-14 10:06   ` Tvrtko Ursulin
2018-05-14  9:37 ` [PATCH 02/10] drm/i915: Remove tasklet flush before disable Chris Wilson
2018-05-14  9:37 ` [PATCH 03/10] drm/i915: Wrap tasklet_struct for abuse Chris Wilson
2018-05-14  9:37 ` [PATCH 04/10] drm/i915: Only sync tasklets once for recursive reset preparation Chris Wilson
2018-05-14  9:37 ` [PATCH 05/10] drm/i915/execlists: Direct submit onto idle engines Chris Wilson
2018-05-14  9:37 ` [PATCH 06/10] drm/i915/execlists: Direct submission from irq handler Chris Wilson
2018-05-14  9:37 ` Chris Wilson [this message]
2018-05-14  9:37 ` [PATCH 08/10] drm/i915: Remove USES_GUC_SUBMISSION() pointer chasing from gen8_cs_irq_handler Chris Wilson
2018-05-14 10:27   ` Tvrtko Ursulin
2018-05-14 11:45     ` Chris Wilson
2018-05-14  9:37 ` [PATCH 09/10] drm/i915: Speed up idle detection by kicking the tasklets Chris Wilson
2018-05-14  9:37 ` [PATCH 10/10] drm/i915: Detect if we missed kicking the execlists tasklet Chris Wilson
2018-05-14  9:42 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/10] drm/i915: Mark up nested spinlocks Patchwork
2018-05-14  9:45 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-05-14  9:59 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-14 10:11 ` Direct execlists submission Tvrtko Ursulin
2018-05-14 10:25   ` Chris Wilson
2018-05-14 14:54     ` Chris Wilson
2018-05-14 12:45 ` ✓ Fi.CI.IGT: success for series starting with [01/10] drm/i915: Mark up nested spinlocks Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180514093710.7730-8-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.