Commit f4a12ead authored by Imre Deak's avatar Imre Deak Committed by Daniel Vetter

drm/i915: remove unused restore_gtt_mappings optimization during suspend

The logic to skip restoring GTT mappings was added to speed up
suspend/resume, but not on old GENs where not restoring them caused
problems. The check for old GENs is based on the existence of OpRegion,
but this doesn't work since opregion is initialized only after
the check. So we end up always restoring the mappings.

On my BYT - which has OpRegion - skipping restoring the mappings during
suspend doesn't work, I get a GPU hang after resume. Also the logic of
when to allow the optimization during S4 is reversed: we should allow it
during S4 thaw but not during S4 restore, but atm we have it the other
way around in the code.

Since correctness wins over optimal code and since the optimization
wasn't used anyway I decided not to try to fix it at this point, but
just remove it. This allows us to unify the S3 and S4 handlers in the
following patches.
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 097dd837
...@@ -689,12 +689,11 @@ static int i915_drm_thaw_early(struct drm_device *dev) ...@@ -689,12 +689,11 @@ static int i915_drm_thaw_early(struct drm_device *dev)
return ret; return ret;
} }
static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings) static int __i915_drm_thaw(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
if (drm_core_check_feature(dev, DRIVER_MODESET) && if (drm_core_check_feature(dev, DRIVER_MODESET)) {
restore_gtt_mappings) {
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
i915_gem_restore_gtt_mappings(dev); i915_gem_restore_gtt_mappings(dev);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
...@@ -761,7 +760,7 @@ static int i915_drm_thaw(struct drm_device *dev) ...@@ -761,7 +760,7 @@ static int i915_drm_thaw(struct drm_device *dev)
if (drm_core_check_feature(dev, DRIVER_MODESET)) if (drm_core_check_feature(dev, DRIVER_MODESET))
i915_check_and_clear_faults(dev); i915_check_and_clear_faults(dev);
return __i915_drm_thaw(dev, true); return __i915_drm_thaw(dev);
} }
static int i915_resume_early(struct drm_device *dev) static int i915_resume_early(struct drm_device *dev)
...@@ -785,15 +784,9 @@ static int i915_resume_early(struct drm_device *dev) ...@@ -785,15 +784,9 @@ static int i915_resume_early(struct drm_device *dev)
static int i915_drm_resume(struct drm_device *dev) static int i915_drm_resume(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private;
int ret; int ret;
/* ret = __i915_drm_thaw(dev);
* Platforms with opregion should have sane BIOS, older ones (gen3 and
* earlier) need to restore the GTT mappings since the BIOS might clear
* all our scratch PTEs.
*/
ret = __i915_drm_thaw(dev, !dev_priv->opregion.header);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment