summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-20 10:02:38 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-10-20 10:07:24 +0100
commit800aedb69b3aefbbd0576834917c06e1addfe769 (patch)
tree4834dc541525c52d3f2e8e623d8917eecf83b554
parentf7408bfa7a2255080ad70916b6643886c863acc5 (diff)
igt/drv_hangman: Use manual error-state generation
For the basic error state, we only desire that an error state be created following a hang. For that purpose, we do not need a real hang (slow 6-12s) but can inject one instead (fast <1s). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--tests/drv_hangman.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c
index 953a4c61..bfe5eaf6 100644
--- a/tests/drv_hangman.c
+++ b/tests/drv_hangman.c
@@ -32,6 +32,8 @@
#include <sys/stat.h>
#include <fcntl.h>
+#include "igt_debugfs.h"
+
#ifndef I915_PARAM_CMD_PARSER_VERSION
#define I915_PARAM_CMD_PARSER_VERSION 28
#endif
@@ -166,15 +168,21 @@ static void test_error_state_basic(void)
{
int fd;
- fd = drm_open_driver(DRIVER_INTEL);
-
clear_error_state();
assert_error_state_clear();
- submit_hang(fd, I915_EXEC_RENDER);
+ /* Manually trigger a hang by request a reset */
+ fd = igt_debugfs_open("i915_wedged", O_WRONLY);
+ igt_ignore_warn(write(fd, "1\n", 2));
+ close(fd);
+
+ /* Wait for the error capture and gpu reset to complete */
+ fd = drm_open_driver(DRIVER_INTEL);
+ gem_quiescent_gpu(fd);
close(fd);
assert_error_state_collected();
+
clear_error_state();
assert_error_state_clear();
}