From 9841aeb6ad3c1a80e90918a273fd38282b77e5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Wed, 15 May 2024 10:10:08 -0700 Subject: [PATCH] intel/perf: Add a macro with header + sample length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To be more explicit lets have 2 macros one with sample lenght other with header and sample length. This will also help add Xe KMD support as it don't have a header like i915. Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/perf/intel_perf.h | 8 ++++++-- src/intel/perf/intel_perf_query.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/intel/perf/intel_perf.h b/src/intel/perf/intel_perf.h index b761b6a452e..625b03104e6 100644 --- a/src/intel/perf/intel_perf.h +++ b/src/intel/perf/intel_perf.h @@ -131,8 +131,12 @@ struct intel_pipeline_stat { #define STATS_BO_END_OFFSET_BYTES (STATS_BO_SIZE / 2) #define MAX_STAT_COUNTERS (STATS_BO_END_OFFSET_BYTES / 8) -#define I915_PERF_OA_SAMPLE_SIZE (8 + /* drm_i915_perf_record_header */ \ - 256) /* OA counter report */ +/* Up to now all platforms uses the same sample size */ +#define INTEL_PERF_OA_SAMPLE_SIZE 256 + +/* header + sample */ +#define INTEL_PERF_OA_HEADER_SAMPLE_SIZE (sizeof(struct intel_perf_record_header) + \ + INTEL_PERF_OA_SAMPLE_SIZE) struct intel_perf_query_result { /** diff --git a/src/intel/perf/intel_perf_query.c b/src/intel/perf/intel_perf_query.c index f223d31c3aa..be7fa7d6802 100644 --- a/src/intel/perf/intel_perf_query.c +++ b/src/intel/perf/intel_perf_query.c @@ -165,7 +165,7 @@ struct oa_sample_buf { struct exec_node link; int refcount; int len; - uint8_t buf[I915_PERF_OA_SAMPLE_SIZE * 10]; + uint8_t buf[INTEL_PERF_OA_HEADER_SAMPLE_SIZE * 10]; uint32_t last_timestamp; };