drm/i915: Call runtime_pm_disable directly
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 30 Sep 2014 08:56:41 +0000 (10:56 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 1 Oct 2014 08:53:00 +0000 (10:53 +0200)
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>
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_runtime_pm.c

index 261fc0b60f25fe05cb218eab38e19ddc5eceafd1..d58c711a55c472491cbcc1c7f223fb4b6254b943 100644 (file)
@@ -1846,12 +1846,10 @@ int i915_driver_unload(struct drm_device *dev)
                return ret;
        }
 
-       intel_runtime_pm_disable(dev_priv);
+       intel_power_domains_fini(dev_priv);
 
        intel_gpu_ips_teardown();
 
-       intel_power_domains_fini(dev_priv);
-
        i915_teardown_sysfs(dev);
 
        WARN_ON(unregister_oom_notifier(&dev_priv->mm.oom_notifier));
index 64fe05e3d1a5868f87ef3fcd57b4781208d63b7d..1deb5d837049aee55b28ac9a6895c1558bf6299c 100644 (file)
@@ -1085,7 +1085,6 @@ int intel_power_domains_init(struct drm_i915_private *);
 void intel_power_domains_fini(struct drm_i915_private *);
 void intel_power_domains_init_hw(struct drm_i915_private *dev_priv);
 void intel_runtime_pm_enable(struct drm_i915_private *dev_priv);
-void intel_runtime_pm_disable(struct drm_i915_private *dev_priv);
 
 bool intel_display_power_is_enabled(struct drm_i915_private *dev_priv,
                                    enum intel_display_power_domain domain);
index 34f91c1c8de65cb0658195dc9eb215f4241483f1..dc63b7890eeffd9b3fa33fd7a5b4098ccafdc54d 100644 (file)
@@ -995,8 +995,26 @@ int intel_power_domains_init(struct drm_i915_private *dev_priv)
        return 0;
 }
 
+static void intel_runtime_pm_disable(struct drm_i915_private *dev_priv)
+{
+       struct drm_device *dev = dev_priv->dev;
+       struct device *device = &dev->pdev->dev;
+
+       if (!HAS_RUNTIME_PM(dev))
+               return;
+
+       if (!intel_enable_rc6(dev))
+               return;
+
+       /* Make sure we're not suspended first. */
+       pm_runtime_get_sync(device);
+       pm_runtime_disable(device);
+}
+
 void intel_power_domains_fini(struct drm_i915_private *dev_priv)
 {
+       intel_runtime_pm_disable(dev_priv);
+
        /* The i915.ko module is still not prepared to be loaded when
         * the power well is not enabled, so just enable it in case
         * we're going to unload/reload. */
@@ -1142,22 +1160,6 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
        pm_runtime_put_autosuspend(device);
 }
 
-void intel_runtime_pm_disable(struct drm_i915_private *dev_priv)
-{
-       struct drm_device *dev = dev_priv->dev;
-       struct device *device = &dev->pdev->dev;
-
-       if (!HAS_RUNTIME_PM(dev))
-               return;
-
-       if (!intel_enable_rc6(dev))
-               return;
-
-       /* Make sure we're not suspended first. */
-       pm_runtime_get_sync(device);
-       pm_runtime_disable(device);
-}
-
 /* Display audio driver power well request */
 int i915_request_power_well(void)
 {