diff options
-rw-r--r-- | lib/drmtest.c | 2 | ||||
-rw-r--r-- | lib/drmtest.h | 1 | ||||
-rwxr-xr-x | tests/drv_module_reload | 15 | ||||
-rw-r--r-- | tests/gem_alive.c | 4 |
4 files changed, 18 insertions, 4 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index 133a1537..7cdef366 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -224,7 +224,7 @@ int drm_get_card(void) } /** Open the first DRM device we can find, searching up to 16 device nodes */ -static int __drm_open_any(void) +int __drm_open_any(void) { for (int i = 0; i < 16; i++) { char name[80]; diff --git a/lib/drmtest.h b/lib/drmtest.h index b39b45af..508cc83a 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -71,6 +71,7 @@ static inline void *igt_mmap64(void *addr, size_t length, int prot, int flags, #define ALIGN(v, a) (((v) + (a)-1) & ~((a)-1)) int drm_get_card(void); +int __drm_open_any(void); int drm_open_any(void); int drm_open_any_master(void); int drm_open_any_render(void); diff --git a/tests/drv_module_reload b/tests/drv_module_reload index 5cbff891..bb29a64f 100755 --- a/tests/drv_module_reload +++ b/tests/drv_module_reload @@ -43,7 +43,18 @@ echo 1 > /sys/class/vtconsole/vtcon1/bind modprobe snd_hda_intel -# try to run something -$SOURCE_DIR/gem_exec_nop > /dev/null && echo "module successfully loaded again" +# does the device exist? +if $SOURCE_DIR/gem_alive > /dev/null ; then + echo "module successfully loaded again" +else + echo "failed to reload module successfully" + exit 2 +fi + +# then try to run something +if ! $SOURCE_DIR/gem_exec_nop > /dev/null ; then + echo "failed to execute a simple batch after reload" + exit 3 +fi exit 0 diff --git a/tests/gem_alive.c b/tests/gem_alive.c index d2bcf2a1..390a54fa 100644 --- a/tests/gem_alive.c +++ b/tests/gem_alive.c @@ -14,7 +14,9 @@ int main(void) signal(SIGALRM, SIG_IGN); - fd = drm_open_any(); + fd = __drm_open_any(); + if (fd < 0) + return IGT_EXIT_SKIP; alarm(1); if (ioctl(fd, DRM_IOCTL_I915_GEM_SW_FINISH, &arg) == 0) |