• Suketu Shah's avatar
    drm/i915/skl: Add DC6 Trigger sequence. · f75a1985
    Suketu Shah authored
    Add triggers for DC6 as per details provided in skl_enable_dc6
    and skl_disable_dc6 implementations.
    
    Also Call POSTING_READ for every write to a register to ensure
    it is written to immediately
    
    v1: Remove POSTING_READ and intel_prepare_ddi calls as they've been added in previous patches.
    
    v2:
    1] Remove check for backlight disabled as it should be the case by that time.
    2] Mark DC5 as disabled when enabling DC6.
    3] Return from DC5-disabling function early if DC5 is already be disabled which can happen
       due to DC6-enabling earlier.
    3] Ensure CSR firmware is loaded after resume from DC6 as corresponding memory contents won't
       be retained after runtime-suspend.
    4] Ensure that CSR isn't identified as loaded before CSR-loading program is called during
       runtime-resume.
    
    v3: Rebase to latest
    Modified as per review comments from Imre and after discussion with Art:
    1] DC6 should be preferably enabled when PG2 is disabled by SW as the check for PG1 being
       disabled is taken of by HW to enter DC6, and disabled when PG2 is enabled respectively.
       This helps save more power, especially in the case when display is disabled but GT is
       enabled. Accordingly, replacing DC5 trigger sequence with DC6 for SKL.
    2] DC6 could be enabled from intel_runtime_suspend() function, if DC5 is already enabled.
    3] Move CSR-load-status setting code from intel_runtime_suspend function to a new function.
    
    v4:
    1] Enable/disable DC6 only when toggling the power-well using a newly defined macro ENABLE_DC6.
    
    v5:
    1] Load CSR on system resume too as firmware may be lost on system suspend preventing
       enabling DC5, DC6.
    2] DDI buffers shouldn't be programmed during driver-load/resume as it's already done
       during modeset initialization then and also that the encoder list is still uninitialized by
       then. Therefore, call intel_prepare_ddi function right after disabling DC6 but outside
       skl_disable_dc6 function and not during driver-load/resume.
    
    v6:
    1] Rebase to latest.
    2] Move SKL_ENABLE_DC6 macro definition from intel_display.c to intel_runtime_pm.c.
    
    v7:
    1) Refactored the code for removing the warning got from checkpatch.
    2) After adding dmc ver 1.0 support rebased on top of nightly. (Animesh)
    
    v8:
    - Reverted the changes done in v7.
    - Removed the condition check in skl_prepare_resune(). (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>
    f75a1985
i915_drv.c 49.3 KB