drm/i915: Copy user requested buffers into the error state
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 15 Apr 2017 09:39:02 +0000 (10:39 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 15 Apr 2017 11:39:57 +0000 (12:39 +0100)
commitb0fd47adc6233e4c198a97e1ddb05accd31eeacb
treef99e371e5d15c0ab0783a2a0bc7467f5f7a8c4b7
parentf4bf77b49516e12e89c7de89a343accd6cbe87f2
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 <ben@bwidawsk.net>
Testcase: igt/gem_exec_capture
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: Matt Turner <mattst88@gmail.com>
Acked-by: Ben Widawsky <ben@bwidawsk.net>
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170415093902.22581-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem_execbuffer.c
drivers/gpu/drm/i915/i915_gem_request.c
drivers/gpu/drm/i915/i915_gem_request.h
drivers/gpu/drm/i915/i915_gpu_error.c
include/uapi/drm/i915_drm.h