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

Chris Wilson chris at chris-wilson.co.uk
Mon Dec 14 10:34:01 UTC 2020


Quoting Petri Latvala (2020-12-14 07:16:12)
> 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);
> +       }

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list