diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-02-25 16:10:28 -0500 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2016-03-02 07:40:46 -0500 |
commit | eda908967feecf7575a8ab74f1695b0445cf324e (patch) | |
tree | 183dd4c3ba4a44d45ac4d7af1b3f51086560df25 | |
parent | bd90123c4973821775d7ffae9891ad36017702a9 (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.
Fixes: 09731280028c ("drm/i915: Add helper to get a display power ref if it was already enabled")
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>
(cherry picked from commit 135dc79efbc119ea5fb34475996983159e6ca31c)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_runtime_pm.c | 26 |
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 ef8d24d9a50f..4f43d9b32e66 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c | |||
@@ -2349,22 +2349,20 @@ bool intel_runtime_pm_get_if_in_use(struct drm_i915_private *dev_priv) | |||
2349 | { | 2349 | { |
2350 | struct drm_device *dev = dev_priv->dev; | 2350 | struct drm_device *dev = dev_priv->dev; |
2351 | struct device *device = &dev->pdev->dev; | 2351 | struct device *device = &dev->pdev->dev; |
2352 | int ret; | ||
2353 | 2352 | ||
2354 | if (!IS_ENABLED(CONFIG_PM)) | 2353 | if (IS_ENABLED(CONFIG_PM)) { |
2355 | return true; | 2354 | int ret = pm_runtime_get_if_in_use(device); |
2356 | 2355 | ||
2357 | ret = pm_runtime_get_if_in_use(device); | 2356 | /* |
2358 | 2357 | * In cases runtime PM is disabled by the RPM core and we get | |
2359 | /* | 2358 | * an -EINVAL return value we are not supposed to call this |
2360 | * In cases runtime PM is disabled by the RPM core and we get an | 2359 | * function, since the power state is undefined. This applies |
2361 | * -EINVAL return value we are not supposed to call this function, | 2360 | * atm to the late/early system suspend/resume handlers. |
2362 | * since the power state is undefined. This applies atm to the | 2361 | */ |
2363 | * late/early system suspend/resume handlers. | 2362 | WARN_ON_ONCE(ret < 0); |
2364 | */ | 2363 | if (ret <= 0) |
2365 | WARN_ON_ONCE(ret < 0); | 2364 | return false; |
2366 | if (ret <= 0) | 2365 | } |
2367 | return false; | ||
2368 | 2366 | ||
2369 | atomic_inc(&dev_priv->pm.wakeref_count); | 2367 | atomic_inc(&dev_priv->pm.wakeref_count); |
2370 | assert_rpm_wakelock_held(dev_priv); | 2368 | assert_rpm_wakelock_held(dev_priv); |