diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-30 04:56:41 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-10-01 04:53:00 -0400 |
commit | 41373cd53fdeb658fadd8cd0313591ce49e4342f (patch) | |
tree | 09ea05e911ffc65e954d0f3f48404676c299287e /drivers/gpu/drm/i915/intel_runtime_pm.c | |
parent | d9bc89d9e39c2c1a76cd37b5e8cc1592a7898848 (diff) |
drm/i915: Call runtime_pm_disable directly
Allows us to mark it static and so forgoe the kerneldoc for it.
Note that intel_power_domains_fini is also called from failure paths
in the driver load sequence. But the call to runtime_pm_disable for
that is harmless since by default runtime pm is already disabled.
v2: Augment the commit message as discussed with Imre on irc.
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_runtime_pm.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_runtime_pm.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index 34f91c1c8de6..dc63b7890eef 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c | |||
@@ -995,8 +995,26 @@ int intel_power_domains_init(struct drm_i915_private *dev_priv) | |||
995 | return 0; | 995 | return 0; |
996 | } | 996 | } |
997 | 997 | ||
998 | static void intel_runtime_pm_disable(struct drm_i915_private *dev_priv) | ||
999 | { | ||
1000 | struct drm_device *dev = dev_priv->dev; | ||
1001 | struct device *device = &dev->pdev->dev; | ||
1002 | |||
1003 | if (!HAS_RUNTIME_PM(dev)) | ||
1004 | return; | ||
1005 | |||
1006 | if (!intel_enable_rc6(dev)) | ||
1007 | return; | ||
1008 | |||
1009 | /* Make sure we're not suspended first. */ | ||
1010 | pm_runtime_get_sync(device); | ||
1011 | pm_runtime_disable(device); | ||
1012 | } | ||
1013 | |||
998 | void intel_power_domains_fini(struct drm_i915_private *dev_priv) | 1014 | void intel_power_domains_fini(struct drm_i915_private *dev_priv) |
999 | { | 1015 | { |
1016 | intel_runtime_pm_disable(dev_priv); | ||
1017 | |||
1000 | /* The i915.ko module is still not prepared to be loaded when | 1018 | /* The i915.ko module is still not prepared to be loaded when |
1001 | * the power well is not enabled, so just enable it in case | 1019 | * the power well is not enabled, so just enable it in case |
1002 | * we're going to unload/reload. */ | 1020 | * we're going to unload/reload. */ |
@@ -1142,22 +1160,6 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv) | |||
1142 | pm_runtime_put_autosuspend(device); | 1160 | pm_runtime_put_autosuspend(device); |
1143 | } | 1161 | } |
1144 | 1162 | ||
1145 | void intel_runtime_pm_disable(struct drm_i915_private *dev_priv) | ||
1146 | { | ||
1147 | struct drm_device *dev = dev_priv->dev; | ||
1148 | struct device *device = &dev->pdev->dev; | ||
1149 | |||
1150 | if (!HAS_RUNTIME_PM(dev)) | ||
1151 | return; | ||
1152 | |||
1153 | if (!intel_enable_rc6(dev)) | ||
1154 | return; | ||
1155 | |||
1156 | /* Make sure we're not suspended first. */ | ||
1157 | pm_runtime_get_sync(device); | ||
1158 | pm_runtime_disable(device); | ||
1159 | } | ||
1160 | |||
1161 | /* Display audio driver power well request */ | 1163 | /* Display audio driver power well request */ |
1162 | int i915_request_power_well(void) | 1164 | int i915_request_power_well(void) |
1163 | { | 1165 | { |