Commit 99581858 authored by Dennis YC Hsieh's avatar Dennis YC Hsieh Committed by Matthias Brugger

soc: mediatek: cmdq: export finalize function

Export finalize function to client which helps append eoc and jump
command to pkt. Let client decide call finalize or not.
Signed-off-by: default avatarDennis YC Hsieh <dennis-yc.hsieh@mediatek.com>
Reviewed-by: default avatarCK Hu <ck.hu@mediatek.com>
Acked-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://lore.kernel.org/r/1592749115-24158-9-git-send-email-dennis-yc.hsieh@mediatek.comSigned-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
parent 613c2e2c
...@@ -492,6 +492,7 @@ static void mtk_drm_crtc_hw_config(struct mtk_drm_crtc *mtk_crtc) ...@@ -492,6 +492,7 @@ static void mtk_drm_crtc_hw_config(struct mtk_drm_crtc *mtk_crtc)
cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event); cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event);
cmdq_pkt_wfe(cmdq_handle, mtk_crtc->cmdq_event); cmdq_pkt_wfe(cmdq_handle, mtk_crtc->cmdq_event);
mtk_crtc_ddp_config(crtc, cmdq_handle); mtk_crtc_ddp_config(crtc, cmdq_handle);
cmdq_pkt_finalize(cmdq_handle);
cmdq_pkt_flush_async(cmdq_handle, ddp_cmdq_cb, cmdq_handle); cmdq_pkt_flush_async(cmdq_handle, ddp_cmdq_cb, cmdq_handle);
} }
#endif #endif
......
...@@ -300,7 +300,7 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value) ...@@ -300,7 +300,7 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value)
} }
EXPORT_SYMBOL(cmdq_pkt_assign); EXPORT_SYMBOL(cmdq_pkt_assign);
static int cmdq_pkt_finalize(struct cmdq_pkt *pkt) int cmdq_pkt_finalize(struct cmdq_pkt *pkt)
{ {
struct cmdq_instruction inst = { {0} }; struct cmdq_instruction inst = { {0} };
int err; int err;
...@@ -319,6 +319,7 @@ static int cmdq_pkt_finalize(struct cmdq_pkt *pkt) ...@@ -319,6 +319,7 @@ static int cmdq_pkt_finalize(struct cmdq_pkt *pkt)
return err; return err;
} }
EXPORT_SYMBOL(cmdq_pkt_finalize);
static void cmdq_pkt_flush_async_cb(struct cmdq_cb_data data) static void cmdq_pkt_flush_async_cb(struct cmdq_cb_data data)
{ {
...@@ -353,10 +354,6 @@ int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb, ...@@ -353,10 +354,6 @@ int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb,
unsigned long flags = 0; unsigned long flags = 0;
struct cmdq_client *client = (struct cmdq_client *)pkt->cl; struct cmdq_client *client = (struct cmdq_client *)pkt->cl;
err = cmdq_pkt_finalize(pkt);
if (err < 0)
return err;
pkt->cb.cb = cb; pkt->cb.cb = cb;
pkt->cb.data = data; pkt->cb.data = data;
pkt->async_cb.cb = cmdq_pkt_flush_async_cb; pkt->async_cb.cb = cmdq_pkt_flush_async_cb;
......
...@@ -166,6 +166,14 @@ int cmdq_pkt_poll_mask(struct cmdq_pkt *pkt, u8 subsys, ...@@ -166,6 +166,14 @@ int cmdq_pkt_poll_mask(struct cmdq_pkt *pkt, u8 subsys,
*/ */
int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value); int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value);
/**
* cmdq_pkt_finalize() - Append EOC and jump command to pkt.
* @pkt: the CMDQ packet
*
* Return: 0 for success; else the error code is returned
*/
int cmdq_pkt_finalize(struct cmdq_pkt *pkt);
/** /**
* cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ
* packet and call back at the end of done packet * packet and call back at the end of done packet
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment