Fix PMU freq verification with SLPC
cover Fix PMU freq verification with SLPC
With SLPC, even when we set the same min and max freq's, the requested and actual freq's can differ from the min/max freq set. For example "efficient freq" (when in effect) can override set min/max freq. In general FW is the final arbiter in determining freq and can override set values.
Therefore compare the requested freq reported by PMU not against the set freq's but against the requested freq reported in sysfs. Also add a delay after setting freq's to account for messaging delays in setting freq's in GuC.
The almost identical fix is applied to the two tests below.
Previous versions of PATCH 1 were posted here:
https://patchwork.freedesktop.org/series/110574/
Now because the same fix has beed added to a second test I am re-posting this as a series.
Ashutosh Dixit (2):
tests/perf_pmu: Compare against requested freq in frequency subtest tests/gem_ctx_freq: Compare against requested freq
tests/i915/gem_ctx_freq.c | 19 ++++++++++++------- tests/i915/perf_pmu.c | 23 +++++++++++++++-------- 2 files changed, 27 insertions(+), 15 deletions(-)
Signature · 1 line
2.38.0
PATCH 1/2 tests/perf_pmu: Compare against requested freq in frequency subtest
With SLPC, even when we set the same min and max freq's, the requested and actual freq's can differ from the min/max freq set. For example "efficient freq" (when in effect) can override set min/max freq. In general FW is the final arbiter in determining freq and can override set values.
Therefore in igt@perf_pmu@frequency subtest, compare the requested freq reported by PMU not against the set freq's but against the requested freq reported in sysfs. Also add a delay after setting freq's to account for messaging delays in setting freq's in GuC.
--- tests/i915/perf_pmu.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
tests/i915/perf_pmu.c +15 -8
@@ -1543,10 +1543,13 @@ test_interrupts_sync(int gem_fd)igt_assert_lte (target, busy); } +/* Wait for GuC SLPC freq changes to take effect */ +#define wait_freq_set () usleep(100000) +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, max_req;uint64_t val[2 ], start[2 ], slept;double min[2 ], max[2 ];igt_spin_t *spin;
@@ -1572,10 +1575,11 @@ 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)); +wait_freq_set (); +igt_require (igt_sysfs_get_u32 (sysfs,"gt_min_freq_mhz" ) == min_freq); +igt_require (igt_sysfs_get_u32 (sysfs,"gt_max_freq_mhz" ) == min_freq);igt_require (igt_sysfs_get_u32 (sysfs,"gt_boost_freq_mhz" ) == min_freq);gem_quiescent_gpu (gem_fd);/* Idle to be sure the change takes effect */
@@ -1587,6 +1591,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 */
@@ -1597,11 +1602,11 @@ test_frequency(int gem_fd)* Set GPU to max frequency and read PMU counters. */ igt_require (igt_sysfs_set_u32 (sysfs,"gt_max_freq_mhz" , max_freq)); -igt_require (igt_sysfs_get_u32 (sysfs,"gt_max_freq_mhz" ) == max_freq);igt_require (igt_sysfs_set_u32 (sysfs,"gt_boost_freq_mhz" , boost_freq)); -igt_require (igt_sysfs_get_u32 (sysfs,"gt_boost_freq_mhz" ) == boost_freq); -igt_require (igt_sysfs_set_u32 (sysfs,"gt_min_freq_mhz" , max_freq)); +wait_freq_set (); +igt_require (igt_sysfs_get_u32 (sysfs,"gt_max_freq_mhz" ) == max_freq); +igt_require (igt_sysfs_get_u32 (sysfs,"gt_boost_freq_mhz" ) == boost_freq);igt_require (igt_sysfs_get_u32 (sysfs,"gt_min_freq_mhz" ) == max_freq);gem_quiescent_gpu (gem_fd);
@@ -1613,6 +1618,7 @@ test_frequency(int gem_fd) max[0 ] =1e9 *(val[0 ] - start[0 ]) / slept; max[1 ] =1e9 *(val[1 ] - start[1 ]) / slept; + max_req =igt_sysfs_get_u32 (sysfs,"gt_cur_freq_mhz" );igt_spin_free (gem_fd, spin);gem_quiescent_gpu (gem_fd);
@@ -1621,6 +1627,7 @@ test_frequency(int gem_fd)* Restore min/max. */ igt_sysfs_set_u32 (sysfs,"gt_min_freq_mhz" , min_freq); +wait_freq_set ();if (igt_sysfs_get_u32 (sysfs,"gt_min_freq_mhz" ) != min_freq)igt_warn ("Unable to restore min frequency to saved value [%u MHz], now %u MHz\n" , min_freq,igt_sysfs_get_u32 (sysfs,"gt_min_freq_mhz" ));
@@ -1633,12 +1640,12 @@ 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. */ -__assert_within_epsilon (max[0 ], max_freq, tolerance,0.15f ); +__assert_within_epsilon (max[0 ], max_req, tolerance,0.15f ); } static void
Signature · 1 line
2.38.0
PATCH 2/2 tests/gem_ctx_freq: Compare against requested freq
In reply to Ashutosh DixitWith SLPC, even when we set the same min and max freq's, the requested and actual freq's can differ from the min/max freq set. For example "efficient freq" (when in effect) can override set min/max freq. In general FW is the final arbiter in determining freq and can override set values.
Therefore compare the requested freq reported by PMU not against the set freq's but against the requested freq reported in sysfs. Also add a delay after setting freq's to account for messaging delays in setting freq's in GuC.
--- tests/i915/gem_ctx_freq.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
tests/i915/gem_ctx_freq.c +12 -7
@@ -104,23 +104,28 @@ static void triangle_fill(uint32_t *t, unsigned int nstep, } } +/* Wait for GuC SLPC freq changes to take effect */ +#define wait_freq_set () usleep(100000) +static void set_sysfs_freq (uint32_t min,uint32_t max) {igt_sysfs_printf (sysfs,"gt_min_freq_mhz" ,"%u" , min);igt_sysfs_printf (sysfs,"gt_max_freq_mhz" ,"%u" , max); +wait_freq_set (); } -static bool get_sysfs_freq (uint32_t *min,uint32_t *max) +static bool get_sysfs_freq (uint32_t *min,uint32_t *max,uint32_t *req) {return (igt_sysfs_scanf (sysfs,"gt_min_freq_mhz" ,"%u" , min) ==1 && -igt_sysfs_scanf (sysfs,"gt_max_freq_mhz" ,"%u" , max) ==1 ); +igt_sysfs_scanf (sysfs,"gt_max_freq_mhz" ,"%u" , max) ==1 && +igt_sysfs_scanf (sysfs,"gt_cur_freq_mhz" ,"%u" , req) ==1 ); }static void sysfs_range (int i915) {#define N_STEPS 10uint32_t frequencies[TRIANGLE_SIZE (N_STEPS )]; -uint32_t sys_min, sys_max; +uint32_t sys_min, sys_max, req;igt_spin_t *spin;double measured;int pmu;
@@ -133,7 +138,7 @@ static void sysfs_range(int i915)* constriained sysfs range. */ -igt_require (get_sysfs_freq (&sys_min, &sys_max)); +igt_require (get_sysfs_freq (&sys_min, &sys_max, &req));igt_info ("System min freq: %dMHz; max freq: %dMHz\n" , sys_min, sys_max);triangle_fill (frequencies,N_STEPS , sys_min, sys_max);
@@ -150,7 +155,7 @@ static void sysfs_range(int i915)usleep (10000 );set_sysfs_freq (sys_freq, sys_freq); -get_sysfs_freq (&cur, &discard); +get_sysfs_freq (&cur, &discard, &req); measured =measure_frequency (pmu,SAMPLE_PERIOD );igt_debugfs_dump (i915,"i915_rps_boost_info" );
@@ -159,8 +164,8 @@ static void sysfs_range(int i915)__igt_spin_free_idle (i915, spin);igt_info ("sysfs: Measured %.1fMHz, expected %dMhz\n" , - measured, cur); -pmu_assert (measured, cur); + measured, req); +pmu_assert (measured, req); }gem_quiescent_gpu (i915);
Signature · 1 line
2.38.0
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for Fix PMU freq verification with SLPC
In reply to Ashutosh Dixit== Series Details ==
== Series Details ==
Series: Fix PMU freq verification with SLPC
URL : https://patchwork.freedesktop.org/series/111282/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12425 -> IGTPW_8148
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8148/index.html
Participating hosts (38 -> 35)
------------------------------
Missing (3): fi-ctg-p8600 bat-dg2-11 bat-dg1-6
Known issues
------------
Here are the changes found in IGTPW_8148 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s3@smem:
- fi-rkl-11600: NOTRUN -> [FAIL][1] ([fdo#103375])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8148/fi-rkl-11600/igt@gem_exec_suspend@[email protected]
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-rkl-11600: NOTRUN -> [SKIP][2] ([fdo#111827])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8148/fi-rkl-11600/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_gttfill@basic:
- fi-pnv-d510: [FAIL][3] ([i915#7229]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12425/fi-pnv-d510/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8148/fi-pnv-d510/igt@[email protected]
* igt@i915_module_load@reload:
- {bat-rpls-2}: [DMESG-WARN][5] ([i915#6434]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12425/bat-rpls-2/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8148/bat-rpls-2/igt@[email protected]
#### Warnings ####
* igt@i915_suspend@basic-s3-without-i915:
- fi-rkl-11600: [INCOMPLETE][7] ([i915#4817]) -> [FAIL][8] ([fdo#103375])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12425/fi-rkl-11600/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8148/fi-rkl-11600/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4817]: https://gitlab.freedesktop.org/drm/intel/issues/4817
[i915#5153]: https://gitlab.freedesktop.org/drm/intel/issues/5153
[i915#5278]: https://gitlab.freedesktop.org/drm/intel/issues/5278
[i915#6257]: https://gitlab.freedesktop.org/drm/intel/issues/6257
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6434]: https://gitlab.freedesktop.org/drm/intel/issues/6434
[i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
[i915#7229]: https://gitlab.freedesktop.org/drm/intel/issues/7229
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7072 -> IGTPW_8148
CI-20190529: 20190529
CI_DRM_12425: 66e5d8e0cdb991feba4fde2c851e700f993d240a @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8148: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8148/index.html
IGT_7072: 69ba7163475925cdc69aebbdfa0e87453ae165c7 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Testlist changes
----------------
+igt@kms_chamelium@common-hpd-after-hibernate +igt@kms_chamelium@common-hpd-after-suspend +igt@kms_chamelium@dp-hpd +igt@kms_chamelium@dp-hpd-after-hibernate +igt@kms_chamelium@dp-hpd-after-suspend +igt@kms_chamelium@dp-hpd-enable-disable-mode +igt@kms_chamelium@dp-hpd-fast +igt@kms_chamelium@dp-hpd-for-each-pipe +igt@kms_chamelium@dp-hpd-storm +igt@kms_chamelium@dp-hpd-storm-disable +igt@kms_chamelium@dp-hpd-with-enabled-mode +igt@kms_chamelium@hdmi-hpd +igt@kms_chamelium@hdmi-hpd-after-hibernate +igt@kms_chamelium@hdmi-hpd-after-suspend +igt@kms_chamelium@hdmi-hpd-enable-disable-mode +igt@kms_chamelium@hdmi-hpd-fast +igt@kms_chamelium@hdmi-hpd-for-each-pipe +igt@kms_chamelium@hdmi-hpd-storm +igt@kms_chamelium@hdmi-hpd-storm-disable +igt@kms_chamelium@hdmi-hpd-with-enabled-mode +igt@kms_chamelium@vga-hpd +igt@kms_chamelium@vga-hpd-after-hibernate +igt@kms_chamelium@vga-hpd-after-suspend +igt@kms_chamelium@vga-hpd-enable-disable-mode +igt@kms_chamelium@vga-hpd-fast +igt@kms_chamelium@vga-hpd-for-each-pipe +igt@kms_chamelium@vga-hpd-without-ddc +igt@kms_chamelium@vga-hpd-with-enabled-mode +igt@kms_color_chamelium@ctm-0-25 +igt@kms_color_chamelium@ctm-0-50 +igt@kms_color_chamelium@ctm-0-75 +igt@kms_color_chamelium@ctm-blue-to-red +igt@kms_color_chamelium@ctm-green-to-red +igt@kms_color_chamelium@ctm-limited-range +igt@kms_color_chamelium@ctm-max +igt@kms_color_chamelium@ctm-negative +igt@kms_color_chamelium@ctm-red-to-blue +igt@kms_color_chamelium@degamma +igt@kms_color_chamelium@gamma -igt@kms_chamelium_color@ctm-0-25 -igt@kms_chamelium_color@ctm-0-50 -igt@kms_chamelium_color@ctm-0-75 -igt@kms_chamelium_color@ctm-blue-to-red -igt@kms_chamelium_color@ctm-green-to-red -igt@kms_chamelium_color@ctm-limited-range -igt@kms_chamelium_color@ctm-max -igt@kms_chamelium_color@ctm-negative -igt@kms_chamelium_color@ctm-red-to-blue -igt@kms_chamelium_color@degamma -igt@kms_chamelium_color@gamma -igt@kms_chamelium_hpd@common-hpd-after-hibernate -igt@kms_chamelium_hpd@common-hpd-after-suspend -igt@kms_chamelium_hpd@dp-hpd -igt@kms_chamelium_hpd@dp-hpd-after-hibernate -igt@kms_chamelium_hpd@dp-hpd-after-suspend -igt@kms_chamelium_hpd@dp-hpd-enable-disable-mode -igt@kms_chamelium_hpd@dp-hpd-fast -igt@kms_chamelium_hpd@dp-hpd-for-each-pipe -igt@kms_chamelium_hpd@dp-hpd-storm -igt@kms_chamelium_hpd@dp-hpd-storm-disable -igt@kms_chamelium_hpd@dp-hpd-with-enabled-mode -igt@kms_chamelium_hpd@hdmi-hpd -igt@kms_chamelium_hpd@hdmi-hpd-after-hibernate -igt@kms_chamelium_hpd@hdmi-hpd-after-suspend -igt@kms_chamelium_hpd@hdmi-hpd-enable-disable-mode -igt@kms_chamelium_hpd@hdmi-hpd-fast -igt@kms_chamelium_hpd@hdmi-hpd-for-each-pipe -igt@kms_chamelium_hpd@hdmi-hpd-storm -igt@kms_chamelium_hpd@hdmi-hpd-storm-disable -igt@kms_chamelium_hpd@hdmi-hpd-with-enabled-mode -igt@kms_chamelium_hpd@vga-hpd -igt@kms_chamelium_hpd@vga-hpd-after-hibernate -igt@kms_chamelium_hpd@vga-hpd-after-suspend -igt@kms_chamelium_hpd@vga-hpd-enable-disable-mode -igt@kms_chamelium_hpd@vga-hpd-fast -igt@kms_chamelium_hpd@vga-hpd-for-each-pipe -igt@kms_chamelium_hpd@vga-hpd-without-ddc -igt@kms_chamelium_hpd@vga-hpd-with-enabled-mode
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8148/index.html