public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies
@ 2026-04-02 11:04 Krzysztof Niemiec
  2026-04-02 11:24 ` Sebastian Brzezinka
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Krzysztof Niemiec @ 2026-04-02 11:04 UTC (permalink / raw)
  To: igt-dev
  Cc: Andi Shyti, Janusz Krzysztofik, Krzysztof Karas,
	Sebastian Brzezinka, Krzysztof Niemiec

The test alters the environment, specifically the gt frequencies, for
its duration. Using the legacy interface, however, makes it impossible for
the pre-test state to be restored due to its limitations in multi-gt
systems. Use the per-gt interface instead to properly set the values and
clean up.

Signed-off-by: Krzysztof Niemiec <krzysztof.niemiec@intel.com>
---
 tests/intel/gem_exec_endless.c | 38 ++++++++++++++++++++--------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/tests/intel/gem_exec_endless.c b/tests/intel/gem_exec_endless.c
index 7f35e985c..9f41d812e 100644
--- a/tests/intel/gem_exec_endless.c
+++ b/tests/intel/gem_exec_endless.c
@@ -316,28 +316,28 @@ static void endless_dispatch(int i915, const struct intel_execution_engine2 *e)
 		for_each_if(gem_class_can_store_dword(i915, (e)->class)) \
 			igt_dynamic_f("%s", (e)->name)
 
-static void pin_rps(int sysfs)
+static void pin_rps(int sysfs_gt)
 {
 	unsigned int max;
 
-	if (igt_sysfs_scanf(sysfs, "gt_RP0_freq_mhz", "%u", &max) != 1)
+	if (igt_sysfs_scanf(sysfs_gt, "rps_RP0_freq_mhz", "%u", &max) != 1)
 		return;
 
-	igt_sysfs_printf(sysfs, "gt_min_freq_mhz", "%u", max);
-	igt_sysfs_printf(sysfs, "gt_max_freq_mhz", "%u", max);
-	igt_sysfs_printf(sysfs, "gt_boost_freq_mhz", "%u", max);
+	igt_sysfs_printf(sysfs_gt, "rps_min_freq_mhz", "%u", max);
+	igt_sysfs_printf(sysfs_gt, "rps_max_freq_mhz", "%u", max);
+	igt_sysfs_printf(sysfs_gt, "rps_boost_freq_mhz", "%u", max);
 }
 
-static void unpin_rps(int sysfs)
+static void unpin_rps(int sysfs_gt)
 {
 	unsigned int v;
 
-	if (igt_sysfs_scanf(sysfs, "gt_RPn_freq_mhz", "%u", &v) == 1)
-		igt_sysfs_printf(sysfs, "gt_min_freq_mhz", "%u", v);
+	if (igt_sysfs_scanf(sysfs_gt, "rps_RPn_freq_mhz", "%u", &v) == 1)
+		igt_sysfs_printf(sysfs_gt, "rps_min_freq_mhz", "%u", v);
 
-	if (igt_sysfs_scanf(sysfs, "gt_RP0_freq_mhz", "%u", &v) == 1) {
-		igt_sysfs_printf(sysfs, "gt_max_freq_mhz", "%u", v);
-		igt_sysfs_printf(sysfs, "gt_boost_freq_mhz", "%u", v);
+	if (igt_sysfs_scanf(sysfs_gt, "rps_RP0_freq_mhz", "%u", &v) == 1) {
+		igt_sysfs_printf(sysfs_gt, "rps_max_freq_mhz", "%u", v);
+		igt_sysfs_printf(sysfs_gt, "rps_boost_freq_mhz", "%u", v);
 	}
 }
 
@@ -355,7 +355,7 @@ int igt_main()
 
 	igt_subtest_group() {
 		struct intel_mmio_data mmio;
-		int sysfs;
+		int sysfs_gt, tmp, gt;
 
 		igt_fixture() {
 			igt_require(gem_scheduler_enabled(i915));
@@ -365,16 +365,22 @@ int igt_main()
 						   igt_device_get_pci_device(i915),
 						   false);
 
-			sysfs = igt_sysfs_open(i915);
-			pin_rps(sysfs);
+			i915_for_each_gt(i915, tmp, gt) {
+				sysfs_gt = igt_sysfs_gt_open(i915, gt);
+				pin_rps(sysfs_gt);
+			}
+
 		}
 
 		test_each_engine("dispatch", i915, e)
 				endless_dispatch(i915, e);
 
 		igt_fixture() {
-			unpin_rps(sysfs);
-			close(sysfs);
+			i915_for_each_gt(i915, tmp, gt) {
+				sysfs_gt = igt_sysfs_gt_open(i915, gt);
+				unpin_rps(sysfs_gt);
+				close(sysfs_gt);
+			}
 			intel_register_access_fini(&mmio);
 		}
 	}
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-04-03  9:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-02 11:04 [PATCH i-g-t] tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies Krzysztof Niemiec
2026-04-02 11:24 ` Sebastian Brzezinka
2026-04-03  6:21   ` Krzysztof Karas
2026-04-02 12:04 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-04-02 12:11 ` ✓ i915.CI.BAT: " Patchwork
2026-04-02 20:39 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-03  9:16 ` ✗ i915.CI.Full: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox