[igt-dev] [PATCH i-g-t] core_setmaster: Load modules before accessing device files

Petri Latvala petri.latvala at intel.com
Mon Dec 14 07:16:12 UTC 2020


core_setmaster does special trickery to the dri device files before it
calls drm_open_device. Now that drm_load_module() exists for just
loading the modules without the other things that drm_open_device()
does, use it to ensure the files exist.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Closes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/91
---
 tests/core_setmaster.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
index 20e4defb..470f9441 100644
--- a/tests/core_setmaster.c
+++ b/tests/core_setmaster.c
@@ -125,6 +125,15 @@ static unsigned tweak_perm(uint8_t *saved_perm, unsigned max_perm, bool save)
 
 igt_main
 {
+	igt_fixture {
+		/*
+		 * We're operating on the device files themselves
+		 * before opening them, make sure the drivers are
+		 * loaded.
+		 */
+		drm_load_module(DRIVER_ANY);
+	}
+
 	igt_describe("Ensure that root can Set/DropMaster");
 	igt_subtest("master-drop-set-root") {
 		check_drop_set();
-- 
2.20.1



More information about the igt-dev mailing list