Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Riana Tauro <riana.tauro@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: riana.tauro@intel.com, anshuman.gupta@intel.com,
	rodrigo.vivi@intel.com, matthew.brost@intel.com,
	michal.wajdeczko@intel.com, karthik.poosa@intel.com
Subject: [PATCH v6 1/2] drm/xe: modify GuC CTB enable communication
Date: Wed,  7 Aug 2024 19:10:49 +0530	[thread overview]
Message-ID: <20240807134050.2048114-2-riana.tauro@intel.com> (raw)
In-Reply-To: <20240807134050.2048114-1-riana.tauro@intel.com>

Modify GuC CTB enable communication function to only set the
CTB state if registration is not required.
This will be used while resuming from D3Hot where
registration of CTB is not necessary.

v2: split patches (Rodrigo)

v3: do not expose internals of CT layer (Michal)

v4: fix uninitialized err variable (Matthew Brost)

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
---
 drivers/gpu/drm/xe/xe_guc.c | 23 +++++++++++++++++------
 drivers/gpu/drm/xe/xe_guc.h |  2 +-
 drivers/gpu/drm/xe/xe_uc.c  |  4 ++--
 3 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
index de0fe9e65746..85b88532e23f 100644
--- a/drivers/gpu/drm/xe/xe_guc.c
+++ b/drivers/gpu/drm/xe/xe_guc.c
@@ -755,7 +755,7 @@ static int vf_guc_min_load_for_hwconfig(struct xe_guc *guc)
 	if (ret)
 		return ret;
 
-	ret = xe_guc_enable_communication(guc);
+	ret = xe_guc_enable_communication(guc, true);
 	if (ret)
 		return ret;
 
@@ -800,7 +800,7 @@ int xe_guc_min_load_for_hwconfig(struct xe_guc *guc)
 	if (ret)
 		return ret;
 
-	ret = xe_guc_enable_communication(guc);
+	ret = xe_guc_enable_communication(guc, true);
 	if (ret)
 		return ret;
 
@@ -854,7 +854,16 @@ static void guc_enable_irq(struct xe_guc *guc)
 	xe_mmio_rmw32(gt, GUC_SG_INTR_MASK, events, 0);
 }
 
-int xe_guc_enable_communication(struct xe_guc *guc)
+/**
+ * xe_guc_enable_communication - Enable GuC CTB communication
+ * @guc: GuC object
+ * @register_ctb: true to register CTB, false otherwise
+ *
+ * Enables GuC CTB Communication and IRQ
+ *
+ * Return: 0 on success, negative error code otherwise
+ */
+int xe_guc_enable_communication(struct xe_guc *guc, bool register_ctb)
 {
 	struct xe_device *xe = guc_to_xe(guc);
 	int err;
@@ -870,9 +879,11 @@ int xe_guc_enable_communication(struct xe_guc *guc)
 		guc_enable_irq(guc);
 	}
 
-	err = xe_guc_ct_enable(&guc->ct);
-	if (err)
-		return err;
+	if (register_ctb) {
+		err = xe_guc_ct_enable(&guc->ct);
+		if (err)
+			return err;
+	}
 
 	guc_handle_mmio_msg(guc);
 
diff --git a/drivers/gpu/drm/xe/xe_guc.h b/drivers/gpu/drm/xe/xe_guc.h
index c3e6b51f7a09..5fcf6f6ef964 100644
--- a/drivers/gpu/drm/xe/xe_guc.h
+++ b/drivers/gpu/drm/xe/xe_guc.h
@@ -30,7 +30,7 @@ int xe_guc_post_load_init(struct xe_guc *guc);
 int xe_guc_reset(struct xe_guc *guc);
 int xe_guc_upload(struct xe_guc *guc);
 int xe_guc_min_load_for_hwconfig(struct xe_guc *guc);
-int xe_guc_enable_communication(struct xe_guc *guc);
+int xe_guc_enable_communication(struct xe_guc *guc, bool register_ctb);
 int xe_guc_suspend(struct xe_guc *guc);
 void xe_guc_notify(struct xe_guc *guc);
 int xe_guc_auth_huc(struct xe_guc *guc, u32 rsa_addr);
diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
index 0d073a9987c2..fa98e9f22631 100644
--- a/drivers/gpu/drm/xe/xe_uc.c
+++ b/drivers/gpu/drm/xe/xe_uc.c
@@ -154,7 +154,7 @@ static int vf_uc_init_hw(struct xe_uc *uc)
 	if (err)
 		return err;
 
-	err = xe_guc_enable_communication(&uc->guc);
+	err = xe_guc_enable_communication(&uc->guc, true);
 	if (err)
 		return err;
 
@@ -194,7 +194,7 @@ int xe_uc_init_hw(struct xe_uc *uc)
 	if (ret)
 		return ret;
 
-	ret = xe_guc_enable_communication(&uc->guc);
+	ret = xe_guc_enable_communication(&uc->guc, true);
 	if (ret)
 		return ret;
 
-- 
2.40.0


  parent reply	other threads:[~2024-08-07 13:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07 13:40 [PATCH v6 0/2] drm/xe: remove GuC reload in D3Hot path Riana Tauro
2024-08-07 13:32 ` ✓ CI.Patch_applied: success for drm/xe: remove GuC reload in D3Hot path (rev6) Patchwork
2024-08-07 13:32 ` ✓ CI.checkpatch: " Patchwork
2024-08-07 13:34 ` ✓ CI.KUnit: " Patchwork
2024-08-07 13:40 ` Riana Tauro [this message]
2024-08-07 13:40 ` [PATCH v6 2/2] drm/xe: remove GuC reload in D3Hot path Riana Tauro
2024-08-07 14:59   ` Lucas De Marchi
2024-08-07 17:51     ` Rodrigo Vivi
2024-08-08  5:34       ` Riana Tauro
2024-08-09 20:07         ` Michal Wajdeczko
2024-08-07 13:45 ` ✓ CI.Build: success for drm/xe: remove GuC reload in D3Hot path (rev6) Patchwork
2024-08-07 13:48 ` ✓ CI.Hooks: " Patchwork
2024-08-07 13:49 ` ✓ CI.checksparse: " Patchwork
2024-08-07 14:09 ` ✓ CI.BAT: " Patchwork
2024-08-07 15:34 ` ✗ CI.FULL: failure " 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=20240807134050.2048114-2-riana.tauro@intel.com \
    --to=riana.tauro@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=karthik.poosa@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox