On Tue, 2026-09-15 at 23:34 +0530, Animesh Manna wrote:
> Add a separate alpm_is_possible() which will check for alpm
> capability from dpcd info.
> 
> v2: Drop DISPLAY_VER() check as intel_alpm_source_supported
> already checking and populating dpcd info. [Jouni]
> 
> Cc: Jouni Högander <[email protected]>
> Signed-off-by: Animesh Manna <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_alpm.c | 13 ++++++++++---
>  drivers/gpu/drm/i915/display/intel_alpm.h |  1 +
>  2 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> b/drivers/gpu/drm/i915/display/intel_alpm.c
> index 06c1a59aa2c5..29a93a252fe9 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -69,6 +69,13 @@ void intel_alpm_init(struct intel_dp *intel_dp)
>       mutex_init(&intel_dp->alpm.lock);
>  }
>  
> +bool intel_alpm_is_possible(struct intel_dp *intel_dp)
> +{
> +     return (intel_dp->alpm_dpcd ||
> +             intel_dp-
> >lttpr_common_caps[DP_LTTPR_ALPM_CAPABILITIES -
> +                                        
> DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV]);
> +}
> +
>  static int get_silence_period_symbols(const struct intel_crtc_state
> *crtc_state)
>  {
>       return SILENCE_PERIOD_TIME *
> intel_dp_link_symbol_clock(crtc_state->port_clock) /
> @@ -546,7 +553,7 @@ void intel_alpm_lobf_compute_config(struct
> intel_dp *intel_dp,
>       if (intel_dp->alpm.sink_alpm_error)
>               return;
>  
> -     if (!intel_dp_is_edp(intel_dp))
> +     if (!intel_alpm_is_possible(intel_dp))
>               return;
>  
>       if (DISPLAY_VER(display) < 20)
> @@ -832,7 +839,7 @@ void intel_alpm_lobf_disable(const struct
> intel_crtc_state *new_crtc_state)
>  
>               intel_dp = enc_to_intel_dp(encoder);
>  
> -             if (!intel_dp_is_edp(intel_dp))
> +             if (!intel_alpm_is_possible(intel_dp))

I think rather than converting these you should remove these checks
from enable and disable. LOBF is not supposed to be enabled in
new_crtc_state if "!intel_alpm_is_possible()"

BR,
Jouni Högander
 
>                       continue;
>  
>               mutex_lock(&intel_dp->alpm.lock);
> @@ -873,7 +880,7 @@ void intel_alpm_lobf_enable(const struct
> intel_crtc_state *new_crtc_state)
>  
>               intel_dp = enc_to_intel_dp(encoder);
>  
> -             if (intel_dp_is_edp(intel_dp)) {
> +             if (intel_alpm_is_possible(intel_dp)) {
>                       intel_alpm_enable_sink(intel_dp,
> new_crtc_state);
>                       intel_alpm_configure(intel_dp,
> new_crtc_state);
>               }
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.h
> b/drivers/gpu/drm/i915/display/intel_alpm.h
> index 9a02fa386ee3..ea90eba76ca7 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.h
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.h
> @@ -18,6 +18,7 @@ struct intel_crtc;
>  bool intel_alpm_source_supported(struct intel_connector *connector);
>  bool intel_alpm_init_dpcd(struct intel_dp *intel_dp);
>  void intel_alpm_init(struct intel_dp *intel_dp);
> +bool intel_alpm_is_possible(struct intel_dp *intel_dp);
>  bool intel_alpm_compute_params(struct intel_dp *intel_dp,
>                              struct intel_crtc_state *crtc_state);
>  void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp,

Reply via email to