On Wed, Oct 08, 2025 at 02:04:09PM +0200, Maxime Ripard wrote:
> The MSM dpu1 driver relies on a drm_private_obj, that is initialized by
> allocating and initializing a state, and then passing it to
> drm_private_obj_init.
> 
> Since we're gradually moving away from that pattern to the more
> established one relying on a reset implementation, let's migrate this
> instance to the new pattern.
> 
> Signed-off-by: Maxime Ripard <[email protected]>
> 
> ---
> 
> Cc: Rob Clark <[email protected]>
> Cc: Dmitry Baryshkov <[email protected]>
> Cc: Abhinav Kumar <[email protected]>
> Cc: Jessica Zhang <[email protected]>
> Cc: Sean Paul <[email protected]>
> Cc: Marijn Suijten <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 31 ++++++++++++++++++++++---------
>  1 file changed, 22 insertions(+), 9 deletions(-)
> 
>  static int dpu_kms_global_obj_init(struct dpu_kms *dpu_kms)

It can become static void now (up to you though).

>  {
> -     struct dpu_global_state *state;
> -
> -     state = kzalloc(sizeof(*state), GFP_KERNEL);
> -     if (!state)
> -             return -ENOMEM;
> -
>       drm_atomic_private_obj_init(dpu_kms->dev, &dpu_kms->global_state,
> -                                 &state->base,
> +                                 NULL,
>                                   &dpu_kms_global_state_funcs);
>  
> -     state->rm = &dpu_kms->rm;
> -
>       return 0;
>  }
>  
>  static void dpu_kms_global_obj_fini(struct dpu_kms *dpu_kms)

Possibly we should also inline these two functions now.

Anyway:

Reviewed-by: Dmitry Baryshkov <[email protected]>



>  {
> 
> -- 
> 2.51.0
> 

-- 
With best wishes
Dmitry

Reply via email to