summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2020-12-14 09:16:12 +0200
committerPetri Latvala <petri.latvala@intel.com>2020-12-14 13:39:17 +0200
commitec4073d30b428aaf199c0f4de6c0a5ebdc1c1c65 (patch)
treeeda8a9bb494d0d3c458037e5f8fca5254cc273b2
parent5c4766f5c4ca896a4c7b61645ecca2b80546dc3b (diff)
core_setmaster: Load modules before accessing device files
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@intel.com> Closes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/91 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tests/core_setmaster.c9
1 files changed, 9 insertions, 0 deletions
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();