summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.c
diff options
context:
space:
mode:
authorChris Wilson2016-10-24 14:42:18 +0200
committerChris Wilson2016-10-24 14:45:38 +0200
commit7c108fd8feac9a4f380c22444ff8527e8d25bc75 (patch)
tree3be7c7d7b51c3820c86fb669554f1d1e5da91d7d /drivers/gpu/drm/i915/i915_drv.c
parentdrm/i915: Remove RPM sequence checking (diff)
downloadkernel-qcow2-linux-7c108fd8feac9a4f380c22444ff8527e8d25bc75.tar.gz
kernel-qcow2-linux-7c108fd8feac9a4f380c22444ff8527e8d25bc75.tar.xz
kernel-qcow2-linux-7c108fd8feac9a4f380c22444ff8527e8d25bc75.zip
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
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 885d33f341f3..99e4e044e958 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -2278,10 +2278,8 @@ static int vlv_resume_prepare(struct drm_i915_private *dev_priv,
vlv_check_no_gt_access(dev_priv);
- if (rpm_resume) {
+ if (rpm_resume)
intel_init_clock_gating(dev);
- i915_gem_restore_fences(dev);
- }
return ret;
}
@@ -2307,7 +2305,7 @@ static int intel_runtime_suspend(struct device *kdev)
* We are safe here against re-faults, since the fault handler takes
* an RPM reference.
*/
- i915_gem_release_all_mmaps(dev_priv);
+ i915_gem_runtime_suspend(dev_priv);
intel_guc_suspend(dev);