diff mbox series

[v2,2/2] drm/mediatek: Fix iommu fault during crtc enabling

Message ID 20230709162641.6405-3-jason-jh.lin@mediatek.com (mailing list archive)
State New, archived
Headers show
Series Fix OVL iommu fault in cursor plane | expand

Commit Message

Jason-JH.Lin July 9, 2023, 4:26 p.m. UTC
OVL layer should not be enabled before crtc is enabled.
The plane_state of drm_atomic_state is not sync to
the plane_state stored in mtk_crtc during crtc enabling,
so just set all planes to disabled.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Fei Shao July 10, 2023, 3:13 a.m. UTC | #1
Hi Jason,

On Mon, Jul 10, 2023 at 12:27 AM Jason-JH.Lin <jason-jh.lin@mediatek.com> wrote:
>
> OVL layer should not be enabled before crtc is enabled.
> The plane_state of drm_atomic_state is not sync to
> the plane_state stored in mtk_crtc during crtc enabling,
> so just set all planes to disabled.
>
Please add the "Fixes" tag before your S-o-b.

Regards,
Fei
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index d40142842f85..51d10e65004e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -410,6 +410,9 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
>                 unsigned int local_layer;
>
>                 plane_state = to_mtk_plane_state(plane->state);
> +
> +               /* should not enable layer before crtc enabled */
> +               plane_state->pending.enable = false;
>                 comp = mtk_drm_ddp_comp_for_plane(crtc, plane, &local_layer);
>                 if (comp)
>                         mtk_ddp_comp_layer_config(comp, local_layer,
> --
> 2.18.0
>
>
AngeloGioacchino Del Regno July 10, 2023, 8:07 a.m. UTC | #2
Il 09/07/23 18:26, Jason-JH.Lin ha scritto:
> OVL layer should not be enabled before crtc is enabled.
> The plane_state of drm_atomic_state is not sync to
> the plane_state stored in mtk_crtc during crtc enabling,
> so just set all planes to disabled.
> 

Please add the relevant Fixes tag and resend.

Thanks,
Angelo

> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com> > ---
>   drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index d40142842f85..51d10e65004e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -410,6 +410,9 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
>   		unsigned int local_layer;
>   
>   		plane_state = to_mtk_plane_state(plane->state);
> +
> +		/* should not enable layer before crtc enabled */
> +		plane_state->pending.enable = false;
>   		comp = mtk_drm_ddp_comp_for_plane(crtc, plane, &local_layer);
>   		if (comp)
>   			mtk_ddp_comp_layer_config(comp, local_layer,
Jason-JH.Lin July 10, 2023, 9:32 a.m. UTC | #3
Hi Angelo,

Thanks for the reviews.

On Mon, 2023-07-10 at 10:07 +0200, AngeloGioacchino Del Regno wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  Il 09/07/23 18:26, Jason-JH.Lin ha scritto:
> > OVL layer should not be enabled before crtc is enabled.
> > The plane_state of drm_atomic_state is not sync to
> > the plane_state stored in mtk_crtc during crtc enabling,
> > so just set all planes to disabled.
> > 
> 
> Please add the relevant Fixes tag and resend.
> 
> Thanks,
> Angelo

OK, I'll add Fixes tag at the next version.

Regards,
Jason-JH.Lin
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index d40142842f85..51d10e65004e 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -410,6 +410,9 @@  static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
 		unsigned int local_layer;
 
 		plane_state = to_mtk_plane_state(plane->state);
+
+		/* should not enable layer before crtc enabled */
+		plane_state->pending.enable = false;
 		comp = mtk_drm_ddp_comp_for_plane(crtc, plane, &local_layer);
 		if (comp)
 			mtk_ddp_comp_layer_config(comp, local_layer,