drm/i915: Flush logical context image out to memory upon suspend
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 15 Jul 2016 13:56:20 +0000 (14:56 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 15 Jul 2016 19:41:05 +0000 (20:41 +0100)
commit5ab57c7020697942ea15f45ad14c69cecb164329
tree692b6279e748c7f62b68b9a1cf75bc91e98954e4
parent945657b461ed27621ec6d3ca2f1b9880b34843bd
drm/i915: Flush logical context image out to memory upon suspend

Before suspend, and especially before building the hibernation image, we
need to context image to be coherent in memory. To do this we require
that we perform a context switch to a disposable context (i.e. the
dev_priv->kernel_context) - when that switch is complete, all other
context images will be complete. This leaves the kernel_context image as
incomplete, but fortunately that is disposable and we can do a quick
fixup of the logical state after resuming.

v2: Share the nearly identical code to switch to the kernel context with
eviction.
v3: Explain why we need the switch and reset.

Testcase: igt/gem_exec_suspend # bsw
References: https://bugs.freedesktop.org/show_bug.cgi?id=96526
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1468590980-6186-2-git-send-email-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.c