diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-11-02 12:22:37 +0100 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-11-04 19:49:10 +0100 |
| commit | c32032111aa701061acb7c3247b6cf7696272501 (patch) | |
| tree | e28792722f7b4f53f668f2013c146d5093808441 /tests/drv_module_reload | |
| parent | d983f9934513740f72bd6f9e3ad1007e60435aec (diff) | |
tests: estbalish drv_ prefix
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/drv_module_reload')
| -rwxr-xr-x | tests/drv_module_reload | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/drv_module_reload b/tests/drv_module_reload new file mode 100755 index 00000000..c1fd3957 --- /dev/null +++ b/tests/drv_module_reload @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Testcase: Reload the drm module +# +# ... we've broken this way too often :( +# + +SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" +. $SOURCE_DIR/drm_lib.sh + +# no other drm service should be running, so we can just unbind + +# vtcon0 is vga, vtcon1 fbcon and let's pray that won't change due to boot load +# time changes +if ! echo 0 > /sys/class/vtconsole/vtcon1/bind ; then + echo -e "no kms unload support" + echo "please enable CONFIG_VT_HW_CONSOLE_BINDING in the kernel" + exit 77 +fi + +# The sound driver uses our power well +pkill alsactl +rmmod snd_hda_intel &> /dev/null + +#ignore errors in ips - gen5 only +rmmod intel_ips &> /dev/null +rmmod i915 +#ignore errors in intel-gtt, often built-in +rmmod intel-gtt &> /dev/null +# drm may be used by other devices (nouveau, radeon, udl, etc) +rmmod drm_kms_helper &> /dev/null +rmmod drm &> /dev/null + +if lsmod | grep i915 &> /dev/null ; then + echo WARNING: i915.ko still loaded! + exitcode=1 +else + echo module successfully unloaded + exitcode=0 +fi + +modprobe i915 +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" + +exit $exitcode |
