On Wed, Oct 08, 2025 at 02:04:02PM +0200, Maxime Ripard wrote:
> The bridge implementation 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: Andrzej Hajda <[email protected]>
> Cc: Neil Armstrong <[email protected]>
> Cc: Robert Foss <[email protected]>
> Cc: Laurent Pinchart <[email protected]>
> Cc: Jonas Karlman <[email protected]>
> Cc: Jernej Skrabec <[email protected]>
> ---
>  drivers/gpu/drm/drm_bridge.c | 31 ++++++++++++++++---------------
>  1 file changed, 16 insertions(+), 15 deletions(-)
> 
> @@ -462,30 +476,17 @@ int drm_bridge_attach(struct drm_encoder *encoder, 
> struct drm_bridge *bridge,
>               ret = bridge->funcs->attach(bridge, encoder, flags);
>               if (ret < 0)
>                       goto err_reset_bridge;
>       }
>  
> -     if (drm_bridge_is_atomic(bridge)) {
> -             struct drm_bridge_state *state;
> -
> -             state = bridge->funcs->atomic_reset(bridge);
> -             if (IS_ERR(state)) {
> -                     ret = PTR_ERR(state);
> -                     goto err_detach_bridge;
> -             }
> -
> +     if (drm_bridge_is_atomic(bridge))
>               drm_atomic_private_obj_init(bridge->dev, &bridge->base,
> -                                         &state->base,
> +                                         NULL,
>                                           &drm_bridge_priv_state_funcs);

This is now very idiomatic, I like it!

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

-- 
With best wishes
Dmitry

Reply via email to