diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-23 12:32:43 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-04 09:54:21 +0100 |
commit | b53f22cee7323df6984f2d34464b51264a92ef2a (patch) | |
tree | e637937dd06c6b62ada9abe71e11b0e7a6ae573b /tests | |
parent | 11d5859b28727e1dac9d5b15b3027938a7023067 (diff) |
tests: Simulate missed breadcrumb irqs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rwxr-xr-x | tests/ZZ_missed_irq | 70 |
2 files changed, 71 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 99d98d6c..b595a0b2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -132,6 +132,7 @@ TESTS_scripts = \ test_rte_check \ tools_test \ ZZ_hangman \ + ZZ_missed_irq \ $(NULL) # This target contains testcases which support automagic subtest enumeration diff --git a/tests/ZZ_missed_irq b/tests/ZZ_missed_irq new file mode 100755 index 00000000..86c0123a --- /dev/null +++ b/tests/ZZ_missed_irq @@ -0,0 +1,70 @@ +#!/bin/bash +# +# Testcase: Simulate missed breadcrumb interrupts +# + +SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" +test $SOURCE_DIR = . && SOURCE_DIR="`pwd`" +. $SOURCE_DIR/drm_lib.sh +cd $i915_dfs_path + +echo $SOURCE_DIR + +function check_for_missed_irq { + if test `cat i915_ring_missed_irq` = 0x00000000; then + echo "missed interrupts undetected" + exit 1 + fi +} + +function check_for_hang { + if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then + echo "gpu hang reported" + exit 2 + fi +} + +if [ ! -f i915_ring_missed_irq ] ; then + echo "kernel doesn't support interrupt masking" + exit 77 +fi + +# clear error state first +echo > i915_error_state +check_for_hang + +echo 0xf > i915_ring_test_irq +echo "Interrupts masked" +if test `cat i915_ring_test_irq` != 0x0000000f; then + echo "Failed to set interrupt mask" + exit 3 +fi + +$SOURCE_DIR/gem_exec_big > /dev/null + +check_for_missed_irq +check_for_hang + +$SOURCE_DIR/gem_exec_big > /dev/null + +check_for_hang + +echo 0 > i915_ring_test_irq +echo "Interrupts unmasked" +if test `cat i915_ring_test_irq` != 0x00000000; then + echo "Failed to clear interrupt mask" + exit 3 +fi + +$SOURCE_DIR/gem_exec_big > /dev/null + +check_for_hang + +echo 0 > i915_ring_missed_irq +echo "Cleared missed interrupts" +if test `cat i915_ring_missed_irq` != 0x00000000; then + echo "Failed to clear missed interrupts" + exit 3 +fi + +exit 0 |