[4/8] lib/igt_gt: check for presence of GPU reset before using it

Submitted by Ulrich Hecht on March 15, 2018, 2:45 p.m.

Details

Message ID 1521125144-28614-5-git-send-email-ulrich.hecht+renesas@gmail.com
State New
Series "Non-Intel test suite fixes"
Headers show

Commit Message

Ulrich Hecht March 15, 2018, 2:45 p.m.
Fixes failed assertion on non-i915 devices.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
 lib/igt_gt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 9cb07c2..825ea52 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -166,14 +166,15 @@  igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags)
 	struct drm_i915_gem_context_param param;
 	unsigned ban;
 
+	if (!igt_check_boolean_env_var("IGT_HANG_WITHOUT_RESET", false))
+		igt_require(has_gpu_reset(fd));
+
 	igt_assert(igt_sysfs_set_parameter
 		   (fd, "reset", "%d", INT_MAX /* any reset method */));
 
 	if (!igt_check_boolean_env_var("IGT_HANG", true))
 		igt_skip("hang injection disabled by user");
 	gem_context_require_bannable(fd);
-	if (!igt_check_boolean_env_var("IGT_HANG_WITHOUT_RESET", false))
-		igt_require(has_gpu_reset(fd));
 
 	param.ctx_id = ctx;
 	param.size = 0;