• Imre Deak's avatar
    drm/i915: use power get/put instead of set for power on after init · baa70707
    Imre Deak authored
    Currently we make sure that all power domains are enabled during driver
    init and turn off unneded ones only after the first modeset. Similarly
    during suspend we enable all power domains, which will remain on through
    the following resume until the first modeset.
    
    This logic is supported by intel_set_power_well() in the power domain
    framework. It would be nice to simplify the API, so that we only have
    get/put functions and make it more explicit on the higher level how this
    "power well on during init" logic works. This will make it also easier
    if in the future we want to shorten the time the power wells are on.
    
    For this add a new device private flag tracking whether we have the
    power wells on because of init/suspend and use only
    intel_display_power_get()/put(). As nothing else uses
    intel_set_power_well() we can remove it.
    
    This also fixes
    
    commit 6efdf354
    Author: Imre Deak <imre.deak@intel.com>
    Date:   Wed Oct 16 17:25:52 2013 +0300
    
        drm/i915: enable only the needed power domains during modeset
    
    where removing intel_set_power_well() resulted in not releasing the
    reference on the power well that was taken during init and thus leaving
    the power well on all the time. Regression reported by Paulo.
    
    v2:
    - move the init_power_on flag to the power_domains struct (Daniel)
    
    v3:
    - add note about this being a regression fix too (Paulo)
    Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
    Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    baa70707
intel_pm.c 165 KB