Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/xe: When GT is in RC6 donot assert if act freq is 0
@ 2023-06-22  9:37 Badal Nilawar
  2023-06-22 11:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Badal Nilawar @ 2023-06-22  9:37 UTC (permalink / raw)
  To: igt-dev

When GT is in RC6 state actual frequency reported will be 0.
So during RC6 no need to assert if act freq is not equal to curr freq.

Fixes: acaaca0bf317 ("tests/xe: Add Xe IGT tests")
Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
---
 tests/xe/xe_guc_pc.c | 51 +++++++++++++++++++++++---------------------
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c
index 60c93288b..a1cf2e039 100644
--- a/tests/xe/xe_guc_pc.c
+++ b/tests/xe/xe_guc_pc.c
@@ -30,6 +30,27 @@
  */
 #define ACT_FREQ_LATENCY_US 100000
 
+/**
+ * SUBTEST: rc6_on_idle
+ * Description: check if GPU is in RC6 on idle
+ * Run type: BAT
+ *
+ * SUBTEST: rc0_on_exec
+ * Description: check if GPU is in RC0 on when doing some work
+ * Run type: BAT
+ */
+
+static bool in_rc6(int sysfs, int gt_id)
+{
+	char path[32];
+	char rc[8];
+
+	sprintf(path, "device/gt%d/rc_status", gt_id);
+	if (igt_sysfs_scanf(sysfs, path, "%s", rc) < 0)
+		return false;
+	return strcmp(rc, "rc6") == 0;
+}
+
 static void exec_basic(int fd, struct drm_xe_engine_class_instance *eci,
 		       int n_engines, int n_execs)
 {
@@ -223,13 +244,15 @@ static void test_freq_fixed(int sysfs, int gt_id)
 	igt_assert(set_freq(sysfs, gt_id, "max", rpn) > 0);
 	usleep(ACT_FREQ_LATENCY_US);
 	igt_assert(get_freq(sysfs, gt_id, "cur") == rpn);
-	igt_assert(get_freq(sysfs, gt_id, "act") == rpn);
+	if (!in_rc6(sysfs, gt_id))
+		igt_assert(get_freq(sysfs, gt_id, "act") == rpn);
 
 	igt_assert(set_freq(sysfs, gt_id, "min", rpe) > 0);
 	igt_assert(set_freq(sysfs, gt_id, "max", rpe) > 0);
 	usleep(ACT_FREQ_LATENCY_US);
 	igt_assert(get_freq(sysfs, gt_id, "cur") == rpe);
-	igt_assert(get_freq(sysfs, gt_id, "act") == rpe);
+	if (!in_rc6(sysfs, gt_id))
+		igt_assert(get_freq(sysfs, gt_id, "act") == rpe);
 
 	igt_assert(set_freq(sysfs, gt_id, "min", rp0) > 0);
 	igt_assert(set_freq(sysfs, gt_id, "max", rp0) > 0);
@@ -269,7 +292,8 @@ static void test_freq_range(int sysfs, int gt_id)
 	cur = get_freq(sysfs, gt_id, "cur");
 	igt_assert(rpn <= cur && cur <= rpe);
 	act = get_freq(sysfs, gt_id, "act");
-	igt_assert(rpn <= act && act <= rpe);
+	if (!in_rc6(sysfs, gt_id))
+		igt_assert(rpn <= act && act <= rpe);
 
 	igt_debug("Finished testing range request\n");
 }
@@ -354,27 +378,6 @@ static void test_reset(int fd, int sysfs, int gt_id, int cycles)
 	}
 }
 
-
-/**
- * SUBTEST: rc6_on_idle
- * Description: check if GPU is in RC6 on idle
- * Run type: BAT
- *
- * SUBTEST: rc0_on_exec
- * Description: check if GPU is in RC0 on when doing some work
- * Run type: BAT
- */
-
-static bool in_rc6(int sysfs, int gt_id)
-{
-	char path[32];
-	char rc[8];
-	sprintf(path, "device/gt%d/rc_status", gt_id);
-	if (igt_sysfs_scanf(sysfs, path, "%s", rc) < 0)
-		return false;
-	return strcmp(rc, "rc6") == 0;
-}
-
 igt_main
 {
 	struct drm_xe_engine_class_instance *hwe;
-- 
2.25.1

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

end of thread, other threads:[~2023-06-30 11:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-22  9:37 [igt-dev] [PATCH i-g-t] tests/xe: When GT is in RC6 donot assert if act freq is 0 Badal Nilawar
2023-06-22 11:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-06-22 22:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-06-26 23:09 ` [igt-dev] [PATCH i-g-t] " Dixit, Ashutosh
2023-06-30 11:00   ` Nilawar, Badal

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