[Intel-gfx] [PATCH i-g-t 1/2] lib/igt_gt: Add watchdog gem_ctx_set_param ioctl interface

Michel Thierry michel.thierry at intel.com
Thu Feb 23 19:44:20 UTC 2017


Set a watchdog timeout value in a given context.

Signed-off-by: Michel Thierry <michel.thierry at intel.com>
---
 lib/igt_gt.c | 7 +++++++
 lib/igt_gt.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 3bfaf2e4..e30385ec 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -40,6 +40,7 @@
 #include "intel_chipset.h"
 
 #define LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
+#define LOCAL_CONTEXT_PARAM_WATCHDOG	0x6
 
 /**
  * SECTION:igt_gt
@@ -252,6 +253,12 @@ igt_hang_t igt_hang_ctx(int fd,
 		__gem_context_set_param(fd, &param);
 	}
 
+	if (flags & HANG_USE_WATCHDOG) {
+		param.param = LOCAL_CONTEXT_PARAM_WATCHDOG;
+		param.value = 70; // in ms
+		__gem_context_set_param(fd, &param);
+	}
+
 	ban = context_get_ban(fd, ctx);
 
 	if ((flags & HANG_ALLOW_BAN) == 0)
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index c47d0c12..3b824a82 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -48,6 +48,7 @@ igt_hang_t igt_hang_ctx(int fd,
 			uint64_t *offset);
 #define HANG_ALLOW_BAN		BIT(0)
 #define HANG_ALLOW_CAPTURE	BIT(1)
+#define HANG_USE_WATCHDOG	BIT(2)
 
 igt_hang_t igt_hang_ring(int fd, int ring);
 void igt_post_hang_ring(int fd, igt_hang_t arg);
-- 
2.11.0



More information about the Intel-gfx mailing list