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

Chris Wilson chris at chris-wilson.co.uk
Thu Feb 8 08:10:48 UTC 2018


Quoting Tvrtko Ursulin (2018-02-08 08:01:30)
> 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));

We still want a 2-sided check though. We shouldn't be reporting max >
max_freq (beyond reasonable calculation errors).
-Chris


More information about the igt-dev mailing list