[Intel-gfx] [PATCH 2/3] tests: add i915_sfs_path

Mika Kuoppala mika.kuoppala at linux.intel.com
Thu Jun 27 15:54:43 CEST 2013


To access 'error_state' through sysfs.

Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
---
 tests/drm_lib.sh |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index 7eaf34e..72da4ad 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
 
-- 
1.7.9.5




More information about the Intel-gfx mailing list