[intel-gpu-tools,3/3] drm-lib: Skip test when not running on i915

Submitted by Micah Fedke on April 21, 2015, 3:03 p.m.

Details

Message ID 1429628629-2727-4-git-send-email-micah.fedke@collabora.co.uk
State New
Headers show

Not browsing as part of any series.

Commit Message

Micah Fedke April 21, 2015, 3:03 p.m.
From: Daniel Stone <daniels@collabora.com>

Since drm_lib.sh tries to access the i915 debugfs path, skip the test if
we find that we have GPUs in debugfs, but none of them are i915.

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 tests/drm_lib.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index c50664c..c35287c 100755
--- a/tests/drm_lib.sh
+++ b/tests/drm_lib.sh
@@ -46,14 +46,23 @@  if [ -d /sys/kernel/debug/dri ] ; then
 fi
 
 i915_dfs_path=x
+found_any=0
 for minor in `seq 0 16`; do
 	if [ -f $debugfs_path/$minor/i915_error_state ] ; then
 		i915_dfs_path=$debugfs_path/$minor
 		break
 	fi
+	if [ -f $debugfs_path/$minor/name ] ; then
+		found_any=1
+	fi
 done
 
 if [ $i915_dfs_path = "x" ] ; then
+	# Found DRM devices in debugfs but not i915; skip the test.
+	if [ $found_any = 1 ]; then
+		exit 77
+	fi
+
 	die " i915 debugfs path not found."
 fi