drm/i915: Move fence cancellation to runtime suspend
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 24 Oct 2016 12:42:18 +0000 (13:42 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 24 Oct 2016 12:45:38 +0000 (13:45 +0100)
commit7c108fd8feac9a4f380c22444ff8527e8d25bc75
tree3be7c7d7b51c3820c86fb669554f1d1e5da91d7d
parent2eedfc7d58997cbd7fd747aa757b8ceac8a2dc50
drm/i915: Move fence cancellation to runtime suspend

At the moment, we have dependency on the RPM as a barrier itself in both
i915_gem_release_all_mmaps() and i915_gem_restore_fences().
i915_gem_restore_fences() is also called along !runtime pm paths, but we
can move the markup of lost fences alongside releasing the mmaps into a
common i915_gem_runtime_suspend(). This has the advantage of locating
all the tricky barrier dependencies into one location.

v2: Just mark the fence as invalid (fence->dirty) so that upon waking we
will be sure to clear the fence after use, or restore it to the correct
value before use. This makes sure that if the fence is left intact
across the sleep, we do not leave it pointing to a region of GTT for the
next unsuspecting user.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Imre Deak <imre.deak@linux.intel.com>
Reviewed-by: Imre Deak <imre.deak@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161024124218.18252-5-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
drivers/gpu/drm/i915/i915_gem_fence.c