Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v1] tests/intel/xe_gt_freq: Use spinner for throttle test
@ 2025-03-03  9:57 Raag Jadav
  2025-03-03 17:39 ` Rodrigo Vivi
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Raag Jadav @ 2025-03-03  9:57 UTC (permalink / raw)
  To: lucas.demarchi, rodrigo.vivi, matthew.d.roper
  Cc: igt-dev, anshuman.gupta, badal.nilawar, riana.tauro, Raag Jadav

Since throttling requires running workload on GPU, make use of spinner
to get consistent results from throttle API test.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 tests/intel/xe_gt_freq.c | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/tests/intel/xe_gt_freq.c b/tests/intel/xe_gt_freq.c
index 1fb6d2b53..b501c62db 100644
--- a/tests/intel/xe_gt_freq.c
+++ b/tests/intel/xe_gt_freq.c
@@ -36,6 +36,12 @@
  */
 #define SLPC_FREQ_LATENCY_US 100000
 
+enum spin_test {
+	SPIN_THROTTLE,
+	SPIN_FIXED_FREQ,
+	SPIN_RANGE_FREQ,
+};
+
 static int set_freq(int fd, int gt_id, const char *freq_name, uint32_t freq)
 {
 	int ret = -EAGAIN;
@@ -352,7 +358,7 @@ static void test_reset(int fd, int gt_id, int cycles)
 	}
 }
 
-static void test_spin(int fd, struct drm_xe_engine_class_instance *eci, bool fixed)
+static void test_spin(int fd, struct drm_xe_engine_class_instance *eci, enum spin_test test)
 {
 	struct drm_xe_sync sync[2] = {
 		{ .type = DRM_XE_SYNC_TYPE_SYNCOBJ, .flags = DRM_XE_SYNC_FLAG_SIGNAL, },
@@ -406,10 +412,17 @@ static void test_spin(int fd, struct drm_xe_engine_class_instance *eci, bool fix
 	igt_info("Running on GT %d Engine %s:%d\n", eci->gt_id,
 		 xe_engine_class_string(eci->engine_class), eci->engine_instance);
 
-	if (fixed)
+	switch (test) {
+	case SPIN_THROTTLE:
+		test_throttle_basic_api(fd, eci->gt_id);
+		break;
+	case SPIN_FIXED_FREQ:
 		test_freq_fixed(fd, eci->gt_id, false);
-	else
+		break;
+	case SPIN_RANGE_FREQ:
 		test_freq_range(fd, eci->gt_id, false);
+		break;
+	};
 
 	xe_spin_end(spin);
 
@@ -454,8 +467,13 @@ igt_main
 	}
 
 	igt_subtest("throttle_basic_api") {
-		xe_for_each_gt(fd, gt)
-			test_throttle_basic_api(fd, gt);
+		xe_for_each_gt(fd, gt) {
+			xe_for_each_engine(fd, hwe) {
+				if (hwe->gt_id != gt)
+					continue;
+				test_spin(fd, hwe, SPIN_THROTTLE);
+			}
+		}
 	}
 
 	igt_subtest("freq_basic_api") {
@@ -476,7 +494,7 @@ igt_main
 			xe_for_each_engine(fd, hwe) {
 				if (hwe->gt_id != gt)
 					continue;
-				test_spin(fd, hwe, true);
+				test_spin(fd, hwe, SPIN_FIXED_FREQ);
 			}
 		}
 	}
@@ -494,7 +512,7 @@ igt_main
 			xe_for_each_engine(fd, hwe) {
 				if (hwe->gt_id != gt)
 					continue;
-				test_spin(fd, hwe, false);
+				test_spin(fd, hwe, SPIN_RANGE_FREQ);
 			}
 		}
 	}
-- 
2.34.1


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

end of thread, other threads:[~2025-03-04  1:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03  9:57 [PATCH i-g-t v1] tests/intel/xe_gt_freq: Use spinner for throttle test Raag Jadav
2025-03-03 17:39 ` Rodrigo Vivi
2025-03-03 19:08   ` Raag Jadav
2025-03-03 21:58 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-03-03 22:19 ` ✗ i915.CI.BAT: failure " Patchwork
2025-03-04  1:15 ` ✗ Xe.CI.Full: " Patchwork

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