[PATCH i-g-t 4/4] lib/xe/oa: Fix OA media metric set properties

Ashutosh Dixit ashutosh.dixit at intel.com
Fri Aug 29 17:15:06 UTC 2025


Fix generated format, OA report size and other properties for Xe2+ OA media
metric sets.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
---
 lib/xe/oa-configs/oa-metricset-codegen.py | 26 +++++++++++++++++------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/lib/xe/oa-configs/oa-metricset-codegen.py b/lib/xe/oa-configs/oa-metricset-codegen.py
index 748f587875..922fae58cb 100644
--- a/lib/xe/oa-configs/oa-metricset-codegen.py
+++ b/lib/xe/oa-configs/oa-metricset-codegen.py
@@ -139,14 +139,26 @@ 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":
-            c(textwrap.dedent("""\
-                metric_set->perf_oa_format = XE_OA_FORMAT_PEC64u64;
+            # See intel_xe_perf_accumulate_reports for the offsets
+            if set.oa_format == "128B_MPEC8_NOA16":
+                c(textwrap.dedent("""\
+                    metric_set->perf_oa_format = XE_OAM_FORMAT_MPEC8u32_B8_C8;
 
-                metric_set->perf_raw_size = 576;
-                metric_set->gpu_time_offset = 0;
-                metric_set->gpu_clock_offset = 1;
-                metric_set->pec_offset = 2;
-            """))
+                    metric_set->perf_raw_size = 128;
+                    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;
+                    metric_set->perf_raw_size = 576;
+                    metric_set->gpu_time_offset = 0;
+                    metric_set->gpu_clock_offset = 1;
+                    metric_set->pec_offset = 2;
+                """))
         else:
             c(textwrap.dedent("""\
                 metric_set->perf_oa_format = XE_OA_FORMAT_A32u40_A4u32_B8_C8;
-- 
2.48.1



More information about the igt-dev mailing list