mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 17:36:11 +00:00
Improve the busy-load for triggering a wait-on-interrupt and check for extraneous missed-interrupts before and after our tests. References: https://bugs.freedesktop.org/show_bug.cgi?id=88437 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
81 lines
1.6 KiB
Bash
Executable File
81 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Testcase: Simulate missed breadcrumb interrupts
|
|
#
|
|
|
|
SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
|
|
. $SOURCE_DIR/drm_lib.sh
|
|
|
|
oldpath=`pwd`
|
|
|
|
cd $i915_dfs_path
|
|
|
|
function blt_wait {
|
|
$oldpath/$SOURCE_DIR/../benchmarks/gem_blt -r 1 -b 64 -t 1 -S > /dev/null
|
|
}
|
|
|
|
function check_for_missed_irq {
|
|
test `cat i915_ring_missed_irq` != 0x00000000
|
|
}
|
|
|
|
function check_for_hang {
|
|
if cat i915_error_state | grep -v "no error state collected" > /dev/null ; then
|
|
echo "gpu hang reported"
|
|
exit $IGT_EXIT_FAILURE
|
|
fi
|
|
}
|
|
|
|
if [ ! -f i915_ring_missed_irq ] ; then
|
|
echo "kernel doesn't support interrupt masking"
|
|
exit $IGT_EXIT_SKIP
|
|
fi
|
|
|
|
# clear error state first
|
|
echo > i915_error_state
|
|
blt_wait
|
|
if check_for_missed_irq; then
|
|
echo "missed interrupts detected before starting test"
|
|
exit $IGT_EXIT_SKOP
|
|
fi
|
|
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 $IGT_EXIT_FAILURE
|
|
fi
|
|
|
|
blt_wait
|
|
if ! check_for_missed_irq; then
|
|
echo "missed interrupts undetected"
|
|
exit $IGT_EXIT_FAILURE
|
|
fi
|
|
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 $IGT_EXIT_FAILURE
|
|
fi
|
|
|
|
blt_wait
|
|
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 $IGT_EXIT_FAILURE
|
|
fi
|
|
|
|
blt_wait
|
|
if check_for_missed_irq; then
|
|
echo "missed interrupts detected afterwards"
|
|
exit $IGT_EXIT_FAILURE
|
|
fi
|
|
check_for_hang
|
|
|
|
exit $IGT_EXIT_SUCCESS
|