[PATCH v2 2/5] lib/igt_gt: Make igt_open_forcewake_handle() xe-compatible

Lucas De Marchi lucas.demarchi at intel.com
Mon Sep 23 22:11:43 UTC 2024


xe uses a different file to hold forcewake. Make
igt_open_forcewake_handle() compatible.

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
 lib/igt_gt.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index b043e2d41..0cc3ee131 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -501,9 +501,17 @@ void igt_stop_hang_helper(void)
  */
 int igt_open_forcewake_handle(int fd)
 {
+	const char *fn;
+
 	if (getenv("IGT_NO_FORCEWAKE"))
 		return -1;
-	return igt_debugfs_open(fd, "i915_forcewake_user", O_RDONLY);
+
+	if (is_xe_device(fd))
+		fn = "forcewake_all";
+	else
+		fn = "i915_forcewake_user";
+
+	return igt_debugfs_open(fd, fn, O_RDONLY);
 }
 
 #if defined(__x86_64__) || defined(__i386__)
-- 
2.46.1



More information about the igt-dev mailing list