[RFC 4/4] drm: exynos: add MDNIE and IELCD to FIMD pp list

Andrzej Hajda a.hajda at samsung.com
Tue Apr 1 02:06:53 PDT 2014


Hi Ajay,

Thanks for the patch.

On 03/19/2014 03:22 PM, Ajay Kumar wrote:
> This patch adds code to add MDNIE and IELCD onto the
> list of FIMD PP.
> 
> Signed-off-by: Ajay Kumar <ajaykumar.rs at samsung.com>
> Signed-off-by: Shirish S <s.shirish at samsung.com>
> Signed-off-by: Rahul Sharma <rahul.sharma at samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c | 17 +++++++++++++++++
>  drivers/gpu/drm/exynos/exynos_fimd_pp.h  |  2 ++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index a584d8e..d5a32fb 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -160,8 +160,25 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr,
>  {
>  	struct fimd_context *ctx = mgr->ctx;
>  	struct exynos_drm_private *priv;
> +	struct exynos_fimd_pp *mdnie_pp = NULL, *ielcd_pp = NULL;
> +	int ret;
> +
>  	priv = drm_dev->dev_private;
>  
> +	ret = exynos_mdnie_init(ctx->dev, &mdnie_pp);
> +	if (!ret && mdnie_pp) {

Why do not check ret only?

> +		ret = exynos_ielcd_init(ctx->dev, &ielcd_pp);
> +		if (!ret && ielcd_pp) {
> +			fimd_add_pp_to_list(ctx, mdnie_pp);
> +			fimd_add_pp_to_list(ctx, ielcd_pp);
> +			ctx->enable_pp = true;
> +			ctx->pp_running = false;
> +		} else {
> +			DRM_INFO("No ielcd node present, "
> +					"MDNIE feature will be disabled\n");
> +		}
> +	}
> +

You can put it all into separate routine and you will have much cleaner
code:
{
	...
	ret = exynos_mdnie_init(ctx->dev, &mdnie_pp);
	if (!ret)
		return ret;

	ret = exynos_ielcd_init(ctx->dev, &ielcd_pp);
	if (!ret)
		return ret;

	fimd_add_pp_to_list(ctx, mdnie_pp);
	fimd_add_pp_to_list(ctx, ielcd_pp);
	ctx->enable_pp = true;
	ctx->pp_running = false;
}

Anyway, there is no removal code.

Regards
Andrzej

>  	mgr->drm_dev = ctx->drm_dev = drm_dev;
>  	mgr->pipe = ctx->pipe = priv->pipe++;
>  
> diff --git a/drivers/gpu/drm/exynos/exynos_fimd_pp.h b/drivers/gpu/drm/exynos/exynos_fimd_pp.h
> index 528d3cb..b980742 100644
> --- a/drivers/gpu/drm/exynos/exynos_fimd_pp.h
> +++ b/drivers/gpu/drm/exynos/exynos_fimd_pp.h
> @@ -49,4 +49,6 @@ struct exynos_fimd_pp {
>  	void *ctx;
>  };
>  
> +extern int exynos_mdnie_init(struct device *dev, struct exynos_fimd_pp **pp);
> +extern int exynos_ielcd_init(struct device *dev, struct exynos_fimd_pp **pp);
>  #endif
> 



More information about the dri-devel mailing list