From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7D17310E0C9 for ; Thu, 5 Jan 2023 04:41:49 +0000 (UTC) From: Ashutosh Dixit To: igt-dev@lists.freedesktop.org Date: Wed, 4 Jan 2023 20:41:42 -0800 Message-Id: <20230105044144.3982688-2-ashutosh.dixit@intel.com> In-Reply-To: <20230105044144.3982688-1-ashutosh.dixit@intel.com> References: <20230105044144.3982688-1-ashutosh.dixit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t 1/3] tests/perf_pmu: Compare against requested freq in frequency subtest List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: After the i915 commit 95ccf312a1e4f ("drm/i915/guc/slpc: Allow SLPC to use efficient frequency"), FW uses the requested freq as the efficient freq which can exceed the max freq set. Therefore, in the "min freq" part of the igt@perf_pmu@frequency subtest, compare the requested freq reported by PMU not against the set freq but against the requested freq reported in sysfs. Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/6806 Signed-off-by: Ashutosh Dixit --- tests/i915/perf_pmu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/i915/perf_pmu.c b/tests/i915/perf_pmu.c index f363db2ba13..d09eec8f347 100644 --- a/tests/i915/perf_pmu.c +++ b/tests/i915/perf_pmu.c @@ -1546,7 +1546,7 @@ test_interrupts_sync(int gem_fd) static void test_frequency(int gem_fd) { - uint32_t min_freq, max_freq, boost_freq; + uint32_t min_freq, max_freq, boost_freq, min_req; uint64_t val[2], start[2], slept; double min[2], max[2]; igt_spin_t *spin; @@ -1587,6 +1587,7 @@ test_frequency(int gem_fd) min[0] = 1e9*(val[0] - start[0]) / slept; min[1] = 1e9*(val[1] - start[1]) / slept; + min_req = igt_sysfs_get_u32(sysfs, "gt_cur_freq_mhz"); igt_spin_free(gem_fd, spin); gem_quiescent_gpu(gem_fd); /* Don't leak busy bo into the next phase */ @@ -1633,7 +1634,7 @@ test_frequency(int gem_fd) igt_info("Max frequency: requested %.1f, actual %.1f\n", max[0], max[1]); - assert_within_epsilon(min[0], min_freq, tolerance); + assert_within_epsilon(min[0], min_req, tolerance); /* * On thermally throttled devices we cannot be sure maximum frequency * can be reached so use larger tolerance downards. -- 2.38.0