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

drm/i915: make runtime PM interrupt enable/disable platform independent

We need to disable the interrupts for all platforms, so make the helpers
for this platform independent and call them from them platform
independent runtime suspend/resume callbacks.

On HSW/BDW this will move interrupt disabling/re-enabling at the
beginning/end of runtime suspend/resume respectively, but I don't see
any reason why this would cause a problem there. In any case this seems
to be the correct thing to do even on those platforms.
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 aeab0b5a
...@@ -916,13 +916,6 @@ static int i915_pm_poweroff(struct device *dev) ...@@ -916,13 +916,6 @@ static int i915_pm_poweroff(struct device *dev)
return i915_drm_freeze(drm_dev); return i915_drm_freeze(drm_dev);
} }
static void snb_runtime_suspend(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = dev_priv->dev;
intel_runtime_pm_disable_interrupts(dev);
}
static void hsw_runtime_suspend(struct drm_i915_private *dev_priv) static void hsw_runtime_suspend(struct drm_i915_private *dev_priv)
{ {
hsw_enable_pc8(dev_priv); hsw_enable_pc8(dev_priv);
...@@ -932,7 +925,6 @@ static void snb_runtime_resume(struct drm_i915_private *dev_priv) ...@@ -932,7 +925,6 @@ static void snb_runtime_resume(struct drm_i915_private *dev_priv)
{ {
struct drm_device *dev = dev_priv->dev; struct drm_device *dev = dev_priv->dev;
intel_runtime_pm_restore_interrupts(dev);
intel_init_pch_refclk(dev); intel_init_pch_refclk(dev);
i915_gem_init_swizzling(dev); i915_gem_init_swizzling(dev);
mutex_lock(&dev_priv->rps.hw_lock); mutex_lock(&dev_priv->rps.hw_lock);
...@@ -959,8 +951,10 @@ static int intel_runtime_suspend(struct device *device) ...@@ -959,8 +951,10 @@ static int intel_runtime_suspend(struct device *device)
DRM_DEBUG_KMS("Suspending device\n"); DRM_DEBUG_KMS("Suspending device\n");
intel_runtime_pm_disable_interrupts(dev);
if (IS_GEN6(dev)) if (IS_GEN6(dev))
snb_runtime_suspend(dev_priv); ;
else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) else if (IS_HASWELL(dev) || IS_BROADWELL(dev))
hsw_runtime_suspend(dev_priv); hsw_runtime_suspend(dev_priv);
else else
...@@ -1004,6 +998,8 @@ static int intel_runtime_resume(struct device *device) ...@@ -1004,6 +998,8 @@ static int intel_runtime_resume(struct device *device)
else else
WARN_ON(1); WARN_ON(1);
intel_runtime_pm_restore_interrupts(dev);
DRM_DEBUG_KMS("Device resumed\n"); DRM_DEBUG_KMS("Device resumed\n");
return 0; return 0;
} }
......
...@@ -7036,7 +7036,6 @@ void hsw_enable_pc8(struct drm_i915_private *dev_priv) ...@@ -7036,7 +7036,6 @@ void hsw_enable_pc8(struct drm_i915_private *dev_priv)
} }
lpt_disable_clkout_dp(dev); lpt_disable_clkout_dp(dev);
intel_runtime_pm_disable_interrupts(dev);
hsw_disable_lcpll(dev_priv, true, true); hsw_disable_lcpll(dev_priv, true, true);
} }
...@@ -7048,7 +7047,6 @@ void hsw_disable_pc8(struct drm_i915_private *dev_priv) ...@@ -7048,7 +7047,6 @@ void hsw_disable_pc8(struct drm_i915_private *dev_priv)
DRM_DEBUG_KMS("Disabling package C8+\n"); DRM_DEBUG_KMS("Disabling package C8+\n");
hsw_restore_lcpll(dev_priv); hsw_restore_lcpll(dev_priv);
intel_runtime_pm_restore_interrupts(dev);
lpt_init_pch_refclk(dev); lpt_init_pch_refclk(dev);
if (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) { if (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) {
......
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