All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3]: test case + fix for debugfs regression
@ 2012-04-04  6:02 Ben Widawsky
  2012-04-04  6:02 ` [PATCH 1/2] tests: use common code for scripts Ben Widawsky
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ben Widawsky @ 2012-04-04  6:02 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ben Widawsky

I'm having some weirdness with my machine right now. Sending these out
mostly for Daniel. Hopefully they are not too crap like the original
patch.

In other words, these are mostly untested. I'll try again tomorrow if
something blows up.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] tests: use common code for scripts
  2012-04-04  6:02 [PATCH 0/3]: test case + fix for debugfs regression Ben Widawsky
@ 2012-04-04  6:02 ` Ben Widawsky
  2012-04-04  6:02 ` [PATCH 2/2] tests: wedged + error_state read test Ben Widawsky
  2012-04-04  6:03 ` [PATCH] drm/i915: VCS is not the last ring Ben Widawsky
  2 siblings, 0 replies; 7+ messages in thread
From: Ben Widawsky @ 2012-04-04  6:02 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ben Widawsky, Ben Widawsky

This removes cut and pasted code and uses a more central source.

Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
---
 tests/ZZ_hangman         |   22 +---------------------
 tests/check_drm_clients  |   27 +--------------------------
 tests/debugfs_emon_crash |   21 +--------------------
 tests/debugfs_reader     |   21 +--------------------
 tests/drm_lib.sh         |   32 ++++++++++++++++++++++++++++++++
 5 files changed, 36 insertions(+), 87 deletions(-)
 create mode 100755 tests/drm_lib.sh

diff --git a/tests/ZZ_hangman b/tests/ZZ_hangman
index 7afda57..9312724 100755
--- a/tests/ZZ_hangman
+++ b/tests/ZZ_hangman
@@ -6,27 +6,7 @@
 # by reading /sys/kernel/debug/dri/0/i915_emon_status too quickly
 #
 
-if [ -d /debug/dri ] ; then
-	debugfs_path=/debug_dri
-fi
-
-if [ -d /sys/kernel/debug/dri ] ; then
-	debugfs_path=/sys/kernel/debug/dri
-fi
-
-cur_path=`pwd`
-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
+. ./drm_lib.sh
 
 cd $i915_path
 
diff --git a/tests/check_drm_clients b/tests/check_drm_clients
index 3e871ec..00a3485 100755
--- a/tests/check_drm_clients
+++ b/tests/check_drm_clients
@@ -1,30 +1,5 @@
 #!/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
-if [ `cat $i915_path/clients | wc -l` -gt "2" ] ; then
-	echo ERROR: other drm clients running
-	exit 1
-fi
+. ./drm_lib.sh
 
 exit 0
diff --git a/tests/debugfs_emon_crash b/tests/debugfs_emon_crash
index 63e193d..613b55b 100755
--- a/tests/debugfs_emon_crash
+++ b/tests/debugfs_emon_crash
@@ -4,26 +4,7 @@
 # by reading /sys/kernel/debug/dri/0/i915_emon_status too quickly
 #
 
-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
+. ./drm_lib.sh
 
 for z in $(seq 1 1000); do
 	cat $i915_path/i915_emon_status > /dev/null
diff --git a/tests/debugfs_reader b/tests/debugfs_reader
index adb1e3c..1230fa9 100755
--- a/tests/debugfs_reader
+++ b/tests/debugfs_reader
@@ -1,25 +1,6 @@
 #!/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
+. ./drm_lib.sh
 
 # read everything we can
 cat $i915_path/* > /dev/null 2>&1 
diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
new file mode 100755
index 0000000..6b5bdcf
--- /dev/null
+++ b/tests/drm_lib.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+die() {
+	echo "$@"
+	exit 1
+}
+
+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
+	die " i915 debugfs path not found."
+fi
+
+# read everything we can
+if [ `cat $i915_path/clients | wc -l` -gt "2" ] ; then
+	die "ERROR: other drm clients running"
+fi
+
+
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] tests: wedged + error_state read test
  2012-04-04  6:02 [PATCH 0/3]: test case + fix for debugfs regression Ben Widawsky
  2012-04-04  6:02 ` [PATCH 1/2] tests: use common code for scripts Ben Widawsky
@ 2012-04-04  6:02 ` Ben Widawsky
  2012-04-04 10:48   ` Chris Wilson
  2012-04-04  6:03 ` [PATCH] drm/i915: VCS is not the last ring Ben Widawsky
  2 siblings, 1 reply; 7+ messages in thread
From: Ben Widawsky @ 2012-04-04  6:02 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ben Widawsky, Ben Widawsky

A bit quirky because wedged doesn't like being written to by normal users

Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
---
 tests/Makefile.am          |    3 ++-
 tests/ZZ_check_error_state |    9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100755 tests/ZZ_check_error_state

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6544ec7..4cb1093 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -65,6 +65,7 @@ TESTS_scripts = \
 	debugfs_emon_crash \
 	sysfs_edid_timing \
 	ZZ_check_dmesg \
+	ZZ_check_error_state \
 	$(NULL)
 
 kernel_tests = \
@@ -88,7 +89,7 @@ HANG = \
 	$(NULL)
 
 EXTRA_PROGRAMS = $(TESTS_progs) $(HANG)
-EXTRA_DIST = $(TESTS_scripts) check_drm_clients
+EXTRA_DIST = $(TESTS_scripts) drm_lib.sh check_drm_clients
 CLEANFILES = $(EXTRA_PROGRAMS)
 
 AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) \
diff --git a/tests/ZZ_check_error_state b/tests/ZZ_check_error_state
new file mode 100755
index 0000000..48992ed
--- /dev/null
+++ b/tests/ZZ_check_error_state
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. ./drm_lib.sh
+
+# To run this from make test we have to use sudo. That is unfortunate
+#[[ `id -u` -eq "0" ]] || die "You must be root"
+#[[ `echo 1 > ${i915_path}/i915_wedged` ]] || die "Couldn't write to ${i915_path}/i915_wedged"
+[[ `echo 1 | sudo tee ${i915_path}/i915_wedged` ]] || die "Couldn't write to ${i915_path}/i915_wedged"
+cat $i915_path/i915_error_state > /dev/null 2>&1
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] drm/i915: VCS is not the last ring
  2012-04-04  6:02 [PATCH 0/3]: test case + fix for debugfs regression Ben Widawsky
  2012-04-04  6:02 ` [PATCH 1/2] tests: use common code for scripts Ben Widawsky
  2012-04-04  6:02 ` [PATCH 2/2] tests: wedged + error_state read test Ben Widawsky
@ 2012-04-04  6:03 ` Ben Widawsky
  2012-04-04 10:44   ` Daniel Vetter
  2 siblings, 1 reply; 7+ messages in thread
From: Ben Widawsky @ 2012-04-04  6:03 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ben Widawsky, Ben Widawsky

I made a mistake, please forgive me.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48254
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 66c90d4..7bd215e 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -704,7 +704,7 @@ static void i915_ring_error_state(struct seq_file *m,
 				  struct drm_i915_error_state *error,
 				  unsigned ring)
 {
-	BUG_ON(ring > VCS); /* shut up confused gcc */
+	BUG_ON(ring >= I915_NUM_RINGS); /* shut up confused gcc */
 	seq_printf(m, "%s command stream:\n", ring_str(ring));
 	seq_printf(m, "  HEAD: 0x%08x\n", error->head[ring]);
 	seq_printf(m, "  TAIL: 0x%08x\n", error->tail[ring]);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: VCS is not the last ring
  2012-04-04  6:03 ` [PATCH] drm/i915: VCS is not the last ring Ben Widawsky
@ 2012-04-04 10:44   ` Daniel Vetter
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2012-04-04 10:44 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: intel-gfx, Ben Widawsky

On Tue, Apr 03, 2012 at 11:03:00PM -0700, Ben Widawsky wrote:
> I made a mistake, please forgive me.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48254
> Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Forgiven and applied, thanks for the quick fix. I've had to patch-up the
i-g-t changes a bit though (but now I remember again why I didn't do the
bash helper consolidation originally ;-)
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] tests: wedged + error_state read test
  2012-04-04  6:02 ` [PATCH 2/2] tests: wedged + error_state read test Ben Widawsky
@ 2012-04-04 10:48   ` Chris Wilson
  2012-04-04 11:09     ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2012-04-04 10:48 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ben Widawsky, Ben Widawsky

On Tue,  3 Apr 2012 23:02:59 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> +[[ `echo 1 | sudo tee ${i915_path}/i915_wedged` ]] || die "Couldn't write to ${i915_path}/i915_wedged"
echo 1 | sudo tee $(i915_path)/i915_wedged || die ...
> +cat $i915_path/i915_error_state > /dev/null 2>&1
cat $(i915_path)/i915_error_state > /dev/null 2>&1 || die ...

Can we check for gen >= 6 before killing the GPU in an automated test?
Or do we recommend reseting the GPU if i915_wedged remains set?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] tests: wedged + error_state read test
  2012-04-04 10:48   ` Chris Wilson
@ 2012-04-04 11:09     ` Daniel Vetter
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2012-04-04 11:09 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Ben Widawsky, intel-gfx, Ben Widawsky

On Wed, Apr 04, 2012 at 11:48:22AM +0100, Chris Wilson wrote:
> On Tue,  3 Apr 2012 23:02:59 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> > +[[ `echo 1 | sudo tee ${i915_path}/i915_wedged` ]] || die "Couldn't write to ${i915_path}/i915_wedged"
> echo 1 | sudo tee $(i915_path)/i915_wedged || die ...
> > +cat $i915_path/i915_error_state > /dev/null 2>&1
> cat $(i915_path)/i915_error_state > /dev/null 2>&1 || die ...
> 
> Can we check for gen >= 6 before killing the GPU in an automated test?
> Or do we recommend reseting the GPU if i915_wedged remains set?

I've ditched this from the automated test list, fixed up the root
confusion (make test would already check for that), and fixed the bash
sourcing to also work when pwd != i-g-t/tests.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-04 11:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-04  6:02 [PATCH 0/3]: test case + fix for debugfs regression Ben Widawsky
2012-04-04  6:02 ` [PATCH 1/2] tests: use common code for scripts Ben Widawsky
2012-04-04  6:02 ` [PATCH 2/2] tests: wedged + error_state read test Ben Widawsky
2012-04-04 10:48   ` Chris Wilson
2012-04-04 11:09     ` Daniel Vetter
2012-04-04  6:03 ` [PATCH] drm/i915: VCS is not the last ring Ben Widawsky
2012-04-04 10:44   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.