Re: [PATCH v2 01/22] drm/komeda: plane: switch to plane reset helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 21, 2022 at 10:58:57AM +0100, Maxime Ripard wrote:
> komeda_plane_reset() does the state initialisation by copying a lot of
> the code found in the __drm_atomic_helper_plane_reset(). Let's switch to
> that helper and reduce the boilerplate.
> 
> Cc: Brian Starkey <brian.starkey@xxxxxxx>
> Cc: "James (Qian) Wang" <james.qian.wang@xxxxxxx>
> Cc: Liviu Dudau <liviu.dudau@xxxxxxx>
> Cc: Mihail Atanassov <mihail.atanassov@xxxxxxx>
> Signed-off-by: Maxime Ripard <maxime@xxxxxxxxxx>

Acked-by: Liviu Dudau <liviu.dudau@xxxxxxx>

Best regards,
Liviu

> ---
>  drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
> index d63d83800a8a..1778f6e1ea56 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
> @@ -145,14 +145,10 @@ static void komeda_plane_reset(struct drm_plane *plane)
>  
>  	state = kzalloc(sizeof(*state), GFP_KERNEL);
>  	if (state) {
> -		state->base.rotation = DRM_MODE_ROTATE_0;
> -		state->base.pixel_blend_mode = DRM_MODE_BLEND_PREMULTI;
> -		state->base.alpha = DRM_BLEND_ALPHA_OPAQUE;
> +		__drm_atomic_helper_plane_reset(plane, &state->base);
>  		state->base.zpos = kplane->layer->base.id;
>  		state->base.color_encoding = DRM_COLOR_YCBCR_BT601;
>  		state->base.color_range = DRM_COLOR_YCBCR_LIMITED_RANGE;
> -		plane->state = &state->base;
> -		plane->state->plane = plane;
>  	}
>  }
>  
> -- 
> 2.35.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux