[PATCH i-g-t 2/2] tests/intel/xe_gt_freq: Skip GuC PC tests if GuC PC not supported

Badal Nilawar badal.nilawar at intel.com
Fri Jan 19 17:04:48 UTC 2024


Skip GuC PC tests if platform does not support SLPC.

v2: Use scalable approach (Anshuman)

Fixes: acaaca0bf317 ("tests/xe: Add Xe IGT tests")
Signed-off-by: Badal Nilawar <badal.nilawar at intel.com>
---
 tests/intel/xe_gt_freq.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/intel/xe_gt_freq.c b/tests/intel/xe_gt_freq.c
index bf63e4298..6c4fc81ae 100644
--- a/tests/intel/xe_gt_freq.c
+++ b/tests/intel/xe_gt_freq.c
@@ -319,6 +319,11 @@ static void test_reset(int fd, int gt_id, int cycles)
 	}
 }
 
+static bool xe_is_slpc_enabled(int drm_fd)
+{
+	return igt_debugfs_search(drm_fd, "info", "skip_guc_pc yes");
+}
+
 igt_main
 {
 	int fd;
@@ -329,6 +334,9 @@ igt_main
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_XE);
 
+		igt_skip_on_f(!xe_is_slpc_enabled(fd),
+			      "GuC PC tests are not supported when SLPC is disabled\n");
+
 		/* The defaults are the same. Stashing the gt0 is enough */
 		stash_min = get_freq(fd, 0, "min");
 		stash_max = get_freq(fd, 0, "max");
-- 
2.25.1



More information about the igt-dev mailing list