summaryrefslogtreecommitdiff
path: root/tests/drm_lib.sh
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-03 08:10:28 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-03 08:17:18 +0100
commitbc388b54d4325669bfffef314c6f18349c239a1c (patch)
tree997c4c63bb7b6edc550aff94e6a753ed5bd7b18d /tests/drm_lib.sh
parente50ae9596c544c3cca0f32c5eba94c655a1ebcd2 (diff)
drm_lib.sh: Be more precise in detecting the i915 /sys path
We need to be careful in case other devices grow an error file in the future. The first step here is just to check the minor that corresponds with the debugfs path found for the device
Diffstat (limited to 'tests/drm_lib.sh')
-rwxr-xr-xtests/drm_lib.sh18
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index 529cc6bd..5ca815b6 100755
--- a/tests/drm_lib.sh
+++ b/tests/drm_lib.sh
@@ -13,9 +13,9 @@ if [ -d /sys/kernel/debug/dri ] ; then
fi
i915_dfs_path=x
-for dir in `ls $debugfs_path` ; do
- if [ -f $debugfs_path/$dir/i915_error_state ] ; then
- i915_dfs_path=$debugfs_path/$dir
+for minor in `seq 0 16`; do
+ if [ -f $debugfs_path/$minor/i915_error_state ] ; then
+ i915_dfs_path=$debugfs_path/$minor
break
fi
done
@@ -29,15 +29,11 @@ if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then
die "ERROR: other drm clients running"
fi
+i915_sfs_path=
if [ -d /sys/class/drm ] ; then
sysfs_path=/sys/class/drm
-fi
-
-i915_sfs_path=
-for dir in `ls $sysfs_path` ; do
- if [ -f $sysfs_path/$dir/error ] ; then
- i915_sfs_path=$sysfs_path/$dir
- break
+ if [ -f $sysfs_path/card$minor/error ] ; then
+ i915_sfs_path="$sysfs_path/card$minor"
fi
-done
+fi
# sysfs may not exist as the 'error' is a new interface in 3.11