aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2015-12-15 13:10:29 -0500
committerImre Deak <imre.deak@intel.com>2015-12-17 08:41:00 -0500
commitaabee1bbc11db3f7238e0fef8f1bf280920f98f4 (patch)
treee97eb9f6dfba28e7b1b453f63906939d3e211af0
parent04ebaadb9f2dc66df29db6af14da2912e1e25db7 (diff)
drm/i915: clarify comment about mandatory RPM put/get during driver load/unload
Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1450203038-5150-2-git-send-email-imre.deak@intel.com
-rw-r--r--drivers/gpu/drm/i915/intel_runtime_pm.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 2c2151f1c47e..9945040fa45f 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -1975,9 +1975,15 @@ int intel_power_domains_init(struct drm_i915_private *dev_priv)
1975 */ 1975 */
1976void intel_power_domains_fini(struct drm_i915_private *dev_priv) 1976void intel_power_domains_fini(struct drm_i915_private *dev_priv)
1977{ 1977{
1978 /* The i915.ko module is still not prepared to be loaded when 1978 /*
1979 * The i915.ko module is still not prepared to be loaded when
1979 * the power well is not enabled, so just enable it in case 1980 * the power well is not enabled, so just enable it in case
1980 * we're going to unload/reload. */ 1981 * we're going to unload/reload.
1982 * The following also reacquires the RPM reference the core passed
1983 * to the driver during loading, which is dropped in
1984 * intel_runtime_pm_enable(). We have to hand back the control of the
1985 * device to the core with this reference held.
1986 */
1981 intel_display_set_init_power(dev_priv, true); 1987 intel_display_set_init_power(dev_priv, true);
1982 1988
1983 /* Remove the refcount we took to keep power well support disabled. */ 1989 /* Remove the refcount we took to keep power well support disabled. */
@@ -2313,6 +2319,11 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
2313 pm_runtime_mark_last_busy(device); 2319 pm_runtime_mark_last_busy(device);
2314 pm_runtime_use_autosuspend(device); 2320 pm_runtime_use_autosuspend(device);
2315 2321
2322 /*
2323 * The core calls the driver load handler with an RPM reference held.
2324 * We drop that here and will reacquire it during unloading in
2325 * intel_power_domains_fini().
2326 */
2316 pm_runtime_put_autosuspend(device); 2327 pm_runtime_put_autosuspend(device);
2317} 2328}
2318 2329