aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_runtime_pm.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-02-25 16:10:28 -0500
committerImre Deak <imre.deak@intel.com>2016-02-26 08:11:40 -0500
commit135dc79efbc119ea5fb34475996983159e6ca31c (patch)
tree0b9fd8eaf2a4f8d599849a7df3b10fc46705cbc2 /drivers/gpu/drm/i915/intel_runtime_pm.c
parent99cf8ea16595ecf14d81c8afe165154cec035400 (diff)
drm/i915: Balance assert_rpm_wakelock_held() for !IS_ENABLED(CONFIG_PM)
commit 09731280028ce03e6a27e1998137f1775a2839f3 Author: Imre Deak <imre.deak@intel.com> Date: Wed Feb 17 14:17:42 2016 +0200 drm/i915: Add helper to get a display power ref if it was already enabled left the rpm wakelock assertions unbalanced if CONFIG_PM was disabled as intel_runtime_pm_get_if_in_use() would return true without incrementing the local bookkeeping required for the assertions. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> CC: Mika Kuoppala <mika.kuoppala@intel.com> CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> CC: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Imre Deak <imre.deak@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1456434628-22574-1-git-send-email-chris@chris-wilson.co.uk Reviewed-by: Imre Deak <imre.deak@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_runtime_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_runtime_pm.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index e2329768902c..4172e73212cd 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -2365,22 +2365,20 @@ bool intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv)
2365{ 2365{
2366 struct drm_device *dev = dev_priv->dev; 2366 struct drm_device *dev = dev_priv->dev;
2367 struct device *device = &dev->pdev->dev; 2367 struct device *device = &dev->pdev->dev;
2368 int ret;
2369 2368
2370 if (!IS_ENABLED(CONFIG_PM)) 2369 if (IS_ENABLED(CONFIG_PM)) {
2371 return true; 2370 int ret = pm_runtime_get_if_in_use(device);
2372 2371
2373 ret = pm_runtime_get_if_in_use(device); 2372 /*
2374 2373 * In cases runtime PM is disabled by the RPM core and we get
2375 /* 2374 * an -EINVAL return value we are not supposed to call this
2376 * In cases runtime PM is disabled by the RPM core and we get an 2375 * function, since the power state is undefined. This applies
2377 * -EINVAL return value we are not supposed to call this function, 2376 * atm to the late/early system suspend/resume handlers.
2378 * since the power state is undefined. This applies atm to the 2377 */
2379 * late/early system suspend/resume handlers. 2378 WARN_ON_ONCE(ret < 0);
2380 */ 2379 if (ret <= 0)
2381 WARN_ON_ONCE(ret < 0); 2380 return false;
2382 if (ret <= 0) 2381 }
2383 return false;
2384 2382
2385 atomic_inc(&dev_priv->pm.wakeref_count); 2383 atomic_inc(&dev_priv->pm.wakeref_count);
2386 assert_rpm_wakelock_held(dev_priv); 2384 assert_rpm_wakelock_held(dev_priv);