public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/xe/oa: Add support for 192B_MPEC8LL_NOA16 OAM format
@ 2026-04-15 21:52 Ashutosh Dixit
  2026-04-16  1:27 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ashutosh Dixit @ 2026-04-15 21:52 UTC (permalink / raw)
  To: igt-dev; +Cc: Shekhar Chauhan

Support for CRI 192B_MPEC8LL_NOA16 OAM format was previously missed
out. Add it.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 lib/xe/oa-configs/oa-metricset-codegen.py | 13 +++++++++++-
 lib/xe/xe_oa.c                            | 24 +++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/lib/xe/oa-configs/oa-metricset-codegen.py b/lib/xe/oa-configs/oa-metricset-codegen.py
index c5c7a2c8d4..b44d4d73af 100644
--- a/lib/xe/oa-configs/oa-metricset-codegen.py
+++ b/lib/xe/oa-configs/oa-metricset-codegen.py
@@ -139,7 +139,7 @@ def generate_metric_sets(args, gen):
                     metric_set->perfcnt_offset = metric_set->c_offset + 8;
                 """))
         elif gen.chipset == "lnl" or gen.chipset == "bmg" or gen.chipset == "ptl" or gen.chipset == "cri":
-            # See intel_xe_perf_accumulate_reports for the offsets
+            # See intel_xe_perf_accumulate_reports for the offsets (value of idx variable)
             if set.oa_format == "128B_MPEC8_NOA16" or set.oa_format == "128B_MERT_PEC8":
                 c(textwrap.dedent("""\
                     metric_set->perf_oa_format = XE_OAM_FORMAT_MPEC8u32_B8_C8;
@@ -151,6 +151,17 @@ def generate_metric_sets(args, gen):
                     metric_set->b_offset = metric_set->pec_offset + 8;
                     metric_set->c_offset = metric_set->b_offset + 8;
                 """))
+            elif set.oa_format == "192B_MPEC8LL_NOA16":
+                c(textwrap.dedent("""\
+                    metric_set->perf_oa_format = XE_OAM_FORMAT_MPEC8u64_B8_C8;
+
+                    metric_set->perf_raw_size = 192;
+                    metric_set->gpu_time_offset = 0;
+                    metric_set->gpu_clock_offset = 1;
+                    metric_set->pec_offset = 2;
+                    metric_set->b_offset = metric_set->pec_offset + 8;
+                    metric_set->c_offset = metric_set->b_offset + 8;
+                """))
             else:
                 c(textwrap.dedent("""\
                     metric_set->perf_oa_format = XE_OA_FORMAT_PEC64u64;
diff --git a/lib/xe/xe_oa.c b/lib/xe/xe_oa.c
index b2f447c944..d1a382bdd1 100644
--- a/lib/xe/xe_oa.c
+++ b/lib/xe/xe_oa.c
@@ -875,6 +875,30 @@ void intel_xe_perf_accumulate_reports(struct intel_xe_perf_accumulator *acc,
 
 		break;
 
+	case XE_OAM_FORMAT_MPEC8u64_B8_C8:
+		/* 64 bit timestamp */
+		if (perf->devinfo.oa_timestamp_shift >= 0)
+			deltas[idx++] += (end64[1] - start64[1]) << perf->devinfo.oa_timestamp_shift;
+		else
+			deltas[idx++] += (end64[1] - start64[1]) >> (-perf->devinfo.oa_timestamp_shift);
+
+		/* 64 bit clock */
+		deltas[idx++] += end64[3] - start64[3];
+
+		/* 8x 64bit MPEC counters */
+		for (i = 0; i < 8; i++)
+			deltas[idx++] += end64[4 + i] - start64[4 + i];
+
+		/* 8x 32bit B counters */
+		for (i = 0; i < 8; i++)
+			accumulate_uint32(start + 16 + i, end + 16 + i, deltas + idx++);
+
+		/* 8x 32bit C counters */
+		for (i = 0; i < 8; i++)
+			accumulate_uint32(start + 24 + i, end + 24 + i, deltas + idx++);
+
+		break;
+
 	case XE_OA_FORMAT_PEC64u64:
 		/* 64 bit timestamp */
 		if (perf->devinfo.oa_timestamp_shift >= 0)
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH i-g-t] lib/xe/oa: Add support for 192B_MPEC8LL_NOA16 OAM format
@ 2026-04-17  3:33 Ashutosh Dixit
  2026-04-17  5:35 ` Shekhar Chauhan
  0 siblings, 1 reply; 9+ messages in thread
From: Ashutosh Dixit @ 2026-04-17  3:33 UTC (permalink / raw)
  To: igt-dev; +Cc: Shekhar Chauhan

Support for CRI 192B_MPEC8LL_NOA16 OAM format was previously missed
out. Add it.

v2: Fix B/C counter accumulation (Shekhar C)
v3: Fix other places where 192B_MPEC8LL_NOA16 OAM format is used (Shekhar C)

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 lib/xe/oa-configs/oa-metricset-codegen.py | 13 +++++++++++-
 lib/xe/xe_oa.c                            | 26 +++++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/lib/xe/oa-configs/oa-metricset-codegen.py b/lib/xe/oa-configs/oa-metricset-codegen.py
index c5c7a2c8d4..b44d4d73af 100644
--- a/lib/xe/oa-configs/oa-metricset-codegen.py
+++ b/lib/xe/oa-configs/oa-metricset-codegen.py
@@ -139,7 +139,7 @@ def generate_metric_sets(args, gen):
                     metric_set->perfcnt_offset = metric_set->c_offset + 8;
                 """))
         elif gen.chipset == "lnl" or gen.chipset == "bmg" or gen.chipset == "ptl" or gen.chipset == "cri":
-            # See intel_xe_perf_accumulate_reports for the offsets
+            # See intel_xe_perf_accumulate_reports for the offsets (value of idx variable)
             if set.oa_format == "128B_MPEC8_NOA16" or set.oa_format == "128B_MERT_PEC8":
                 c(textwrap.dedent("""\
                     metric_set->perf_oa_format = XE_OAM_FORMAT_MPEC8u32_B8_C8;
@@ -151,6 +151,17 @@ def generate_metric_sets(args, gen):
                     metric_set->b_offset = metric_set->pec_offset + 8;
                     metric_set->c_offset = metric_set->b_offset + 8;
                 """))
+            elif set.oa_format == "192B_MPEC8LL_NOA16":
+                c(textwrap.dedent("""\
+                    metric_set->perf_oa_format = XE_OAM_FORMAT_MPEC8u64_B8_C8;
+
+                    metric_set->perf_raw_size = 192;
+                    metric_set->gpu_time_offset = 0;
+                    metric_set->gpu_clock_offset = 1;
+                    metric_set->pec_offset = 2;
+                    metric_set->b_offset = metric_set->pec_offset + 8;
+                    metric_set->c_offset = metric_set->b_offset + 8;
+                """))
             else:
                 c(textwrap.dedent("""\
                     metric_set->perf_oa_format = XE_OA_FORMAT_PEC64u64;
diff --git a/lib/xe/xe_oa.c b/lib/xe/xe_oa.c
index b2f447c944..891f4868a5 100644
--- a/lib/xe/xe_oa.c
+++ b/lib/xe/xe_oa.c
@@ -875,6 +875,30 @@ void intel_xe_perf_accumulate_reports(struct intel_xe_perf_accumulator *acc,
 
 		break;
 
+	case XE_OAM_FORMAT_MPEC8u64_B8_C8:
+		/* 64 bit timestamp */
+		if (perf->devinfo.oa_timestamp_shift >= 0)
+			deltas[idx++] += (end64[1] - start64[1]) << perf->devinfo.oa_timestamp_shift;
+		else
+			deltas[idx++] += (end64[1] - start64[1]) >> (-perf->devinfo.oa_timestamp_shift);
+
+		/* 64 bit clock */
+		deltas[idx++] += end64[3] - start64[3];
+
+		/* 8x 64bit MPEC counters */
+		for (i = 0; i < 8; i++)
+			deltas[idx++] += end64[4 + i] - start64[4 + i];
+
+		/* 8x 32bit B counters */
+		for (i = 0; i < 8; i++)
+			accumulate_uint32(start + 24 + i, end + 24 + i, deltas + idx++);
+
+		/* 8x 32bit C counters */
+		for (i = 0; i < 8; i++)
+			accumulate_uint32(start + 32 + i, end + 32 + i, deltas + idx++);
+
+		break;
+
 	case XE_OA_FORMAT_PEC64u64:
 		/* 64 bit timestamp */
 		if (perf->devinfo.oa_timestamp_shift >= 0)
@@ -910,6 +934,7 @@ uint64_t intel_xe_perf_read_record_timestamp(const struct intel_xe_perf *perf,
                ts = report32[1];
                break;
 
+       case XE_OAM_FORMAT_MPEC8u64_B8_C8:
        case XE_OAM_FORMAT_MPEC8u32_B8_C8:
        case XE_OA_FORMAT_PEC64u64:
                ts = report64[1];
@@ -941,6 +966,7 @@ uint64_t intel_xe_perf_read_record_timestamp_raw(const struct intel_xe_perf *per
                ts = report32[1];
                break;
 
+       case XE_OAM_FORMAT_MPEC8u64_B8_C8:
        case XE_OAM_FORMAT_MPEC8u32_B8_C8:
        case XE_OA_FORMAT_PEC64u64:
                ts = report64[1];
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-04-17  5:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-15 21:52 [PATCH i-g-t] lib/xe/oa: Add support for 192B_MPEC8LL_NOA16 OAM format Ashutosh Dixit
2026-04-16  1:27 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-04-16  1:58 ` ✓ i915.CI.BAT: " Patchwork
2026-04-16  3:51 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-16  4:31 ` [PATCH i-g-t] " Shekhar Chauhan
2026-04-16 18:50   ` Dixit, Ashutosh
2026-04-16 11:39 ` ✗ i915.CI.Full: failure for " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-04-17  3:33 [PATCH i-g-t] " Ashutosh Dixit
2026-04-17  5:35 ` Shekhar Chauhan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox