On Tue, 2026-08-25 at 11:15 +0530, Animesh Manna wrote:
> Add support for half LFPS cycle calculation for DP2.1 ALPM as
> dependent
> parameters got changed.
> 
> v1: Initial version.
> v2: Avoid returning early. [Jani]
> v3: Use intel_crtc_has_type(). [Suraj]
> 
> Cc: Jouni Högander <[email protected]>
> Signed-off-by: Animesh Manna <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_alpm.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> b/drivers/gpu/drm/i915/display/intel_alpm.c
> index 078e04bb69d2..98aa418a6ff7 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -80,12 +80,18 @@ static int get_silence_period_symbols(const
> struct intel_crtc_state *crtc_state)
>  static void get_lfps_cycle_min_max_time(const struct
> intel_crtc_state *crtc_state,

Not your patch, but maybe better naming would be
get_lfps_period_min_max_time()

>                                       int *min, int *max)
>  {
> -     if (crtc_state->port_clock < 540000) {
> -             *min = 65 * LFPS_CYCLE_COUNT;
> -             *max = 75 * LFPS_CYCLE_COUNT;
> -     } else {
> -             *min = 140;
> -             *max = 800;
> +     struct intel_display *display =
> to_intel_display(crtc_state);
> +
> +     *min = 320;
> +     *max = 1600;
> +     if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP)) {
> +             if (crtc_state->port_clock < 540000 &&
> DISPLAY_VER(display) < 35) {
> +                     *min = 65 * LFPS_CYCLE_COUNT;
> +                     *max = 75 * LFPS_CYCLE_COUNT;
> +             } else {
> +                     *min = 140;
> +                     *max = 800;
> +             }

This is getting messy. Maybe it would be more clear to have:

if (DISPLAY_VER(display) < 35)
    get_lfps_cycle_min_max_time_cx0()
else
    get_lfps_cycle_min_max_time_lt()

BR,
Jouni Högander
>       }
>  }
>  

Reply via email to