[PATCH 08/23] drm/exynos: pass struct exynos_drm_plane in update/enable

Joonyoung Shim jy0922.shim at samsung.com
Thu Jul 2 05:38:54 PDT 2015


On 06/24/2015 06:35 AM, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
> 
> We already have the plane pointer in before calling .update_plane() or
> disable_plane() so pass it directly to those calls avoiding a new
> conversion from zpos to struct exynos_drm_plane.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
> ---
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c | 22 +++++++---------------
>  drivers/gpu/drm/exynos/exynos_drm_drv.h    |  6 ++++--
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c   | 25 +++++++------------------
>  drivers/gpu/drm/exynos/exynos_drm_plane.c  |  4 ++--
>  drivers/gpu/drm/exynos/exynos_drm_vidi.c   |  9 ++-------
>  drivers/gpu/drm/exynos/exynos_mixer.c      | 20 +++++++++++---------
>  6 files changed, 33 insertions(+), 53 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index c69985e..1f5f5c7 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -392,24 +392,20 @@ static void decon_shadow_protect_win(struct decon_context *ctx,
>  	writel(val, ctx->regs + SHADOWCON);
>  }
>  
> -static void decon_update_plane(struct exynos_drm_crtc *crtc, unsigned int win)
> +static void decon_update_plane(struct exynos_drm_crtc *crtc,
> +			       struct exynos_drm_plane *plane)
>  {
>  	struct decon_context *ctx = crtc->ctx;
>  	struct drm_display_mode *mode = &crtc->base.state->adjusted_mode;
> -	struct exynos_drm_plane *plane;
>  	int padding;
>  	unsigned long val, alpha;
>  	unsigned int last_x;
>  	unsigned int last_y;
> +	unsigned int win = plane->zpos;
>  
>  	if (ctx->suspended)
>  		return;
>  
> -	if (win < 0 || win >= WINDOWS_NR)
> -		return;
> -
> -	plane = &ctx->planes[win];
> -
>  	/*
>  	 * SHADOWCON/PRTCON register is used for enabling timing.
>  	 *
> @@ -502,17 +498,13 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, unsigned int win)
>  	writel(val, ctx->regs + DECON_UPDATE);
>  }
>  
> -static void decon_disable_plane(struct exynos_drm_crtc *crtc, unsigned int win)
> +static void decon_disable_plane(struct exynos_drm_crtc *crtc,
> +				struct exynos_drm_plane *plane)
>  {
>  	struct decon_context *ctx = crtc->ctx;
> -	struct exynos_drm_plane *plane;
> +	unsigned int win = plane->zpos;
>  	u32 val;
>  
> -	if (win < 0 || win >= WINDOWS_NR)
> -		return;
> -
> -	plane = &ctx->planes[win];
> -
>  	if (ctx->suspended)
>  		return;
>  
> @@ -608,7 +600,7 @@ static void decon_disable(struct exynos_drm_crtc *crtc)
>  	 * a destroyed buffer later.
>  	 */
>  	for (i = 0; i < WINDOWS_NR; i++)
> -		decon_disable_plane(crtc, i);
> +		decon_disable_plane(crtc, &ctx->planes[i]);
>  
>  	clk_disable_unprepare(ctx->vclk);
>  	clk_disable_unprepare(ctx->eclk);
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
> index 6f44988..68a7566 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
> @@ -173,8 +173,10 @@ struct exynos_drm_crtc_ops {
>  	int (*enable_vblank)(struct exynos_drm_crtc *crtc);
>  	void (*disable_vblank)(struct exynos_drm_crtc *crtc);
>  	void (*wait_for_vblank)(struct exynos_drm_crtc *crtc);
> -	void (*update_plane)(struct exynos_drm_crtc *crtc, unsigned int zpos);
> -	void (*disable_plane)(struct exynos_drm_crtc *crtc, unsigned int zpos);
> +	void (*update_plane)(struct exynos_drm_crtc *crtc,
> +			     struct exynos_drm_plane *plane);
> +	void (*disable_plane)(struct exynos_drm_crtc *crtc,
> +			      struct exynos_drm_plane *plane);
>  	void (*te_handler)(struct exynos_drm_crtc *crtc);
>  	void (*clock_enable)(struct exynos_drm_crtc *crtc, bool enable);
>  };
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index e941f2a..6073b61 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -638,21 +638,14 @@ static void fimd_shadow_protect_win(struct fimd_context *ctx,
>  	writel(val, ctx->regs + reg);
>  }
>  
> -static void fimd_update_plane(struct exynos_drm_crtc *crtc, unsigned int win)
> +static void fimd_update_plane(struct exynos_drm_crtc *crtc,
> +			      struct exynos_drm_plane *plane)
>  {
>  	struct fimd_context *ctx = crtc->ctx;
> -	struct exynos_drm_plane *plane;
>  	dma_addr_t dma_addr;
>  	unsigned long val, size, offset;
>  	unsigned int last_x, last_y, buf_offsize, line_size;
> -
> -	if (ctx->suspended)
> -		return;

Don't remove this.


More information about the dri-devel mailing list