Commit 6de721fe authored by Chris Wilson's avatar Chris Wilson 🤔

igt/perf_pmu: Explicitly reset min_freq before max_freq

The kernel doesn't like it when you set max_freq < min_freq and
complains bitterly. So before setting max_freq = min_freq, first set
min_freq to min_freq!
Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin's avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
parent fb6ca825
......@@ -928,6 +928,8 @@ test_frequency(int gem_fd)
min_freq = igt_sysfs_get_u32(sysfs, "gt_RPn_freq_mhz");
max_freq = igt_sysfs_get_u32(sysfs, "gt_RP0_freq_mhz");
boost_freq = igt_sysfs_get_u32(sysfs, "gt_boost_freq_mhz");
igt_info("Frequency: min=%u, max=%u, boost=%u MHz\n",
min_freq, max_freq, boost_freq);
igt_require(min_freq > 0 && max_freq > 0 && boost_freq > 0);
igt_require(max_freq > min_freq);
igt_require(boost_freq > min_freq);
......@@ -938,6 +940,8 @@ test_frequency(int gem_fd)
/*
* Set GPU to min frequency and read PMU counters.
*/
igt_require(igt_sysfs_set_u32(sysfs, "gt_min_freq_mhz", min_freq));
igt_require(igt_sysfs_get_u32(sysfs, "gt_min_freq_mhz") == min_freq);
igt_require(igt_sysfs_set_u32(sysfs, "gt_max_freq_mhz", min_freq));
igt_require(igt_sysfs_get_u32(sysfs, "gt_max_freq_mhz") == min_freq);
igt_require(igt_sysfs_set_u32(sysfs, "gt_boost_freq_mhz", min_freq));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment