drm/i915/display: Allow display PHYs to reset power state
authorMika Kahola <mika.kahola@intel.com>
Tue, 18 Feb 2025 10:00:19 +0000 (12:00 +0200)
committerMika Kahola <mika.kahola@intel.com>
Wed, 19 Feb 2025 11:28:52 +0000 (13:28 +0200)
commitbf8531990380c83d29f6fa69bce147c2247ce719
treec6c8e15769d05a35a13b82ff9ae967f20ded7107
parenta4ed5f3ab0ce2655a217cb214fb0603faeb64797
drm/i915/display: Allow display PHYs to reset power state

The dedicated display PHYs reset to a power state that blocks S0ix,
increasing idle system power. After a system reset (cold boot,
S3/4/5, warm reset) if a dedicated PHY is not being brought up
shortly, use these steps to move the PHY to the lowest power state
to save power.

1. Follow the PLL Enable Sequence, using any valid frequency such
   as DP 1.62 GHz. This brings lanes out of reset and enables the
   PLL to allow powerdown to be moved to the Disable state.
2. Follow PLL Disable Sequence. This moves powerdown to the Disable
   state and disables the PLL.

v2: Rename WA function to more descriptive (Jani)
    For PTL, only port A needs this wa
    Add helpers to check presence of C10 phy and pll enabling (Imre)
v3: Rename wa function (Imre)
    Check return value of C10 pll tables readout (Imre)
    Use PLL request to check pll enabling (Imre)
v4: Move intel_cx0_pll_is_enabled() right after
    intel_cx0_pll_disable() (Imre)
    Add drm_WARN_ON() if C10 state cannot be calculated from
    the tables (Imre)
v5: Add debug message on PLL enabling (Imre)
    Add check for intel_encoder_is_dig_port() (Imre)

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250218100019.740556-3-mika.kahola@intel.com
drivers/gpu/drm/i915/display/intel_cx0_phy.c
drivers/gpu/drm/i915/display/intel_cx0_phy.h
drivers/gpu/drm/i915/display/intel_display_reset.c
drivers/gpu/drm/i915/display/intel_dpll_mgr.c