diff mbox series

[v2,3/3] drm/mediatek: Fix cursor plane is not config when primary is updating

Message ID 20210930024704.6966-4-jason-jh.lin@mediatek.com (mailing list archive)
State New, archived
Headers show
Series Fix the issues caused by CMDQ refinement of mtk-drm | expand

Commit Message

Jason-JH Lin (林睿祥) Sept. 30, 2021, 2:47 a.m. UTC
If cursor plane has updated but primary plane config task is not
finished, mtk_drm_crtc_update_config will call mbox_flush() to clear
all task in current GCE thread and let cursor plane re-send a new
GCE task with cursor + primary plane config to replace the unfinished
GCE task.

So the plane config flag should not be cleared when mailbox callback
with a error status.

Fixes: 9efb16c2fdd6 ("drm/mediatek: Clear pending flag when cmdq packet is done")
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

Chun-Kuang Hu Sept. 30, 2021, 1:12 p.m. UTC | #1
Hi, Jason:

jason-jh.lin <jason-jh.lin@mediatek.com> 於 2021年9月30日 週四 上午10:47寫道:
>
> If cursor plane has updated but primary plane config task is not
> finished, mtk_drm_crtc_update_config will call mbox_flush() to clear
> all task in current GCE thread and let cursor plane re-send a new
> GCE task with cursor + primary plane config to replace the unfinished
> GCE task.
>
> So the plane config flag should not be cleared when mailbox callback
> with a error status.

Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

>
> Fixes: 9efb16c2fdd6 ("drm/mediatek: Clear pending flag when cmdq packet is done")
> 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 274e5c67507d..b96dbc867890 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -281,6 +281,9 @@ static void ddp_cmdq_cb(struct mbox_client *cl, void *mssg)
>         struct mtk_crtc_state *state;
>         unsigned int i;
>
> +       if (data->sta < 0)
> +               return;
> +
>         state = to_mtk_crtc_state(mtk_crtc->base.state);
>
>         state->pending_config = false;
> --
> 2.18.0
>
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 274e5c67507d..b96dbc867890 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -281,6 +281,9 @@  static void ddp_cmdq_cb(struct mbox_client *cl, void *mssg)
 	struct mtk_crtc_state *state;
 	unsigned int i;
 
+	if (data->sta < 0)
+		return;
+
 	state = to_mtk_crtc_state(mtk_crtc->base.state);
 
 	state->pending_config = false;