Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] RFC tests/xe: Stress test GT C states
@ 2023-07-28  6:09 Riana Tauro
  2023-07-28  6:42 ` [igt-dev] ○ CI.xeBAT: info for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Riana Tauro @ 2023-07-28  6:09 UTC (permalink / raw)
  To: igt-dev; +Cc: badal.nilawar

stress test GT C states by checking if GT is in C0 when
forcewake is acquired and in C6 once released.

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
---
 tests/xe/xe_pm_residency.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tests/xe/xe_pm_residency.c b/tests/xe/xe_pm_residency.c
index 4936de166..9713e61cd 100644
--- a/tests/xe/xe_pm_residency.c
+++ b/tests/xe/xe_pm_residency.c
@@ -85,6 +85,29 @@ static void test_idle_residency(int fd, int gt)
 	assert_within_epsilon(residency_end - residency_start, elapsed_ms, tolerance);
 }
 
+/**
+ * SUBTEST: stress-gt-c6
+ * Description: stress test GT C states by acquiring/releasing forcewake
+ * Run type: FULL
+ */
+static void stress_c6(int fd, int n)
+{
+	int handle, gt;
+
+	while (n--) {
+		handle = igt_debugfs_open(fd, "forcewake_all", O_WRONLY);
+		igt_assert(handle >= 0);
+		/* check if all gts are in C0 after forcewake is acquired */
+		xe_for_each_gt(fd, gt)
+			igt_assert_f(!xe_is_gt_in_c6(fd, gt), "GT in C6\n");
+		close(handle);
+		/* check if all gts are in C6 after forcewake is released */
+		xe_for_each_gt(fd, gt)
+			igt_assert_f(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 1),
+				     "GT is not in C6\n");
+	}
+}
+
 igt_main
 {
 	int fd, gt;
@@ -104,6 +127,10 @@ igt_main
 		xe_for_each_gt(fd, gt)
 			test_idle_residency(fd, gt);
 
+	igt_describe("stress test GT C states by acquiring/releasing forcewake");
+	igt_subtest("stress-gt-c6")
+		stress_c6(fd, 16);
+
 	igt_fixture {
 		close(fd);
 	}
-- 
2.40.0

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

end of thread, other threads:[~2023-07-31 13:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-28  6:09 [igt-dev] [PATCH i-g-t] RFC tests/xe: Stress test GT C states Riana Tauro
2023-07-28  6:42 ` [igt-dev] ○ CI.xeBAT: info for " Patchwork
2023-07-28  6:44 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-07-28 14:08 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-07-31  7:30 ` [igt-dev] [PATCH i-g-t] " Sundaresan, Sujaritha
2023-07-31  8:27   ` Riana Tauro
2023-07-31 10:07     ` Sundaresan, Sujaritha
2023-07-31 12:04       ` Gupta, Anshuman
2023-07-31 13:23         ` Riana Tauro

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