summaryrefslogtreecommitdiff
path: root/tests/drv_hangman.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-12-03 07:45:36 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-12-04 16:35:31 +0100
commit6cf72724e225524cd0a4352ba829ffc578f40a4d (patch)
tree24ebdf35de39303aeee9935e891c9b40b24ffbbd /tests/drv_hangman.c
parentee0808982f40130d29691c37505dafcbf45f9da5 (diff)
tests/drv_hangman: Open drm fd before doing anything
This way we correctly auto-skip instead of falling over the lack of i915 debugfs files first and fail the testcase due to that. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/drv_hangman.c')
-rw-r--r--tests/drv_hangman.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c
index 6caf910b..cd63b97d 100644
--- a/tests/drv_hangman.c
+++ b/tests/drv_hangman.c
@@ -217,10 +217,11 @@ static void test_error_state_basic(void)
{
int fd;
+ fd = drm_open_driver(DRIVER_INTEL);
+
clear_error_state();
assert_error_state_clear();
- fd = drm_open_driver(DRIVER_INTEL);
submit_batch(fd, I915_EXEC_RENDER, true);
close(fd);
@@ -373,9 +374,10 @@ static void test_error_state_capture(unsigned ring_id,
uint64_t offset;
bool cmd_parser;
+ fd = drm_open_driver(DRIVER_INTEL);
+
clear_error_state();
- fd = drm_open_driver(DRIVER_INTEL);
gen = intel_gen(intel_get_drm_devid(fd));
cmd_parser = uses_cmd_parser(fd, gen);