summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2011-10-30 20:51:03 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2011-10-30 20:54:18 +0100
commitf361664df024e7d30ef94221304207991c2ebb6c (patch)
treeedcd09f487a12f7bb2adc9b135e059a0bf3f2e30
parent5b8bbc950d411ea30ebe14e6d001f1eb3204f8b1 (diff)
tests: add test to read all debugfs files
Catches a bunch of forcewake warnings on snb+ Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--tests/Makefile.am13
-rwxr-xr-xtests/debugfs_reader27
2 files changed, 36 insertions, 4 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 288baae..27ee014 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,7 +1,7 @@
if HAVE_DRM
noinst_PROGRAMS = \
gem_stress \
- $(TESTS) \
+ $(TESTS_progs) \
$(HANG) \
$(NULL)
@@ -14,7 +14,8 @@ gem_stress_SOURCES = \
gem_stress_gen6.c \
$(NULL)
-TESTS = getversion \
+TESTS_progs = \
+ getversion \
getclient \
getstats \
gem_basic \
@@ -55,13 +56,17 @@ TESTS = getversion \
gem_unref_active_buffers \
$(NULL)
+TESTS = $(TESTS_progs) \
+ debugfs_reader \
+ $(NULL)
+
HANG = \
gem_bad_batch \
gem_hang \
gem_bad_blit \
$(NULL)
-EXTRA_PROGRAMS = $(TESTS) $(HANG)
+EXTRA_PROGRAMS = $(TESTS_progs) $(HANG)
CLEANFILES = $(EXTRA_PROGRAMS)
AM_CFLAGS = $(DRM_CFLAGS) $(WARN_CFLAGS) \
@@ -72,7 +77,7 @@ LDADD = ../lib/libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS)
if HAVE_CAIRO
if HAVE_LIBUDEV
if HAVE_GLIB
-TESTS += testdisplay
+TESTS_progs += testdisplay
LDADD += $(CAIRO_LIBS) $(LIBUDEV_LIBS) $(GLIB_LIBS)
AM_CFLAGS += $(CAIRO_CFLAGS) $(LIBUDEV_CFLAGS) $(GLIB_CFLAGS)
endif
diff --git a/tests/debugfs_reader b/tests/debugfs_reader
new file mode 100755
index 0000000..8874185
--- /dev/null
+++ b/tests/debugfs_reader
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+if [ -d /debug/dri ] ; then
+ debugfs_path=/debug_dri
+fi
+
+if [ -d /sys/kernel/debug/dri ] ; then
+ debugfs_path=/sys/kernel/debug/dri
+fi
+
+i915_path=x
+for dir in `ls $debugfs_path` ; do
+ if [ -f $debugfs_path/$dir/i915_error_state ] ; then
+ i915_path=$debugfs_path/$dir
+ break
+ fi
+done
+
+if [ $i915_path = "x" ] ; then
+ echo i915 debugfs path not found.
+ exit 1
+fi
+
+# read everything we can
+cat $i915_path/* >& /dev/null
+
+exit 0