• Suketu Shah's avatar
    drm/i915/skl: Assert the requirements to enter or exit DC5. · 5aefb239
    Suketu Shah authored
    Warn if the conditions to enter or exit DC5 are not satisfied such
    as support for runtime PM, state of power well, CSR loading etc.
    
    v2: Removed camelcase in functions and variables.
    
    v3: Do some minimal check to assert if CSR program is not loaded.
    
    v4:
    1] Used an appropriate function lookup_power_well() to identify power well,
    instead of using a magic number which can change in future.
    2] Split the conditions further in assert_can_enable_DC5() and added more checks.
    3] Removed all WARNs from assert_can_disable_DC5 as they were unnecessary and added two
       new ones.
    4] Changed variable names as updated in earlier patches.
    
    v5:
    1] Change lookup_power_well function to take an int power well id.
    2] Define a new intel_display_power_well_is_enabled helper function to check whether a
       particular power well is enabled.
    3] Use CSR-related mutex in assert_csr_loaded function.
    
    v6: Remove use of dc5_enabled variable as it's no longer needed.
    
    v7:
    1] Rebase to latest.
    2] Move all DC5-related functions from intel_display.c to intel_runtime_pm.c.
    
    v8: After adding dmc ver 1.0 support rebased on top of nightly. (Animesh)
    
    v9: Modified below changes based on review comments from Imre.
    - Moved intel_display_power_well_is_enabled() to intel_runtime_pm.c.
    - Removed mutex lock from assert_csr_loaded(). (Animesh)
    
    Issue: VIZ-2819
    Signed-off-by: default avatarA.Sunil Kamath <sunil.kamath@intel.com>
    Signed-off-by: default avatarSuketu Shah <suketu.j.shah@intel.com>
    Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
    Signed-off-by: default avatarAnimesh Manna <animesh.manna@intel.com>
    Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    5aefb239
intel_runtime_pm.c 53.5 KB