Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/alpm: Use actual lfps cycle and silence periods in wake time

Currently we are using maximum lfps cycle and silence period times when
calculating AUXLess wake time. Use actual values instead.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250829053929.3585636-5-jouni.hogander@intel.com

+5 -7
+5 -7
drivers/gpu/drm/i915/display/intel_alpm.c
··· 116 116 * tML_PHY_LOCK = TPS4 Length * ( 10 / (Link Rate in MHz) ) 117 117 * TPS4 Length = 252 Symbols 118 118 */ 119 - static int _lnl_compute_aux_less_wake_time(int port_clock) 119 + static int _lnl_compute_aux_less_wake_time(const struct intel_crtc_state *crtc_state) 120 120 { 121 121 int tphy2_p2_to_p0 = 12 * 1000; 122 - int tlfps_period_max = 800; 123 - int tsilence_max = 180; 124 122 int t1 = 50 * 1000; 125 123 int tps4 = 252; 126 124 /* port_clock is link rate in 10kbit/s units */ 127 - int tml_phy_lock = 1000 * 1000 * tps4 / port_clock; 125 + int tml_phy_lock = 1000 * 1000 * tps4 / crtc_state->port_clock; 128 126 int num_ml_phy_lock = 7 + DIV_ROUND_UP(6500, tml_phy_lock) + 1; 129 127 int t2 = num_ml_phy_lock * tml_phy_lock; 130 128 int tcds = 1 * t2; 131 129 132 - return DIV_ROUND_UP(tphy2_p2_to_p0 + tlfps_period_max + tsilence_max + 133 - t1 + tcds, 1000); 130 + return DIV_ROUND_UP(tphy2_p2_to_p0 + get_lfps_cycle_time(crtc_state) + 131 + SILENCE_PERIOD_TIME + t1 + tcds, 1000); 134 132 } 135 133 136 134 static int ··· 140 142 lfps_half_cycle; 141 143 142 144 aux_less_wake_time = 143 - _lnl_compute_aux_less_wake_time(crtc_state->port_clock); 145 + _lnl_compute_aux_less_wake_time(crtc_state); 144 146 aux_less_wake_lines = intel_usecs_to_scanlines(&crtc_state->hw.adjusted_mode, 145 147 aux_less_wake_time); 146 148 silence_period = get_silence_period_symbols(crtc_state);