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
Subject: [PATCH 5/5] drm/xe/oa: Enable OAM latency measurement
Date: Fri,  6 Jun 2025 12:26:17 -0700	[thread overview]
Message-ID: <20250606192618.4133817-6-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20250606192618.4133817-1-ashutosh.dixit@intel.com>

Enable OAM latency measurement for Xe3+ platforms.

Bspec: 58840

v2: Introduce DRM_XE_OA_UNIT_TYPE_OAM_SAG

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
---
 drivers/gpu/drm/xe/regs/xe_oa_regs.h |  3 +++
 drivers/gpu/drm/xe/xe_oa.c           | 11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/regs/xe_oa_regs.h b/drivers/gpu/drm/xe/regs/xe_oa_regs.h
index a79ad2da070c2..e693a50706f84 100644
--- a/drivers/gpu/drm/xe/regs/xe_oa_regs.h
+++ b/drivers/gpu/drm/xe/regs/xe_oa_regs.h
@@ -97,4 +97,7 @@
 #define OAM_STATUS(base)			XE_REG((base) + OAM_STATUS_OFFSET)
 #define OAM_MMIO_TRG(base)			XE_REG((base) + OAM_MMIO_TRG_OFFSET)
 
+#define OAM_COMPRESSION_T3_CONTROL		XE_REG(0x1c2e00)
+#define  OAM_LAT_MEASURE_ENABLE			REG_BIT(4)
+
 #endif
diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index f41dac107e4a3..679ee69502530 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -844,6 +844,11 @@ static void xe_oa_disable_metric_set(struct xe_oa_stream *stream)
 
 	/* Reset PMON Enable to save power. */
 	xe_mmio_rmw32(mmio, XELPMP_SQCNT1, sqcnt1, 0);
+
+	if ((stream->oa_unit->type == DRM_XE_OA_UNIT_TYPE_OAM ||
+	     stream->oa_unit->type == DRM_XE_OA_UNIT_TYPE_OAM_SAG) &&
+	    GRAPHICS_VER(stream->oa->xe) >= 30)
+		xe_mmio_rmw32(mmio, OAM_COMPRESSION_T3_CONTROL, OAM_LAT_MEASURE_ENABLE, 0);
 }
 
 static void xe_oa_stream_destroy(struct xe_oa_stream *stream)
@@ -1111,9 +1116,13 @@ static int xe_oa_enable_metric_set(struct xe_oa_stream *stream)
 	 */
 	sqcnt1 = SQCNT1_PMON_ENABLE |
 		 (HAS_OA_BPC_REPORTING(stream->oa->xe) ? SQCNT1_OABPC : 0);
-
 	xe_mmio_rmw32(mmio, XELPMP_SQCNT1, 0, sqcnt1);
 
+	if ((stream->oa_unit->type == DRM_XE_OA_UNIT_TYPE_OAM ||
+	     stream->oa_unit->type == DRM_XE_OA_UNIT_TYPE_OAM_SAG) &&
+	    GRAPHICS_VER(stream->oa->xe) >= 30)
+		xe_mmio_rmw32(mmio, OAM_COMPRESSION_T3_CONTROL, 0, OAM_LAT_MEASURE_ENABLE);
+
 	/* Configure OAR/OAC */
 	if (stream->exec_q) {
 		ret = xe_oa_configure_oa_context(stream, true);
-- 
2.48.1


  parent reply	other threads:[~2025-06-06 19:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-06 19:26 [PATCH 0/5] Enable media OA Ashutosh Dixit
2025-06-06 19:26 ` [PATCH 1/5] drm/xe/oa/uapi: Expose media OA units Ashutosh Dixit
2025-06-06 19:26 ` [PATCH 2/5] drm/xe/oa: Print hwe to OA unit mapping Ashutosh Dixit
2025-06-06 19:26 ` [PATCH 3/5] drm/xe/oa: Introduce stream->oa_unit Ashutosh Dixit
2025-06-06 19:26 ` [PATCH 4/5] drm/xe/oa: Assign hwe for OAM_SAG Ashutosh Dixit
2025-06-06 19:26 ` Ashutosh Dixit [this message]
2025-06-06 19:31 ` ✓ CI.Patch_applied: success for Enable media OA Patchwork
2025-06-06 19:31 ` ✓ CI.checkpatch: " Patchwork
2025-06-06 19:33 ` ✓ CI.KUnit: " Patchwork
2025-06-06 19:43 ` ✓ CI.Build: " Patchwork
2025-06-06 19:46 ` ✓ CI.Hooks: " Patchwork
2025-06-06 19:48 ` ✓ CI.checksparse: " Patchwork
2025-06-06 20:23 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-09  3:26 ` ✓ Xe.CI.Full: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-06-06 16:02 [PATCH v4 0/5] " Ashutosh Dixit
2025-06-06 16:02 ` [PATCH 5/5] drm/xe/oa: Enable OAM latency measurement Ashutosh Dixit
2025-06-03 20:21 [PATCH v3 0/5] Enable media OA Ashutosh Dixit
2025-06-03 20:21 ` [PATCH 5/5] drm/xe/oa: Enable OAM latency measurement Ashutosh Dixit
2025-06-05 16:25   ` Umesh Nerlige Ramappa
2025-05-31  0:12 [PATCH v2 0/5] Enable media OA Ashutosh Dixit
2025-05-31  0:12 ` [PATCH 5/5] drm/xe/oa: Enable OAM latency measurement Ashutosh Dixit

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=20250606192618.4133817-6-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox