Re: [Intel-gfx] [PATCH 5/5] drm/i915: Introduce intel_plane_state_reset()

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

 



On Thu, 2019-11-07 at 16:24 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> 
> For the sake of symmetry with the crtc stuff let's add
> a helper to reset the plane state to sane default values.
> For the moment this only gets caller from the plane init.
> 

Reviewed-by: José Roberto de Souza <jose.souza@xxxxxxxxx>

> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/display/intel_atomic_plane.c | 15
> +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> index 42b3b3449d2e..9429b8e17270 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> @@ -41,6 +41,16 @@
>  #include "intel_pm.h"
>  #include "intel_sprite.h"
>  
> +static void intel_plane_state_reset(struct intel_plane_state
> *plane_state,
> +				    struct intel_plane *plane)
> +{
> +	memset(plane_state, 0, sizeof(*plane_state));
> +
> +	__drm_atomic_helper_plane_state_reset(&plane_state->uapi,
> &plane->base);
> +
> +	plane_state->scaler_id = -1;
> +}
> +
>  struct intel_plane *intel_plane_alloc(void)
>  {
>  	struct intel_plane_state *plane_state;
> @@ -56,8 +66,9 @@ struct intel_plane *intel_plane_alloc(void)
>  		return ERR_PTR(-ENOMEM);
>  	}
>  
> -	__drm_atomic_helper_plane_reset(&plane->base, &plane_state-
> >uapi);
> -	plane_state->scaler_id = -1;
> +	intel_plane_state_reset(plane_state, plane);
> +
> +	plane->base.state = &plane_state->uapi;
>  
>  	return plane;
>  }
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[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