// SPDX-License-Identifier: MIT /* * Copyright 2024, Intel Corporation. */ #include "intel_alpm.h" #include "intel_crtc.h" #include "intel_de.h" #include "intel_display_types.h" #include "intel_dp.h" #include "intel_dp_aux.h" #include "intel_psr_regs.h" bool intel_alpm_aux_wake_supported(struct intel_dp *intel_dp) { … } bool intel_alpm_aux_less_wake_supported(struct intel_dp *intel_dp) { … } void intel_alpm_init_dpcd(struct intel_dp *intel_dp) { … } /* * See Bspec: 71632 for the table * * Silence_period = tSilence,Min + ((tSilence,Max - tSilence,Min) / 2) * * Half cycle duration: * * Link rates 1.62 - 4.32 and tLFPS_Cycle = 70 ns * FLOOR( (Link Rate * tLFPS_Cycle) / (2 * 10) ) * * Link rates 5.4 - 8.1 * PORT_ALPM_LFPS_CTL[ LFPS Cycle Count ] = 10 * LFPS Period chosen is the mid-point of the min:max values from the table * FLOOR( LFPS Period in Symbol clocks / * (2 * PORT_ALPM_LFPS_CTL[ LFPS Cycle Count ]) ) */ static bool _lnl_get_silence_period_and_lfps_half_cycle(int link_rate, int *silence_period, int *lfps_half_cycle) { … } /* * AUX-Less Wake Time = CEILING( ((PHY P2 to P0) + tLFPS_Period, Max+ * tSilence, Max+ tPHY Establishment + tCDS) / tline) * For the "PHY P2 to P0" latency see the PHY Power Control page * (PHY P2 to P0) : https://gfxspecs.intel.com/Predator/Home/Index/68965 * : 12 us * The tLFPS_Period, Max term is 800ns * The tSilence, Max term is 180ns * The tPHY Establishment (a.k.a. t1) term is 50us * The tCDS term is 1 or 2 times t2 * t2 = Number ML_PHY_LOCK * tML_PHY_LOCK * Number ML_PHY_LOCK = ( 7 + CEILING( 6.5us / tML_PHY_LOCK ) + 1) * Rounding up the 6.5us padding to the next ML_PHY_LOCK boundary and * adding the "+ 1" term ensures all ML_PHY_LOCK sequences that start * within the CDS period complete within the CDS period regardless of * entry into the period * tML_PHY_LOCK = TPS4 Length * ( 10 / (Link Rate in MHz) ) * TPS4 Length = 252 Symbols */ static int _lnl_compute_aux_less_wake_time(int port_clock) { … } static int _lnl_compute_aux_less_alpm_params(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { … } static bool _lnl_compute_alpm_params(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { … } /* * IO wake time for DISPLAY_VER < 12 is not directly mentioned in Bspec. There * are 50 us io wake time and 32 us fast wake time. Clearly preharge pulses are * not (improperly) included in 32 us fast wake time. 50 us - 32 us = 18 us. */ static int skl_io_buffer_wake_time(void) { … } static int tgl_io_buffer_wake_time(void) { … } static int io_buffer_wake_time(const struct intel_crtc_state *crtc_state) { … } bool intel_alpm_compute_params(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { … } void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp, struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { … } static void lnl_alpm_configure(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { … } void intel_alpm_configure(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state) { … } static int i915_edp_lobf_info_show(struct seq_file *m, void *data) { … } DEFINE_SHOW_ATTRIBUTE(…); void intel_alpm_lobf_debugfs_add(struct intel_connector *connector) { … }