summaryrefslogtreecommitdiff
path: root/tests/drm_lib.sh
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@linux.intel.com>2013-06-27 16:54:43 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-07-01 18:54:53 +0200
commit6fd652ac1db1b572af6cc4a040ca357707503f5b (patch)
treeab60214a10127a97d1939aedf320f062439dd722 /tests/drm_lib.sh
parent3743a0b994a4e6035d9370ec658b70e0a8528c4a (diff)
tests: add i915_sfs_path
To access 'error_state' through sysfs. Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/drm_lib.sh')
-rwxr-xr-xtests/drm_lib.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index 7eaf34e6..72da4ad4 100755
--- a/tests/drm_lib.sh
+++ b/tests/drm_lib.sh
@@ -29,4 +29,19 @@ if [ `cat $i915_dfs_path/clients | wc -l` -gt "2" ] ; then
die "ERROR: other drm clients running"
fi
+if [ -d /sys/class/drm ] ; then
+ sysfs_path=/sys/class/drm
+fi
+
+i915_sfs_path=x
+for dir in `ls $sysfs_path` ; do
+ if [ -f $sysfs_path/$dir/error_state ] ; then
+ i915_sfs_path=$sysfs_path/$dir
+ break
+ fi
+done
+
+if [ $i915_sfs_path = "x" ] ; then
+ die " i915 sysfs path not found."
+fi