[PATCH i-g-t v1 3/3] tests/core_getversion: test all drm devices

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Feb 20 10:19:53 UTC 2024


Create multigpu subtest and check all drm devices.

Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
 tests/core_getversion.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/core_getversion.c b/tests/core_getversion.c
index 8b95e2ce4..797a2baed 100644
--- a/tests/core_getversion.c
+++ b/tests/core_getversion.c
@@ -40,6 +40,9 @@
  *
  * SUBTEST: basic
  * Description: Tests GET_VERSION ioctl of the first device.
+ *
+ * SUBTEST: multigpu
+ * Description: Tests GET_VERSION ioctl for all drm devices.
  */
 
 IGT_TEST_DESCRIPTION("Tests the DRM_IOCTL_GET_VERSION ioctl and libdrm's "
@@ -78,6 +81,21 @@ igt_main
 		igt_info("0: %s\n", info);
 	}
 
+	igt_describe("Check GET_VERSION ioctl for all drm devices.");
+	igt_subtest("multigpu") {
+		int fd2;
+
+		for (int i = 0; i < 16; ++i) {
+			fd2 = __drm_open_driver_another(i, DRIVER_ANY);
+			if (fd2 == -1)
+				break;
+
+			check(fd2, info, sizeof(info));
+			igt_info("%d: %s\n", i, info);
+			drm_close_driver(fd2);
+		}
+	}
+
 	igt_fixture
 		drm_close_driver(fd);
 }
-- 
2.42.0



More information about the igt-dev mailing list