aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_runtime_pm.c
diff options
context:
space:
mode:
authorDavid Weinehall <david.weinehall@linux.intel.com>2016-08-22 06:32:42 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2016-08-22 07:19:52 -0400
commitc49d13ee13f709852cc05f9035df89e9ffa26108 (patch)
tree9a3e37a5bad0e2beab2031ff5389f46253790d82 /drivers/gpu/drm/i915/intel_runtime_pm.c
parent351c3b53e767b2512461843882f7c6baa8996c4b (diff)
drm/i915: consistent struct device naming
We currently have a mix of struct device *device, struct device *kdev, and struct device *dev (the latter forcing us to refer to struct drm_device as something else than the normal dev). To simplify things, always use kdev when referring to struct device. v2: Replace the dev_to_drm_minor() macro with the inline function kdev_to_drm_minor(). Signed-off-by: David Weinehall <david.weinehall@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20160822103245.24069-3-david.weinehall@linux.intel.com Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_runtime_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_runtime_pm.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index a1d73c2de332..7686b7f1d599 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -2288,7 +2288,7 @@ int intel_power_domains_init(struct drm_i915_private *dev_priv)
2288 */ 2288 */
2289void intel_power_domains_fini(struct drm_i915_private *dev_priv) 2289void intel_power_domains_fini(struct drm_i915_private *dev_priv)
2290{ 2290{
2291 struct device *device = &dev_priv->drm.pdev->dev; 2291 struct device *kdev = &dev_priv->drm.pdev->dev;
2292 2292
2293 /* 2293 /*
2294 * The i915.ko module is still not prepared to be loaded when 2294 * The i915.ko module is still not prepared to be loaded when
@@ -2310,7 +2310,7 @@ void intel_power_domains_fini(struct drm_i915_private *dev_priv)
2310 * the platform doesn't support runtime PM. 2310 * the platform doesn't support runtime PM.
2311 */ 2311 */
2312 if (!HAS_RUNTIME_PM(dev_priv)) 2312 if (!HAS_RUNTIME_PM(dev_priv))
2313 pm_runtime_put(device); 2313 pm_runtime_put(kdev);
2314} 2314}
2315 2315
2316static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv) 2316static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv)
@@ -2652,9 +2652,9 @@ void intel_power_domains_suspend(struct drm_i915_private *dev_priv)
2652void intel_runtime_pm_get(struct drm_i915_private *dev_priv) 2652void intel_runtime_pm_get(struct drm_i915_private *dev_priv)
2653{ 2653{
2654 struct drm_device *dev = &dev_priv->drm; 2654 struct drm_device *dev = &dev_priv->drm;
2655 struct device *device = &dev->pdev->dev; 2655 struct device *kdev = &dev->pdev->dev;
2656 2656
2657 pm_runtime_get_sync(device); 2657 pm_runtime_get_sync(kdev);
2658 2658
2659 atomic_inc(&dev_priv->pm.wakeref_count); 2659 atomic_inc(&dev_priv->pm.wakeref_count);
2660 assert_rpm_wakelock_held(dev_priv); 2660 assert_rpm_wakelock_held(dev_priv);
@@ -2673,10 +2673,10 @@ void intel_runtime_pm_get(struct drm_i915_private *dev_priv)
2673bool intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv) 2673bool intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv)
2674{ 2674{
2675 struct drm_device *dev = &dev_priv->drm; 2675 struct drm_device *dev = &dev_priv->drm;
2676 struct device *device = &dev->pdev->dev; 2676 struct device *kdev = &dev->pdev->dev;
2677 2677
2678 if (IS_ENABLED(CONFIG_PM)) { 2678 if (IS_ENABLED(CONFIG_PM)) {
2679 int ret = pm_runtime_get_if_in_use(device); 2679 int ret = pm_runtime_get_if_in_use(kdev);
2680 2680
2681 /* 2681 /*
2682 * In cases runtime PM is disabled by the RPM core and we get 2682 * In cases runtime PM is disabled by the RPM core and we get
@@ -2715,10 +2715,10 @@ bool intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv)
2715void intel_runtime_pm_get_noresume(struct drm_i915_private *dev_priv) 2715void intel_runtime_pm_get_noresume(struct drm_i915_private *dev_priv)
2716{ 2716{
2717 struct drm_device *dev = &dev_priv->drm; 2717 struct drm_device *dev = &dev_priv->drm;
2718 struct device *device = &dev->pdev->dev; 2718 struct device *kdev = &dev->pdev->dev;
2719 2719
2720 assert_rpm_wakelock_held(dev_priv); 2720 assert_rpm_wakelock_held(dev_priv);
2721 pm_runtime_get_noresume(device); 2721 pm_runtime_get_noresume(kdev);
2722 2722
2723 atomic_inc(&dev_priv->pm.wakeref_count); 2723 atomic_inc(&dev_priv->pm.wakeref_count);
2724} 2724}
@@ -2734,14 +2734,14 @@ void intel_runtime_pm_get_noresume(struct drm_i915_private *dev_priv)
2734void intel_runtime_pm_put(struct drm_i915_private *dev_priv) 2734void intel_runtime_pm_put(struct drm_i915_private *dev_priv)
2735{ 2735{
2736 struct drm_device *dev = &dev_priv->drm; 2736 struct drm_device *dev = &dev_priv->drm;
2737 struct device *device = &dev->pdev->dev; 2737 struct device *kdev = &dev->pdev->dev;
2738 2738
2739 assert_rpm_wakelock_held(dev_priv); 2739 assert_rpm_wakelock_held(dev_priv);
2740 if (atomic_dec_and_test(&dev_priv->pm.wakeref_count)) 2740 if (atomic_dec_and_test(&dev_priv->pm.wakeref_count))
2741 atomic_inc(&dev_priv->pm.atomic_seq); 2741 atomic_inc(&dev_priv->pm.atomic_seq);
2742 2742
2743 pm_runtime_mark_last_busy(device); 2743 pm_runtime_mark_last_busy(kdev);
2744 pm_runtime_put_autosuspend(device); 2744 pm_runtime_put_autosuspend(kdev);
2745} 2745}
2746 2746
2747/** 2747/**
@@ -2757,10 +2757,10 @@ void intel_runtime_pm_put(struct drm_i915_private *dev_priv)
2757void intel_runtime_pm_enable(struct drm_i915_private *dev_priv) 2757void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
2758{ 2758{
2759 struct drm_device *dev = &dev_priv->drm; 2759 struct drm_device *dev = &dev_priv->drm;
2760 struct device *device = &dev->pdev->dev; 2760 struct device *kdev = &dev->pdev->dev;
2761 2761
2762 pm_runtime_set_autosuspend_delay(device, 10000); /* 10s */ 2762 pm_runtime_set_autosuspend_delay(kdev, 10000); /* 10s */
2763 pm_runtime_mark_last_busy(device); 2763 pm_runtime_mark_last_busy(kdev);
2764 2764
2765 /* 2765 /*
2766 * Take a permanent reference to disable the RPM functionality and drop 2766 * Take a permanent reference to disable the RPM functionality and drop
@@ -2769,10 +2769,10 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
2769 * platforms without RPM support. 2769 * platforms without RPM support.
2770 */ 2770 */
2771 if (!HAS_RUNTIME_PM(dev)) { 2771 if (!HAS_RUNTIME_PM(dev)) {
2772 pm_runtime_dont_use_autosuspend(device); 2772 pm_runtime_dont_use_autosuspend(kdev);
2773 pm_runtime_get_sync(device); 2773 pm_runtime_get_sync(kdev);
2774 } else { 2774 } else {
2775 pm_runtime_use_autosuspend(device); 2775 pm_runtime_use_autosuspend(kdev);
2776 } 2776 }
2777 2777
2778 /* 2778 /*
@@ -2780,6 +2780,5 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
2780 * We drop that here and will reacquire it during unloading in 2780 * We drop that here and will reacquire it during unloading in
2781 * intel_power_domains_fini(). 2781 * intel_power_domains_fini().
2782 */ 2782 */
2783 pm_runtime_put_autosuspend(device); 2783 pm_runtime_put_autosuspend(kdev);
2784} 2784}
2785