3 # hacked-up long option parsing
21 $@ > /dev/null 2>&1 || (echo "FAIL: $@ ($?)" && exit -1)
24 if [ -d /debug/dri ] ; then
25 debugfs_path=/debug/dri
28 if [ -d /sys/kernel/debug/dri ] ; then
29 debugfs_path=/sys/kernel/debug/dri
33 for minor in `seq 0 16`; do
34 if [ -f $debugfs_path/$minor/i915_error_state ] ; then
35 i915_dfs_path=$debugfs_path/$minor
40 if [ $i915_dfs_path = "x" ] ; then
41 die " i915 debugfs path not found."
44 # read everything we can
45 if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then
46 [ -n "$DRM_LIB_ALLOW_NO_MASTER" ] || \
47 die "ERROR: other drm clients running"
50 whoami | grep -q root || ( echo ERROR: not running as root; exit 1 )
53 if [ -d /sys/class/drm ] ; then
54 sysfs_path=/sys/class/drm
55 if [ -f $sysfs_path/card$minor/error ] ; then
56 i915_sfs_path="$sysfs_path/card$minor"
59 # sysfs may not exist as the 'error' is a new interface in 3.11
61 function drmtest_skip_on_simulation()
63 [ -n "$INTEL_SIMULATION" ] && exit 77
66 drmtest_skip_on_simulation