diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_runtime_pm.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_runtime_pm.c | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index 11cb2a70e3fe..e82aa38bfd23 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c | |||
@@ -2902,41 +2902,6 @@ int intel_power_domains_init(struct drm_i915_private *dev_priv) | |||
2902 | return 0; | 2902 | return 0; |
2903 | } | 2903 | } |
2904 | 2904 | ||
2905 | /** | ||
2906 | * intel_power_domains_fini - finalizes the power domain structures | ||
2907 | * @dev_priv: i915 device instance | ||
2908 | * | ||
2909 | * Finalizes the power domain structures for @dev_priv depending upon the | ||
2910 | * supported platform. This function also disables runtime pm and ensures that | ||
2911 | * the device stays powered up so that the driver can be reloaded. | ||
2912 | */ | ||
2913 | void intel_power_domains_fini(struct drm_i915_private *dev_priv) | ||
2914 | { | ||
2915 | struct device *kdev = &dev_priv->drm.pdev->dev; | ||
2916 | |||
2917 | /* | ||
2918 | * The i915.ko module is still not prepared to be loaded when | ||
2919 | * the power well is not enabled, so just enable it in case | ||
2920 | * we're going to unload/reload. | ||
2921 | * The following also reacquires the RPM reference the core passed | ||
2922 | * to the driver during loading, which is dropped in | ||
2923 | * intel_runtime_pm_enable(). We have to hand back the control of the | ||
2924 | * device to the core with this reference held. | ||
2925 | */ | ||
2926 | intel_display_set_init_power(dev_priv, true); | ||
2927 | |||
2928 | /* Remove the refcount we took to keep power well support disabled. */ | ||
2929 | if (!i915_modparams.disable_power_well) | ||
2930 | intel_display_power_put(dev_priv, POWER_DOMAIN_INIT); | ||
2931 | |||
2932 | /* | ||
2933 | * Remove the refcount we took in intel_runtime_pm_enable() in case | ||
2934 | * the platform doesn't support runtime PM. | ||
2935 | */ | ||
2936 | if (!HAS_RUNTIME_PM(dev_priv)) | ||
2937 | pm_runtime_put(kdev); | ||
2938 | } | ||
2939 | |||
2940 | static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv) | 2905 | static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv) |
2941 | { | 2906 | { |
2942 | struct i915_power_domains *power_domains = &dev_priv->power_domains; | 2907 | struct i915_power_domains *power_domains = &dev_priv->power_domains; |
@@ -3577,6 +3542,40 @@ void intel_power_domains_init_hw(struct drm_i915_private *dev_priv, bool resume) | |||
3577 | } | 3542 | } |
3578 | 3543 | ||
3579 | /** | 3544 | /** |
3545 | * intel_power_domains_fini_hw - deinitialize hw power domain state | ||
3546 | * @dev_priv: i915 device instance | ||
3547 | * | ||
3548 | * De-initializes the display power domain HW state. It also ensures that the | ||
3549 | * device stays powered up so that the driver can be reloaded. | ||
3550 | */ | ||
3551 | void intel_power_domains_fini_hw(struct drm_i915_private *dev_priv) | ||
3552 | { | ||
3553 | struct device *kdev = &dev_priv->drm.pdev->dev; | ||
3554 | |||
3555 | /* | ||
3556 | * The i915.ko module is still not prepared to be loaded when | ||
3557 | * the power well is not enabled, so just enable it in case | ||
3558 | * we're going to unload/reload. | ||
3559 | * The following also reacquires the RPM reference the core passed | ||
3560 | * to the driver during loading, which is dropped in | ||
3561 | * intel_runtime_pm_enable(). We have to hand back the control of the | ||
3562 | * device to the core with this reference held. | ||
3563 | */ | ||
3564 | intel_display_set_init_power(dev_priv, true); | ||
3565 | |||
3566 | /* Remove the refcount we took to keep power well support disabled. */ | ||
3567 | if (!i915_modparams.disable_power_well) | ||
3568 | intel_display_power_put(dev_priv, POWER_DOMAIN_INIT); | ||
3569 | |||
3570 | /* | ||
3571 | * Remove the refcount we took in intel_runtime_pm_enable() in case | ||
3572 | * the platform doesn't support runtime PM. | ||
3573 | */ | ||
3574 | if (!HAS_RUNTIME_PM(dev_priv)) | ||
3575 | pm_runtime_put(kdev); | ||
3576 | } | ||
3577 | |||
3578 | /** | ||
3580 | * intel_power_domains_suspend - suspend power domain state | 3579 | * intel_power_domains_suspend - suspend power domain state |
3581 | * @dev_priv: i915 device instance | 3580 | * @dev_priv: i915 device instance |
3582 | * | 3581 | * |