[PATCHv2 39/45] drm: omapdrm: inline omap_plane_setup into update/disable

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Jun 5 20:15:55 PDT 2015


Hi Tomi,

Thank you for the patch.

On Thursday 04 June 2015 12:02:56 Tomi Valkeinen wrote:
> At the moment we have omap_plane_setup() function which handles both
> enabling (and configuring) and disabling the plane. With atomic
> modesetting we have separate hooks for plane enable/config and disable.
> 
> This patch moves the code from omap_plane_setup() to
> omap_plane_atomic_update() and omap_plane_atomic_disable().
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ti.com>

Acked-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  drivers/gpu/drm/omapdrm/omap_plane.c | 44 +++++++++++++--------------------
>  1 file changed, 17 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c
> b/drivers/gpu/drm/omapdrm/omap_plane.c index a8e617f9f2af..b13fb2fd4a9a
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_plane.c
> +++ b/drivers/gpu/drm/omapdrm/omap_plane.c
> @@ -58,7 +58,22 @@ to_omap_plane_state(struct drm_plane_state *state)
>  	return container_of(state, struct omap_plane_state, base);
>  }
> 
> -static void omap_plane_setup(struct drm_plane *plane)
> +static int omap_plane_prepare_fb(struct drm_plane *plane,
> +				 struct drm_framebuffer *fb,
> +				 const struct drm_plane_state *new_state)
> +{
> +	return omap_framebuffer_pin(fb);
> +}
> +
> +static void omap_plane_cleanup_fb(struct drm_plane *plane,
> +				  struct drm_framebuffer *fb,
> +				  const struct drm_plane_state *old_state)
> +{
> +	omap_framebuffer_unpin(fb);
> +}
> +
> +static void omap_plane_atomic_update(struct drm_plane *plane,
> +				     struct drm_plane_state *old_state)
>  {
>  	struct omap_plane *omap_plane = to_omap_plane(plane);
>  	struct drm_plane_state *state = plane->state;
> @@ -69,11 +84,6 @@ static void omap_plane_setup(struct drm_plane *plane)
> 
>  	DBG("%s, crtc=%p fb=%p", omap_plane->name, state->crtc, state->fb);
> 
> -	if (!state->crtc) {
> -		dispc_ovl_enable(omap_plane->id, false);
> -		return;
> -	}
> -
>  	memset(&info, 0, sizeof(info));
>  	info.rotation_type = OMAP_DSS_ROT_DMA;
>  	info.rotation = OMAP_DSS_ROT_0;
> @@ -128,26 +138,6 @@ static void omap_plane_setup(struct drm_plane *plane)
>  	dispc_ovl_enable(omap_plane->id, true);
>  }
> 
> -static int omap_plane_prepare_fb(struct drm_plane *plane,
> -				 struct drm_framebuffer *fb,
> -				 const struct drm_plane_state *new_state)
> -{
> -	return omap_framebuffer_pin(fb);
> -}
> -
> -static void omap_plane_cleanup_fb(struct drm_plane *plane,
> -				  struct drm_framebuffer *fb,
> -				  const struct drm_plane_state *old_state)
> -{
> -	omap_framebuffer_unpin(fb);
> -}
> -
> -static void omap_plane_atomic_update(struct drm_plane *plane,
> -				     struct drm_plane_state *old_state)
> -{
> -	omap_plane_setup(plane);
> -}
> -
>  static void omap_plane_atomic_disable(struct drm_plane *plane,
>  				      struct drm_plane_state *old_state)
>  {
> @@ -158,7 +148,7 @@ static void omap_plane_atomic_disable(struct drm_plane
> *plane, omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY
>  			   ? 0 : omap_plane->id;
> 
> -	omap_plane_setup(plane);
> +	dispc_ovl_enable(omap_plane->id, false);
>  }
> 
>  static const struct drm_plane_helper_funcs omap_plane_helper_funcs = {

-- 
Regards,

Laurent Pinchart



More information about the dri-devel mailing list