All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 5/5] drm/i915/guc: enable only the user interrupt when using GuC submission
Date: Tue,  5 Jan 2021 15:19:47 -0800	[thread overview]
Message-ID: <20210105231947.31235-6-daniele.ceraolospurio@intel.com> (raw)
In-Reply-To: <20210105231947.31235-1-daniele.ceraolospurio@intel.com>

In GuC submission mode the CS is owned by the GuC FW, so all CS status
interrupts are handled by it. We only need the user interrupt as that
signals request completion.

Since we're now starting the engines directly in GuC submission mode
when selected, we can stop switching back and forth between the
execlists and the GuC programming and select directly the correct
interrupt mask.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: John Harrison <john.c.harrison@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_irq.c        | 18 ++++++-----
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 31 -------------------
 2 files changed, 11 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_irq.c b/drivers/gpu/drm/i915/gt/intel_gt_irq.c
index 9830342aa6f4..7b2b8cb2d2be 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_irq.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_irq.c
@@ -237,14 +237,18 @@ void gen11_gt_irq_reset(struct intel_gt *gt)
 
 void gen11_gt_irq_postinstall(struct intel_gt *gt)
 {
-	const u32 irqs =
-		GT_CS_MASTER_ERROR_INTERRUPT |
-		GT_RENDER_USER_INTERRUPT |
-		GT_CONTEXT_SWITCH_INTERRUPT |
-		GT_WAIT_SEMAPHORE_INTERRUPT;
 	struct intel_uncore *uncore = gt->uncore;
-	const u32 dmask = irqs << 16 | irqs;
-	const u32 smask = irqs << 16;
+	u32 irqs = GT_RENDER_USER_INTERRUPT;
+	u32 dmask;
+	u32 smask;
+
+	if (!intel_uc_wants_guc_submission(&gt->uc))
+		irqs |= GT_CS_MASTER_ERROR_INTERRUPT |
+			GT_CONTEXT_SWITCH_INTERRUPT |
+			GT_WAIT_SEMAPHORE_INTERRUPT;
+
+	dmask = irqs << 16 | irqs;
+	smask = irqs << 16;
 
 	BUILD_BUG_ON(irqs & 0xffff0000);
 
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 3993f1d75e87..84ec118f270d 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -424,32 +424,6 @@ void intel_guc_submission_fini(struct intel_guc *guc)
 	}
 }
 
-static void guc_interrupts_capture(struct intel_gt *gt)
-{
-	struct intel_uncore *uncore = gt->uncore;
-	u32 irqs = GT_CONTEXT_SWITCH_INTERRUPT;
-	u32 dmask = irqs << 16 | irqs;
-
-	GEM_BUG_ON(INTEL_GEN(gt->i915) < 11);
-
-	/* Don't handle the ctx switch interrupt in GuC submission mode */
-	intel_uncore_rmw(uncore, GEN11_RENDER_COPY_INTR_ENABLE, dmask, 0);
-	intel_uncore_rmw(uncore, GEN11_VCS_VECS_INTR_ENABLE, dmask, 0);
-}
-
-static void guc_interrupts_release(struct intel_gt *gt)
-{
-	struct intel_uncore *uncore = gt->uncore;
-	u32 irqs = GT_CONTEXT_SWITCH_INTERRUPT;
-	u32 dmask = irqs << 16 | irqs;
-
-	GEM_BUG_ON(INTEL_GEN(gt->i915) < 11);
-
-	/* Handle ctx switch interrupts again */
-	intel_uncore_rmw(uncore, GEN11_RENDER_COPY_INTR_ENABLE, 0, dmask);
-	intel_uncore_rmw(uncore, GEN11_VCS_VECS_INTR_ENABLE, 0, dmask);
-}
-
 static int guc_context_alloc(struct intel_context *ce)
 {
 	return lrc_alloc(ce, ce->engine);
@@ -751,9 +725,6 @@ int intel_guc_submission_setup(struct intel_engine_cs *engine)
 void intel_guc_submission_enable(struct intel_guc *guc)
 {
 	guc_stage_desc_init(guc);
-
-	/* Take over from manual control of ELSP (execlists) */
-	guc_interrupts_capture(guc_to_gt(guc));
 }
 
 void intel_guc_submission_disable(struct intel_guc *guc)
@@ -764,8 +735,6 @@ void intel_guc_submission_disable(struct intel_guc *guc)
 
 	/* Note: By the time we're here, GuC may have already been reset */
 
-	guc_interrupts_release(gt);
-
 	guc_stage_desc_fini(guc);
 }
 
-- 
2.29.2

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

  parent reply	other threads:[~2021-01-05 23:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 23:19 [Intel-gfx] [PATCH 0/5] Split GuC submission from execlists submission Daniele Ceraolo Spurio
2021-01-05 23:19 ` [Intel-gfx] [PATCH 1/5] drm/i915/guc: Delete GuC code unused in future patches Daniele Ceraolo Spurio
2021-01-06  0:55   ` Chris Wilson
2021-01-06  2:28     ` Daniele Ceraolo Spurio
2021-01-06  3:11       ` Chris Wilson
2021-01-05 23:19 ` [Intel-gfx] [PATCH 2/5] drm/i915/guc: do not dump execlists state with GuC submission Daniele Ceraolo Spurio
2021-01-06  0:58   ` Chris Wilson
2021-01-06  2:32     ` Daniele Ceraolo Spurio
2021-01-06  2:55       ` Chris Wilson
2021-01-06 17:21         ` Daniele Ceraolo Spurio
2021-01-06 19:43           ` Chris Wilson
2021-01-13  1:03             ` Daniele Ceraolo Spurio
2021-01-05 23:19 ` [Intel-gfx] [PATCH 3/5] drm/i915/guc: init engine directly in GuC submission mode Daniele Ceraolo Spurio
2021-01-05 23:33   ` Chris Wilson
2021-01-05 23:51     ` Daniele Ceraolo Spurio
2021-01-06  0:02       ` Chris Wilson
2021-01-06  3:14         ` Chris Wilson
2021-01-05 23:19 ` [Intel-gfx] [PATCH 4/5] drm/i915/guc: stop calling execlists_set_default_submission Daniele Ceraolo Spurio
2021-01-06  1:02   ` Chris Wilson
2021-01-06  2:38     ` Daniele Ceraolo Spurio
2021-01-06  3:09       ` Chris Wilson
2021-01-06 17:22         ` Daniele Ceraolo Spurio
2021-01-05 23:19 ` Daniele Ceraolo Spurio [this message]
2021-01-05 23:38   ` [Intel-gfx] [PATCH 5/5] drm/i915/guc: enable only the user interrupt when using GuC submission Chris Wilson
2021-01-05 23:56     ` Daniele Ceraolo Spurio
2021-01-06  0:15       ` Chris Wilson
2021-01-06  2:39         ` Daniele Ceraolo Spurio
2021-01-06  1:05   ` Chris Wilson
2021-01-06  0:28 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Split GuC submission from execlists submission Patchwork
2021-01-06  0:29 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-01-06  0:57 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-01-06  3:42 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20210105231947.31235-6-daniele.ceraolospurio@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --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.