From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7861F10E24B for ; Thu, 16 Mar 2023 23:33:29 +0000 (UTC) From: Umesh Nerlige Ramappa To: igt-dev@lists.freedesktop.org, Ashutosh Dixit , kamil.konieczny@linux.intel.com Date: Thu, 16 Mar 2023 16:33:04 -0700 Message-Id: <20230316233323.2638668-13-umesh.nerlige.ramappa@intel.com> In-Reply-To: <20230316233323.2638668-1-umesh.nerlige.ramappa@intel.com> References: <20230316233323.2638668-1-umesh.nerlige.ramappa@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t v3 12/31] i915/perf: Use a helper for OA format List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lionel G Landwerlin Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: Refactor and use a helper for OA format Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Kamil Konieczny --- tests/i915/perf.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/i915/perf.c b/tests/i915/perf.c index 2f2e403a..6f10d57e 100644 --- a/tests/i915/perf.c +++ b/tests/i915/perf.c @@ -657,6 +657,12 @@ oar_unit_default_format(void) return test_set->perf_oa_format; } +static int +oa_unit_default_format(void) +{ + return test_set->perf_oa_format; +} + /* * Temporary wrapper to distinguish mappings on !llc platforms, * where it seems cache over GEM_MMAP_OFFSET is not flushed before execution. @@ -1900,7 +1906,7 @@ static bool expected_report_timing_delta(uint32_t delta, uint32_t expected_delta static void test_oa_exponents(const struct intel_execution_engine2 *e) { - uint64_t fmt = test_set->perf_oa_format; + uint64_t fmt = oa_unit_default_format(); load_helper_init(); load_helper_run(HIGH); @@ -2243,7 +2249,7 @@ test_blocking(uint64_t requested_oa_period, ADD_PROPS(props, idx, SAMPLE_OA, true); ADD_PROPS(props, idx, OA_METRICS_SET, test_set->perf_oa_metrics_set); - ADD_PROPS(props, idx, OA_FORMAT, test_set->perf_oa_format); + ADD_PROPS(props, idx, OA_FORMAT, oa_unit_default_format()); ADD_PROPS(props, idx, OA_EXPONENT, oa_exponent); if (has_param_poll_period() && set_kernel_hrtimer) @@ -2406,7 +2412,7 @@ test_polling(uint64_t requested_oa_period, ADD_PROPS(props, idx, SAMPLE_OA, true); ADD_PROPS(props, idx, OA_METRICS_SET, test_set->perf_oa_metrics_set); - ADD_PROPS(props, idx, OA_FORMAT, test_set->perf_oa_format); + ADD_PROPS(props, idx, OA_FORMAT, oa_unit_default_format()); ADD_PROPS(props, idx, OA_EXPONENT, oa_exponent); if (has_param_poll_period() && set_kernel_hrtimer) @@ -2680,7 +2686,7 @@ gen12_test_oa_tlb_invalidate(const struct intel_execution_engine2 *e) DRM_I915_PERF_PROP_SAMPLE_OA, true, DRM_I915_PERF_PROP_OA_METRICS_SET, test_set->perf_oa_metrics_set, - DRM_I915_PERF_PROP_OA_FORMAT, test_set->perf_oa_format, + DRM_I915_PERF_PROP_OA_FORMAT, oa_unit_default_format(), DRM_I915_PERF_PROP_OA_EXPONENT, oa_exponent, DRM_I915_PERF_PROP_OA_ENGINE_CLASS, e->class, DRM_I915_PERF_PROP_OA_ENGINE_INSTANCE, e->instance, @@ -2723,7 +2729,7 @@ test_buffer_fill(const struct intel_execution_engine2 *e) /* ~5 micro second period */ int oa_exponent = max_oa_exponent_for_period_lte(5000); uint64_t oa_period = oa_exponent_to_ns(oa_exponent); - uint64_t fmt = test_set->perf_oa_format; + uint64_t fmt = oa_unit_default_format(); uint64_t properties[] = { /* Include OA reports in samples */ DRM_I915_PERF_PROP_SAMPLE_OA, true, @@ -2959,7 +2965,7 @@ test_enable_disable(const struct intel_execution_engine2 *e) /* ~5 micro second period */ int oa_exponent = max_oa_exponent_for_period_lte(5000); uint64_t oa_period = oa_exponent_to_ns(oa_exponent); - uint64_t fmt = test_set->perf_oa_format; + uint64_t fmt = oa_unit_default_format(); uint64_t properties[] = { /* Include OA reports in samples */ DRM_I915_PERF_PROP_SAMPLE_OA, true, @@ -4554,7 +4560,7 @@ test_stress_open_close(const struct intel_execution_engine2 *e) /* OA unit configuration */ DRM_I915_PERF_PROP_OA_METRICS_SET, test_set->perf_oa_metrics_set, - DRM_I915_PERF_PROP_OA_FORMAT, test_set->perf_oa_format, + DRM_I915_PERF_PROP_OA_FORMAT, oa_unit_default_format(), DRM_I915_PERF_PROP_OA_EXPONENT, oa_exponent, DRM_I915_PERF_PROP_OA_ENGINE_CLASS, e->class, DRM_I915_PERF_PROP_OA_ENGINE_INSTANCE, e->instance, @@ -4657,7 +4663,7 @@ test_global_sseu_config_invalid(const struct intel_execution_engine2 *e) /* OA unit configuration */ DRM_I915_PERF_PROP_OA_METRICS_SET, test_set->perf_oa_metrics_set, - DRM_I915_PERF_PROP_OA_FORMAT, test_set->perf_oa_format, + DRM_I915_PERF_PROP_OA_FORMAT, oa_unit_default_format(), DRM_I915_PERF_PROP_OA_EXPONENT, oa_exp_1_millisec, DRM_I915_PERF_PROP_GLOBAL_SSEU, to_user_pointer(&sseu_param), DRM_I915_PERF_PROP_OA_ENGINE_CLASS, e->class, @@ -4746,7 +4752,7 @@ test_global_sseu_config(const struct intel_execution_engine2 *e) /* OA unit configuration */ DRM_I915_PERF_PROP_OA_METRICS_SET, test_set->perf_oa_metrics_set, - DRM_I915_PERF_PROP_OA_FORMAT, test_set->perf_oa_format, + DRM_I915_PERF_PROP_OA_FORMAT, oa_unit_default_format(), DRM_I915_PERF_PROP_OA_EXPONENT, oa_exp_1_millisec, DRM_I915_PERF_PROP_GLOBAL_SSEU, to_user_pointer(&sseu_param), DRM_I915_PERF_PROP_OA_ENGINE_CLASS, e->class, -- 2.36.1