[igt-dev] [PATCH i-g-t] tests/intel/hwmon: Scale hwmon tests to support xe kmd

Badal Nilawar badal.nilawar at intel.com
Fri Sep 15 14:45:29 UTC 2023


Scale hwmon tests to support xe kmd

Cc: Ashutosh Dixit <ashutosh.dixit at intel.com>
Signed-off-by: Badal Nilawar <badal.nilawar at intel.com>
---
 lib/igt_hwmon.c                             |  5 ++++-
 tests/intel/{i915_hwmon.c => intel_hwmon.c} | 10 +++++-----
 tests/meson.build                           |  2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)
 rename tests/intel/{i915_hwmon.c => intel_hwmon.c} (89%)

diff --git a/lib/igt_hwmon.c b/lib/igt_hwmon.c
index 309019d69..ad5a388dd 100644
--- a/lib/igt_hwmon.c
+++ b/lib/igt_hwmon.c
@@ -66,7 +66,10 @@ int igt_hwmon_open(int device)
 {
 	char path[PATH_MAX];
 
-	if (!is_i915_device(device) || !igt_hwmon_path(device, path, "i915"))
+	if (!is_intel_device(device))
+		return -1;
+
+	if (!igt_hwmon_path(device, path, "i915") || !igt_hwmon_path(device, path, "xe"))
 		return -1;
 
 	return open(path, O_RDONLY);
diff --git a/tests/intel/i915_hwmon.c b/tests/intel/intel_hwmon.c
similarity index 89%
rename from tests/intel/i915_hwmon.c
rename to tests/intel/intel_hwmon.c
index 48ed9f3b7..1cc9cd399 100644
--- a/tests/intel/i915_hwmon.c
+++ b/tests/intel/intel_hwmon.c
@@ -9,11 +9,11 @@
 #include "igt_hwmon.h"
 #include "igt_sysfs.h"
 /**
- * TEST: i915 hwmon
- * Description: Tests for i915 hwmon
+ * TEST: intel hwmon
+ * Description: Tests for intel hwmon
  * Feature: hwmon
  * Run type: FULL
- * Test category: GEM_Legacy
+ * Test category: functionality
  *
  * SUBTEST: hwmon-read
  * Description: Verify we can read all hwmon attributes
@@ -22,7 +22,7 @@
  * Description: Verify writable hwmon attributes
  */
 
-IGT_TEST_DESCRIPTION("Tests for i915 hwmon");
+IGT_TEST_DESCRIPTION("Tests for intel hwmon");
 
 static void hwmon_read(int hwm)
 {
@@ -79,7 +79,7 @@ igt_main
 	int fd, hwm;
 
 	igt_fixture {
-		fd = drm_open_driver_master(DRIVER_INTEL);
+		fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_XE);
 		hwm = igt_hwmon_open(fd);
 		igt_require(hwm >= 0);
 	}
diff --git a/tests/meson.build b/tests/meson.build
index 31492bf7b..cf5c8a2fa 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -84,6 +84,7 @@ test_progs = [
 
 intel_i915_xe_progs = [
 	'api_intel_allocator',
+	'intel_hwmon',
 ]
 
 intel_i915_progs = [
@@ -218,7 +219,6 @@ intel_i915_progs = [
 	'i915_getparams_basic',
 	'i915_pm_freq_api',
 	'i915_hangman',
-	'i915_hwmon',
 	'i915_module_load',
 	'i915_pciid',
 	'i915_pipe_stress',
-- 
2.25.1



More information about the igt-dev mailing list