[PATCH 5/9] drm/mediatek: Drop calling cmdq_pkt_finalize()

Chun-Kuang Hu posted 9 patches 7 months, 1 week ago
There is a newer version of this series
[PATCH 5/9] drm/mediatek: Drop calling cmdq_pkt_finalize()
Posted by Chun-Kuang Hu 7 months, 1 week ago
For some client driver, it want to reduce latency between excuting
previous packet command and next packet command, so append jump
command to the end of previous packet and the jump destination
address is the start address of next packet command buffer. Before
next packet exist, the previous packet has no information of where
to jump to, so append nop command first. When next packet exist,
change nop command to jump command. For mediatek drm driver, it
never has next packet, so appending nop command is redundant.
Because cmdq_pkt_finalize() would append nop command, so change
calling cmdq_pkt_finalize() to cmdq_pkt_eoc() to prevent append
redundant nop command.

Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index c729af3b9822..df693fa268ce 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -593,7 +593,7 @@ static void mtk_drm_crtc_update_config(struct mtk_drm_crtc *mtk_crtc,
 		cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event);
 		cmdq_pkt_wfe(cmdq_handle, mtk_crtc->cmdq_event, false);
 		mtk_crtc_ddp_config(crtc, cmdq_handle);
-		cmdq_pkt_finalize(cmdq_handle);
+		cmdq_pkt_eoc(cmdq_handle);
 		dma_sync_single_for_device(mtk_crtc->cmdq_client.chan->mbox->dev,
 					   cmdq_handle->pa_base,
 					   cmdq_handle->cmd_buf_size,
-- 
2.34.1
Re: [PATCH 5/9] drm/mediatek: Drop calling cmdq_pkt_finalize()
Posted by AngeloGioacchino Del Regno 7 months, 1 week ago
Il 15/02/24 01:49, Chun-Kuang Hu ha scritto:
> For some client driver, it want to reduce latency between excuting
> previous packet command and next packet command, so append jump
> command to the end of previous packet and the jump destination
> address is the start address of next packet command buffer. Before
> next packet exist, the previous packet has no information of where
> to jump to, so append nop command first. When next packet exist,
> change nop command to jump command. For mediatek drm driver, it
> never has next packet, so appending nop command is redundant.
> Because cmdq_pkt_finalize() would append nop command, so change
> calling cmdq_pkt_finalize() to cmdq_pkt_eoc() to prevent append
> redundant nop command.
> 
> Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

Makes sense.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>