[igt-dev] [PATCH i-g-t 2/3] tests/perf_pmu: Handle thermally throttled devices

Tvrtko Ursulin tursulin at ursulin.net
Thu Feb 8 08:01:30 UTC 2018


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Some systems cannot reach the advertised maximum frequency due throttling.
Handle them by considering a 100MHz lower limit.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 tests/perf_pmu.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 70fb6bd55e53..07b25765f1f6 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -1222,8 +1222,13 @@ test_frequency(int gem_fd)
 		 min[0], min[1]);
 	igt_info("Max frequency: requested %.1f, actual %.1f\n",
 		 max[0], max[1]);
+
 	assert_within_epsilon(min[0], min_freq, tolerance);
-	assert_within_epsilon(max[0], max_freq, tolerance);
+	/*
+	 * On thermally throttled devices we cannot be sure maximum frequency
+	 * can be reached so use a lower limit.
+	 */
+	igt_assert(max[0] >= ((double)max_freq - 100.0));
 }
 
 static bool wait_for_rc6(int fd)
-- 
2.14.1



More information about the igt-dev mailing list