[Intel-gfx] [PATCH 10/20] drm/i915: Watchdog timeout: DRM kernel interface enablement
Arun Siluvery
arun.siluvery at linux.intel.com
Wed Jan 13 09:28:22 PST 2016
From: Tomas Elf <tomas.elf at intel.com>
Final enablement patch for GPU hang recovery using watchdog timeout.
Added execbuf flag for watchdog timeout in DRM kernel interface.
Signed-off-by: Tomas Elf <tomas.elf at intel.com>
---
drivers/gpu/drm/i915/intel_lrc.c | 6 ++----
include/uapi/drm/i915_drm.h | 5 ++++-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 43d424f..cdb1b9a 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1199,10 +1199,6 @@ int intel_execlists_submission(struct i915_execbuffer_params *params,
u32 instp_mask;
int ret;
bool watchdog_running = false;
- /*
- * NB: Place-holder until watchdog timeout is enabled through DRM
- * execbuf interface
- */
bool enable_watchdog = false;
instp_mode = args->flags & I915_EXEC_CONSTANTS_MASK;
@@ -1240,6 +1236,8 @@ int intel_execlists_submission(struct i915_execbuffer_params *params,
if (ret)
return ret;
+ enable_watchdog = args->flags & I915_EXEC_ENABLE_WATCHDOG;
+
/* Start watchdog timer */
if (enable_watchdog) {
if (!intel_ring_supports_watchdog(ring))
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index acf2102..e157cc0 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -782,7 +782,10 @@ struct drm_i915_gem_execbuffer2 {
*/
#define I915_EXEC_RESOURCE_STREAMER (1<<15)
-#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_RESOURCE_STREAMER<<1)
+/* Enable watchdog timer for this batch buffer */
+#define I915_EXEC_ENABLE_WATCHDOG (1<<16)
+
+#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_ENABLE_WATCHDOG<<1)
#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
#define i915_execbuffer2_set_context_id(eb2, context) \
--
1.9.1
More information about the Intel-gfx
mailing list