aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2015-12-17 12:04:33 -0500
committerImre Deak <imre.deak@intel.com>2015-12-18 08:52:31 -0500
commitcbc68dc9c8bb127e712fa650dc4d5cd3d4349ba1 (patch)
tree4de939a92ba58ae8c9a9790959d000d59dfa0937
parente6cb3727f8b912eae4445a24c2f90df2ea14da78 (diff)
drm/i915: don't enable autosuspend on platforms without RPM support
pm_runtime_{use,dont_use}_autosuspend() controls whether the device's sysfs power/autosuspend_delay_ms file is writeable or returns -EIO on access to user space. Since commit 25b181b46e4340f69793a886f2cd46608487783b Author: Imre Deak <imre.deak@intel.com> Date: Thu Dec 17 13:44:56 2015 +0200 drm/i915: get a permanent RPM reference on platforms w/o RPM support this sysfs file is writeable also on platforms without RPM support, but userspace (at least IGT) depends on this file being unchangable to determine whether the device supports runtime PM at all. So restore the old behavior. This gets rid of igt/pm_rpm failures on old platforms without RPM support, where the test should be skipped. Testcase: igt/pm_rpm/basic-rte Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: David Weinehall <david.weinehall@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1450371873-878-1-git-send-email-imre.deak@intel.com
-rw-r--r--drivers/gpu/drm/i915/intel_runtime_pm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index a0b9eaf77fe9..ddbdbffe829a 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -2309,18 +2309,21 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
2309 struct drm_device *dev = dev_priv->dev; 2309 struct drm_device *dev = dev_priv->dev;
2310 struct device *device = &dev->pdev->dev; 2310 struct device *device = &dev->pdev->dev;
2311 2311
2312 pm_runtime_set_autosuspend_delay(device, 10000); /* 10s */
2313 pm_runtime_mark_last_busy(device);
2314
2312 /* 2315 /*
2313 * Take a permanent reference to disable the RPM functionality and drop 2316 * Take a permanent reference to disable the RPM functionality and drop
2314 * it only when unloading the driver. Use the low level get/put helpers, 2317 * it only when unloading the driver. Use the low level get/put helpers,
2315 * so the driver's own RPM reference tracking asserts also work on 2318 * so the driver's own RPM reference tracking asserts also work on
2316 * platforms without RPM support. 2319 * platforms without RPM support.
2317 */ 2320 */
2318 if (!HAS_RUNTIME_PM(dev)) 2321 if (!HAS_RUNTIME_PM(dev)) {
2322 pm_runtime_dont_use_autosuspend(device);
2319 pm_runtime_get_sync(device); 2323 pm_runtime_get_sync(device);
2320 2324 } else {
2321 pm_runtime_set_autosuspend_delay(device, 10000); /* 10s */ 2325 pm_runtime_use_autosuspend(device);
2322 pm_runtime_mark_last_busy(device); 2326 }
2323 pm_runtime_use_autosuspend(device);
2324 2327
2325 /* 2328 /*
2326 * The core calls the driver load handler with an RPM reference held. 2329 * The core calls the driver load handler with an RPM reference held.