diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-10-29 16:05:24 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-10-30 13:52:17 +0000 |
commit | 12d370cb57e0cfcb781c87ad9e15e68b17a1f41f (patch) | |
tree | ea1fdd5bb22ab64ade0e9e5930cafc5ac927ad5a /tests/fbdev.c | |
parent | 09d673d2a2bb83cac2620825dec04725fa67a394 (diff) |
fbdev: Force module load
If there are no /dev/fbN, force loading of the first available drm
module and try again.
v2: Use drm_load_module() directly
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2582
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/fbdev.c')
-rw-r--r-- | tests/fbdev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/fbdev.c b/tests/fbdev.c index fe320b14..e5efeb93 100644 --- a/tests/fbdev.c +++ b/tests/fbdev.c @@ -43,8 +43,16 @@ igt_main struct fb_fix_screeninfo fix_info; int fd = -1; + /* + * Should this test focus on the fbdev independent of any drm driver, + * or should it look for fbdev of a particular device? + */ igt_fixture { fd = open("/dev/fb0", O_RDWR); + if (fd < 0) { + drm_load_module(DRIVER_ANY); + fd = open("/dev/fb0", O_RDWR); + } igt_require_f(fd != -1, "/dev/fb0\n"); igt_require(ioctl(fd, FBIOGET_VSCREENINFO, &var_info) == 0); |