Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Subject: [PATCH 2/4] drm/xe/oa: Print hwe to OA unit mapping
Date: Thu, 29 May 2025 16:58:34 -0700	[thread overview]
Message-ID: <20250529235836.145097-3-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20250529235836.145097-1-ashutosh.dixit@intel.com>

Print hwe to OA unit mapping to dmesg, to help debug for current and new
platforms.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 drivers/gpu/drm/xe/xe_oa.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index 5c9d7ac82e7e4..a7d3fd5d21559 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -2601,6 +2601,31 @@ static int xe_oa_init_gt(struct xe_gt *gt)
 	return 0;
 }
 
+static void xe_oa_print_oa_units(struct xe_oa *oa)
+{
+	enum xe_hw_engine_id hwe_id;
+	struct xe_hw_engine *hwe;
+	struct xe_oa_unit *u;
+	struct xe_gt *gt;
+	int gt_id, i, n;
+	char buf[256];
+
+	for_each_gt(gt, oa->xe, gt_id) {
+		for (i = 0; i < gt->oa.num_oa_units; i++) {
+			u = &gt->oa.oa_unit[i];
+			buf[0] = '\0';
+			n = 0;
+
+			for_each_hw_engine(hwe, gt, hwe_id)
+				if (xe_oa_unit_id(hwe) == u->oa_unit_id)
+					n += scnprintf(buf + n, sizeof(buf) - n, "%s ", hwe->name);
+
+			xe_gt_dbg(gt, "oa_unit %d, type %d, Engines: %s\n",
+				  u->oa_unit_id, u->type, buf);
+		}
+	}
+}
+
 static int xe_oa_init_oa_units(struct xe_oa *oa)
 {
 	struct xe_gt *gt;
@@ -2617,6 +2642,8 @@ static int xe_oa_init_oa_units(struct xe_oa *oa)
 			return ret;
 	}
 
+	xe_oa_print_oa_units(oa);
+
 	return 0;
 }
 
-- 
2.48.1


  parent reply	other threads:[~2025-05-29 23:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-29 23:58 [PATCH 0/4] Enable media OA Ashutosh Dixit
2025-05-29 23:58 ` [PATCH 1/4] drm/xe/oa: Expose media OA units Ashutosh Dixit
2025-05-29 23:58 ` Ashutosh Dixit [this message]
2025-05-29 23:58 ` [PATCH 3/4] drm/xe/oa: Introduce stream->oa_unit Ashutosh Dixit
2025-05-29 23:58 ` [PATCH 4/4] drm/xe/oa: Assign hwe for OAM_SAG Ashutosh Dixit
2025-05-30  0:04 ` ✓ CI.Patch_applied: success for Enable media OA Patchwork
2025-05-30  0:04 ` ✓ CI.checkpatch: " Patchwork
2025-05-30  0:05 ` ✓ CI.KUnit: " Patchwork
2025-05-30  0:16 ` ✓ CI.Build: " Patchwork
2025-05-30  0:19 ` ✓ CI.Hooks: " Patchwork
2025-05-30  0:20 ` ✓ CI.checksparse: " Patchwork
2025-05-30  0:39 ` ✓ Xe.CI.BAT: " Patchwork
2025-05-30 18:54 ` ✓ Xe.CI.Full: " 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=20250529235836.145097-3-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=umesh.nerlige.ramappa@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