diff options
author | Imre Deak <imre.deak@intel.com> | 2014-04-14 13:24:37 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-05-05 03:09:07 -0400 |
commit | b5478bcd5f04c3eef934f506a98c8849bb410cd9 (patch) | |
tree | d52fa7e75e5d52f541fa450f4e1a800728e093fa /drivers/gpu/drm/i915 | |
parent | aeab0b5af7df88284d101abf8d121f0e913b81ff (diff) |
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: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 2 |
2 files changed, 5 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 2d4fc9161cae..ff02b0cf38ce 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -916,13 +916,6 @@ static int i915_pm_poweroff(struct device *dev) | |||
916 | return i915_drm_freeze(drm_dev); | 916 | return i915_drm_freeze(drm_dev); |
917 | } | 917 | } |
918 | 918 | ||
919 | static void snb_runtime_suspend(struct drm_i915_private *dev_priv) | ||
920 | { | ||
921 | struct drm_device *dev = dev_priv->dev; | ||
922 | |||
923 | intel_runtime_pm_disable_interrupts(dev); | ||
924 | } | ||
925 | |||
926 | static void hsw_runtime_suspend(struct drm_i915_private *dev_priv) | 919 | static void hsw_runtime_suspend(struct drm_i915_private *dev_priv) |
927 | { | 920 | { |
928 | hsw_enable_pc8(dev_priv); | 921 | hsw_enable_pc8(dev_priv); |
@@ -932,7 +925,6 @@ static void snb_runtime_resume(struct drm_i915_private *dev_priv) | |||
932 | { | 925 | { |
933 | struct drm_device *dev = dev_priv->dev; | 926 | struct drm_device *dev = dev_priv->dev; |
934 | 927 | ||
935 | intel_runtime_pm_restore_interrupts(dev); | ||
936 | intel_init_pch_refclk(dev); | 928 | intel_init_pch_refclk(dev); |
937 | i915_gem_init_swizzling(dev); | 929 | i915_gem_init_swizzling(dev); |
938 | mutex_lock(&dev_priv->rps.hw_lock); | 930 | mutex_lock(&dev_priv->rps.hw_lock); |
@@ -959,8 +951,10 @@ static int intel_runtime_suspend(struct device *device) | |||
959 | 951 | ||
960 | DRM_DEBUG_KMS("Suspending device\n"); | 952 | DRM_DEBUG_KMS("Suspending device\n"); |
961 | 953 | ||
954 | intel_runtime_pm_disable_interrupts(dev); | ||
955 | |||
962 | if (IS_GEN6(dev)) | 956 | if (IS_GEN6(dev)) |
963 | snb_runtime_suspend(dev_priv); | 957 | ; |
964 | else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) | 958 | else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) |
965 | hsw_runtime_suspend(dev_priv); | 959 | hsw_runtime_suspend(dev_priv); |
966 | else | 960 | else |
@@ -1004,6 +998,8 @@ static int intel_runtime_resume(struct device *device) | |||
1004 | else | 998 | else |
1005 | WARN_ON(1); | 999 | WARN_ON(1); |
1006 | 1000 | ||
1001 | intel_runtime_pm_restore_interrupts(dev); | ||
1002 | |||
1007 | DRM_DEBUG_KMS("Device resumed\n"); | 1003 | DRM_DEBUG_KMS("Device resumed\n"); |
1008 | return 0; | 1004 | return 0; |
1009 | } | 1005 | } |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 8c852ba02f16..a3a3a7eef81f 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -7036,7 +7036,6 @@ void hsw_enable_pc8(struct drm_i915_private *dev_priv) | |||
7036 | } | 7036 | } |
7037 | 7037 | ||
7038 | lpt_disable_clkout_dp(dev); | 7038 | lpt_disable_clkout_dp(dev); |
7039 | intel_runtime_pm_disable_interrupts(dev); | ||
7040 | hsw_disable_lcpll(dev_priv, true, true); | 7039 | hsw_disable_lcpll(dev_priv, true, true); |
7041 | } | 7040 | } |
7042 | 7041 | ||
@@ -7048,7 +7047,6 @@ void hsw_disable_pc8(struct drm_i915_private *dev_priv) | |||
7048 | DRM_DEBUG_KMS("Disabling package C8+\n"); | 7047 | DRM_DEBUG_KMS("Disabling package C8+\n"); |
7049 | 7048 | ||
7050 | hsw_restore_lcpll(dev_priv); | 7049 | hsw_restore_lcpll(dev_priv); |
7051 | intel_runtime_pm_restore_interrupts(dev); | ||
7052 | lpt_init_pch_refclk(dev); | 7050 | lpt_init_pch_refclk(dev); |
7053 | 7051 | ||
7054 | if (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) { | 7052 | if (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) { |