drm/i915/execlists: Handle copying default context state for atomic reset
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 18 May 2018 09:02:11 +0000 (10:02 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 19 May 2018 11:50:58 +0000 (12:50 +0100)
commitfe0c493538f42ee1cbc4701dc6f9eb2b82d856cf
tree22932e4c65bf5a19ac8a233fd16fc10c16017cc3
parentd6d12ec081776bdea7e0ad58f2a7e7f92e414e7f
drm/i915/execlists: Handle copying default context state for atomic reset

We want to be able to reset the GPU from inside a timer callback
(hardirq context). One step requires us to copy the default context
state over to the guilty context, which means we need to plan in advance
to have that object accessible from within an atomic context. The atomic
context prevents us from pinning the object or from peeking into the
shmemfs backing store (all may sleep), so we choose to pin the
default_state into memory when the engine becomes active. This
compromise allows us to swap out the default state when idle, when
required.

References: 5692251c254a ("drm/i915/lrc: Scrub the GPU state of the guilty hanging request")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180518090212.5349-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_engine_cs.c
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.h