On Fri, 2025-10-17 at 19:14 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <[email protected]>
> 
> Move the scaler assignment into intel_atomic_check_crtcs(). The
> scaler assignment and scale factors are needed for the prefill
> vs. vblank length checks performed during
> intel_compute_global_watermarks().
> 
> I think originally the scaler code itself did some current cdclk
> vs. scaling factor checks, which explains why it's being called
> so late during intel_atomic_check(). But we've long ago switched
> the logic on its head so that scaling dictates the minimum cdclk,
> not the other way around.
> 
> Signed-off-by: Ville Syrjälä <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c 
> b/drivers/gpu/drm/i915/display/intel_display.c
> index 0c483a4994c2..0beed5f9c13a 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -4229,12 +4229,6 @@ static int intel_crtc_atomic_check_late(struct 
> intel_atomic_state *state,
>               return ret;
>       }
>  
> -     if (DISPLAY_VER(display) >= 9) {
> -             ret = intel_atomic_setup_scalers(state, crtc);
> -             if (ret)
> -                     return ret;
> -     }
> -
>       if (HAS_IPS(display)) {
>               ret = hsw_ips_compute_config(state, crtc);
>               if (ret)
> @@ -5748,13 +5742,23 @@ static void intel_crtc_check_fastset(const struct 
> intel_crtc_state *old_crtc_sta
>  
>  static int intel_atomic_check_crtcs(struct intel_atomic_state *state)
>  {
> +     struct intel_display *display = to_intel_display(state);
>       struct intel_crtc_state *new_crtc_state;
>       struct intel_crtc *crtc;
>       int i;
>  
> -     for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i)
> +     for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
> +             int ret;
> +
>               new_crtc_state->min_cdclk = 
> intel_crtc_min_cdclk(new_crtc_state);
>  
> +             if (DISPLAY_VER(display) >= 9) {
> +                     ret = intel_atomic_setup_scalers(state, crtc);
> +                     if (ret)
> +                             return ret;

Same comment as in the previous patch.  Now you are setting things up,
not just checking.  But again:

Reviewed-by: Luca Coelho <[email protected]>

--
Cheers,
Luca.


> +             }
> +     }
> +
>       return 0;
>  }
>  

Reply via email to