> -----Original Message-----
> From: Intel-gfx <[email protected]> On Behalf Of Ville
> Syrjala
> Sent: Friday, July 5, 2024 8:23 PM
> To: [email protected]
> Cc: [email protected]
> Subject: [PATCH 12/20] drm/i915/fbc: Extract _intel_fbc_cfb_size()
> 
> From: Ville Syrjälä <[email protected]>
> 
> Pull the lower level stuff out from intel_fbc_cfb_size() into a separate 
> function
> that doesn't depend on the plane_state.

Looks Good to me.
Reviewed-by: Uma Shankar <[email protected]>

> Signed-off-by: Ville Syrjälä <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_fbc.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c
> b/drivers/gpu/drm/i915/display/intel_fbc.c
> index 47b715e5d533..293e1a3b9a9d 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> @@ -218,13 +218,18 @@ static unsigned int intel_fbc_max_cfb_height(struct
> intel_display *display)
>               return 1536;
>  }
> 
> +static unsigned int _intel_fbc_cfb_size(struct intel_display *display,
> +                                     unsigned int height, unsigned int 
> stride)
> {
> +     return min(height, intel_fbc_max_cfb_height(display)) * stride; }
> +
>  static unsigned int intel_fbc_cfb_size(const struct intel_plane_state
> *plane_state)  {
>       struct intel_display *display = 
> to_intel_display(plane_state->uapi.plane-
> >dev);
>       unsigned int height = drm_rect_height(&plane_state->uapi.src) >> 16;
> 
> -     return min(height, intel_fbc_max_cfb_height(display)) *
> -             intel_fbc_cfb_stride(plane_state);
> +     return _intel_fbc_cfb_size(display, height,
> +intel_fbc_cfb_stride(plane_state));
>  }
> 
>  static u16 intel_fbc_override_cfb_stride(const struct intel_plane_state
> *plane_state)
> --
> 2.44.2

Reply via email to