Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Badal Nilawar <badal.nilawar@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tests/xe: When GT is in RC6 donot assert if act freq is 0
Date: Thu, 22 Jun 2023 15:07:18 +0530	[thread overview]
Message-ID: <20230622093718.1689978-1-badal.nilawar@intel.com> (raw)

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

             reply	other threads:[~2023-06-22  9:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22  9:37 Badal Nilawar [this message]
2023-06-22 11:54 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/xe: When GT is in RC6 donot assert if act freq is 0 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230622093718.1689978-1-badal.nilawar@intel.com \
    --to=badal.nilawar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox