RE: 答复: [RESEND 1/3] drm: fsl-dcu: Fix no fb check bug

Meng Yi meng.yi at nxp.com
Tue Dec 29 23:37:36 PST 2015


Hi, Stefan
I have tested your patch, It seems good to me. 
But I think state->fb check is still necessary, because fb is related to crtc , and panel is related to connector,. When fsl,panel is not valid, it indicate that connector is not available, but fb check is still needed. But I am not so sure, and what do you think?

--
Meng Yi

-----Original Message-----
From: Stefan Agner [mailto:stefan at agner.ch] 
Sent: Sunday, December 27, 2015 11:54 AM
To: Meng Yi <meng.yi at nxp.com>
Cc: Dongsheng Wang <Dongsheng.Wang at freescale.com>; airlied at linux.ie; dri-devel at lists.freedesktop.org; Jianwei Wang <jianwei.wang.chn at gmail.com>; Yi Meng-B56799 <B56799 at freescale.com>
Subject: Re: 答复: [RESEND 1/3] drm: fsl-dcu: Fix no fb check bug

Hi Meng,

The only situation I could observe that is when fsl,panel was not valid...

However, I think with my patch "drm/fsl-dcu: Fix no fb check bug", this situation can be avoided completely:
https://lkml.org/lkml/2015/11/18/950

With that patch applied, and a non-existing panel assigned, the DRM driver already fails at probe time gracefully:
[    0.488291] [drm] Initialized drm 1.1.0 20060810
[    0.501576] fsl-dcu 40058000.dcu: failed to initialize mode setting

So I think that a state->fb check for NULL is not necessary at all...

Can you test my patch to see if it fixes the issue for you too?

--
Stefan

On 2015-12-23 21:28, Meng Yi wrote:
> Tested-by: Meng Yi <meng.yi at nxp.com>
> 
> -----邮件原件-----
> 发件人: Dongsheng Wang [mailto:Dongsheng.Wang at freescale.com]
> 发送时间: Tuesday, December 01, 2015 4:16 PM
> 收件人: airlied at linux.ie
> 抄送: stefan at agner.ch; dri-devel at lists.freedesktop.org; Jianwei Wang 
> <jianwei.wang.chn at gmail.com>; Yi Meng-B56799 <B56799 at freescale.com>; 
> Wang Dongsheng-B40534 <Dongsheng.Wang at freescale.com>
> 主题: [RESEND 1/3] drm: fsl-dcu: Fix no fb check bug
> 
> From: Jianwei Wang <jianwei.wang.chn at gmail.com>
> 
> For state->fb may be NULL in fsl_dcu_drm_plane_atomic_check function, 
> if so, return -EINVAL. No need check in 
> fsl_dcu_drm_plane_atomic_update anymore.
> 
> Signed-off-by: Jianwei Wang <jianwei.wang.chn at gmail.com>
> Signed-off-by: Yi Meng <b56799 at freescale.com>
> Signed-off-by: Wang Dongsheng <dongsheng.wang at freescale.com>
> Tested-by: Stefan Agner <stefan at agner.ch>
> 
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
> b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
> index 51daaea..a8932a8 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
> @@ -41,6 +41,9 @@ static int fsl_dcu_drm_plane_atomic_check(struct
> drm_plane *plane,  {
>  	struct drm_framebuffer *fb = state->fb;
>  
> +	if (!fb)
> +		return -EINVAL;
> +
>  	switch (fb->pixel_format) {
>  	case DRM_FORMAT_RGB565:
>  	case DRM_FORMAT_RGB888:
> @@ -85,9 +88,6 @@ static void fsl_dcu_drm_plane_atomic_update(struct
> drm_plane *plane,
>  	unsigned int alpha, bpp;
>  	int index, ret;
>  
> -	if (!fb)
> -		return;
> -
>  	index = fsl_dcu_drm_plane_index(plane);
>  	if (index < 0)
>  		return;
> --
> 2.1.0.27.g96db324


More information about the dri-devel mailing list