[v2,10/12] media: platform: mtk-mdp3: Get fine-grain control of cmdq_pkt_finalize()
Commit Message
In order to have fine-grained control, use cmdq_pkt_eoc() and
cmdq_pkt_jump_rel() to replace cmdq_pkt_finalize().
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
---
drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 3 ++-
drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c | 2 ++
drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h | 1 +
3 files changed, 5 insertions(+), 1 deletion(-)
@@ -471,7 +471,8 @@ int mdp_cmdq_send(struct mdp_dev *mdp, struct mdp_cmdq_param *param)
dev_err(dev, "mdp_path_config error\n");
goto err_free_path;
}
- cmdq_pkt_finalize(&cmd->pkt);
+ cmdq_pkt_eoc(&cmd->pkt);
+ cmdq_pkt_jump_rel(&cmd->pkt, CMDQ_INST_SIZE, mdp->cmdq_shift_pa);
for (i = 0; i < num_comp; i++)
memcpy(&comps[i], path->comps[i].comp,
@@ -231,6 +231,8 @@ static int mdp_probe(struct platform_device *pdev)
goto err_put_scp;
}
+ mdp->cmdq_shift_pa = cmdq_get_shift_pa(mdp->cmdq_clt->chan);
+
init_waitqueue_head(&mdp->callback_wq);
ida_init(&mdp->mdp_ida);
platform_set_drvdata(pdev, mdp);
@@ -83,6 +83,7 @@ struct mdp_dev {
u32 id_count;
struct ida mdp_ida;
struct cmdq_client *cmdq_clt;
+ u8 cmdq_shift_pa;
wait_queue_head_t callback_wq;
struct v4l2_device v4l2_dev;