diff mbox series

[1/2] drm/mediatek: add plane check in async_check function

Message ID 20200213012353.26815-1-bibby.hsieh@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/mediatek: add plane check in async_check function | expand

Commit Message

Bibby Hsieh Feb. 13, 2020, 1:23 a.m. UTC
MTK do rotation checking and transferring in layer check function,
but we do not check that in atomic_check,
so add back in atomic_check function.

Fixes: 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")

Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

CK Hu (胡俊光) Feb. 13, 2020, 3:54 a.m. UTC | #1
Hi, Bibby:

On Thu, 2020-02-13 at 09:23 +0800, Bibby Hsieh wrote:
> MTK do rotation checking and transferring in layer check function,
> but we do not check that in atomic_check,
> so add back in atomic_check function.
> 

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> Fixes: 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
> 
> Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> index 189744d34f53..d32b494ff1de 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> @@ -81,6 +81,7 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
>  					struct drm_plane_state *state)
>  {
>  	struct drm_crtc_state *crtc_state;
> +	int ret;
>  
>  	if (plane != state->crtc->cursor)
>  		return -EINVAL;
> @@ -91,6 +92,11 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
>  	if (!plane->state->fb)
>  		return -EINVAL;
>  
> +	ret = mtk_drm_crtc_plane_check(state->crtc, plane,
> +				       to_mtk_plane_state(state));
> +	if (ret)
> +		return ret;
> +
>  	if (state->state)
>  		crtc_state = drm_atomic_get_existing_crtc_state(state->state,
>  								state->crtc);
CK Hu (胡俊光) Feb. 18, 2020, 7:45 a.m. UTC | #2
Hi, Bibby:

On Thu, 2020-02-13 at 11:54 +0800, CK Hu wrote:
> Hi, Bibby:
> 
> On Thu, 2020-02-13 at 09:23 +0800, Bibby Hsieh wrote:
> > MTK do rotation checking and transferring in layer check function,
> > but we do not check that in atomic_check,
> > so add back in atomic_check function.
> > 
> 
> Reviewed-by: CK Hu <ck.hu@mediatek.com>
> 

Applied to mediatek-drm-fixes-5.6 [1], thanks.

[1]
https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-fixes-5.6


Regards,
CK

> > Fixes: 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
> > 
> > Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > index 189744d34f53..d32b494ff1de 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > @@ -81,6 +81,7 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
> >  					struct drm_plane_state *state)
> >  {
> >  	struct drm_crtc_state *crtc_state;
> > +	int ret;
> >  
> >  	if (plane != state->crtc->cursor)
> >  		return -EINVAL;
> > @@ -91,6 +92,11 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
> >  	if (!plane->state->fb)
> >  		return -EINVAL;
> >  
> > +	ret = mtk_drm_crtc_plane_check(state->crtc, plane,
> > +				       to_mtk_plane_state(state));
> > +	if (ret)
> > +		return ret;
> > +
> >  	if (state->state)
> >  		crtc_state = drm_atomic_get_existing_crtc_state(state->state,
> >  								state->crtc);
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
index 189744d34f53..d32b494ff1de 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
@@ -81,6 +81,7 @@  static int mtk_plane_atomic_async_check(struct drm_plane *plane,
 					struct drm_plane_state *state)
 {
 	struct drm_crtc_state *crtc_state;
+	int ret;
 
 	if (plane != state->crtc->cursor)
 		return -EINVAL;
@@ -91,6 +92,11 @@  static int mtk_plane_atomic_async_check(struct drm_plane *plane,
 	if (!plane->state->fb)
 		return -EINVAL;
 
+	ret = mtk_drm_crtc_plane_check(state->crtc, plane,
+				       to_mtk_plane_state(state));
+	if (ret)
+		return ret;
+
 	if (state->state)
 		crtc_state = drm_atomic_get_existing_crtc_state(state->state,
 								state->crtc);