path: root/include/uapi/drm/i915_drm.h
diff options
authorChris Wilson <>2017-04-15 10:39:02 +0100
committerChris Wilson <>2017-04-15 12:39:57 +0100
commitb0fd47adc6233e4c198a97e1ddb05accd31eeacb (patch)
treef99e371e5d15c0ab0783a2a0bc7467f5f7a8c4b7 /include/uapi/drm/i915_drm.h
parentf4bf77b49516e12e89c7de89a343accd6cbe87f2 (diff)
drm/i915: Copy user requested buffers into the error state
Introduce a new execobject.flag (EXEC_OBJECT_CAPTURE) that userspace may use to indicate that it wants the contents of this buffer preserved in the error state (/sys/class/drm/cardN/error) following a GPU hang involving this batch. Use this at your discretion, the contents of the error state. although compressed, are allocated with GFP_ATOMIC (i.e. limited) and kept for all eternity (until the error state is destroyed). Based on an earlier patch by Ben Widawsky <> Testcase: igt/gem_exec_capture Signed-off-by: Chris Wilson <> Cc: Ben Widawsky <> Cc: Matt Turner <> Acked-by: Ben Widawsky <> Acked-by: Matt Turner <> Reviewed-by: Joonas Lahtinen <> Link:
Diffstat (limited to 'include/uapi/drm/i915_drm.h')
1 files changed, 14 insertions, 1 deletions
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 9ee06ec8a2d6..f24a80d2d42e 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -412,6 +412,12 @@ typedef struct drm_i915_irq_wait {
#define I915_PARAM_HAS_EXEC_FENCE 44
+/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to capture
+ * user specified bufffers for post-mortem debugging of GPU hangs. See
+ */
typedef struct drm_i915_getparam {
__s32 param;
@@ -775,8 +781,15 @@ struct drm_i915_gem_exec_object2 {
* I915_PARAM_HAS_EXEC_FENCE to order execbufs and execute them asynchronously.
#define EXEC_OBJECT_ASYNC (1<<6)
+/* Request that the contents of this execobject be copied into the error
+ * state upon a GPU hang involving this batch for post-mortem debugging.
+ * These buffers are recorded in no particular order as "user" in
+ * /sys/class/drm/cardN/error. Query I915_PARAM_HAS_EXEC_CAPTURE to see
+ * if the kernel supports this flag.
+ */
+#define EXEC_OBJECT_CAPTURE (1<<7)
/* All remaining bits are MBZ and RESERVED FOR FUTURE USE */
__u64 flags;
union {