On Thu, 23 Oct 2025, Animesh Manna <[email protected]> wrote:
> Add a separate alpm_is_possible() which will check for both edp and dp.

AFAICT you're not ready to actually do ALPM for non-eDP at this point. I
presume things will go bonkers if you run this commit.

You can add the helper, but keep the functionality unchanged until
you've actually implemented ALPM for DP.

BR,
Jani.

>
> Cc: Jouni Högander <[email protected]>
> Signed-off-by: Animesh Manna <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_alpm.c | 16 +++++++++++++---
>  drivers/gpu/drm/i915/display/intel_alpm.h |  1 +
>  2 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c 
> b/drivers/gpu/drm/i915/display/intel_alpm.c
> index 6372f533f65b..973791f8956c 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -41,6 +41,16 @@ bool intel_alpm_is_alpm_aux_less(struct intel_dp *intel_dp,
>               (crtc_state->has_lobf && 
> intel_alpm_aux_less_wake_supported(intel_dp));
>  }
>  
> +bool intel_alpm_is_possible(struct intel_dp *intel_dp)
> +{
> +     struct intel_display *display = to_intel_display(intel_dp);
> +
> +     return (DISPLAY_VER(display) >= 12 && intel_dp->alpm_dpcd) ||
> +            (DISPLAY_VER(display) >= 35 &&
> +             intel_dp->lttpr_common_caps[DP_LTTPR_ALPM_CAPABILITIES -
> +                                         
> DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV]);
> +}
> +
>  void intel_alpm_init(struct intel_dp *intel_dp)
>  {
>       u8 dpcd;
> @@ -265,7 +275,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)
> @@ -416,7 +426,7 @@ void intel_alpm_pre_plane_update(struct 
> intel_atomic_state *state,
>  
>               intel_dp = enc_to_intel_dp(encoder);
>  
> -             if (!intel_dp_is_edp(intel_dp))
> +             if (!intel_alpm_is_possible(intel_dp))
>                       continue;
>  
>               if (old_crtc_state->has_lobf) {
> @@ -468,7 +478,7 @@ void intel_alpm_post_plane_update(struct 
> intel_atomic_state *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, crtc_state);
>                       intel_alpm_configure(intel_dp, crtc_state);
>               }
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.h 
> b/drivers/gpu/drm/i915/display/intel_alpm.h
> index 53599b464dea..0c9972faa2e0 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.h
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.h
> @@ -15,6 +15,7 @@ struct intel_connector;
>  struct intel_atomic_state;
>  struct intel_crtc;
>  
> +bool intel_alpm_is_possible(struct intel_dp *intel_dp);
>  void intel_alpm_init(struct intel_dp *intel_dp);
>  bool intel_alpm_compute_params(struct intel_dp *intel_dp,
>                              struct intel_crtc_state *crtc_state);

-- 
Jani Nikula, Intel

Reply via email to