diff options
author | Moudy Ho <moudy.ho@mediatek.com> | 2023-03-27 06:13:35 +0300 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-04-11 18:17:46 +0300 |
commit | b4e5219985e85dd037a4441884edb62cb58b2671 (patch) | |
tree | 188122dd990b17973439d35f4b4a347c36eae336 /drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c | |
parent | 09e694f1e9da4fd9c00e268c41f02c8b8c31cc50 (diff) | |
download | linux-b4e5219985e85dd037a4441884edb62cb58b2671.tar.xz |
media: platform: mtk-mdp3: reconfigure shared memory
For performance and multi-chip support, use dynamic layout instead of
statically configured pools.
Divide the shared memory into the 3 64-bit aligned layouts listed below:
vpu->param_addr -> +-----------------------------------------+
| |
| To SCP : Input frame parameters |
| (struct img_ipi_frameparam) |
| |
+-----------------------------------------+
vpu->work_addr -> +-----------------------------------------+
| |
| In SCP : Reserve for SCP calculation |
| |
+-----------------------------------------+
vpu->config_addr -> +-----------------------------------------+
| |
| From SCP : Output component config |
| (struct img_config) |
| |
+-----------------------------------------+
Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c')
-rw-r--r-- | drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c index 27e1b1b8c6b4..a298c1b15b9e 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c @@ -87,14 +87,14 @@ static void mdp_m2m_device_run(void *priv) dst_vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx); mdp_set_dst_config(¶m.outputs[0], frame, &dst_vb->vb2_buf); - ret = mdp_vpu_process(&ctx->vpu, ¶m); + ret = mdp_vpu_process(&ctx->mdp_dev->vpu, ¶m); if (ret) { dev_err(&ctx->mdp_dev->pdev->dev, "VPU MDP process failed: %d\n", ret); goto worker_end; } - task.config = ctx->vpu.config; + task.config = ctx->mdp_dev->vpu.config; task.param = ¶m; task.composes[0] = &frame->compose; task.cmdq_cb = NULL; @@ -150,11 +150,6 @@ static int mdp_m2m_start_streaming(struct vb2_queue *q, unsigned int count) if (!mdp_m2m_ctx_is_state_set(ctx, MDP_VPU_INIT)) { ret = mdp_vpu_get_locked(ctx->mdp_dev); - if (ret) - return ret; - - ret = mdp_vpu_ctx_init(&ctx->vpu, &ctx->mdp_dev->vpu, - MDP_DEV_M2M); if (ret) { dev_err(&ctx->mdp_dev->pdev->dev, "VPU init failed %d\n", ret); @@ -641,10 +636,8 @@ static int mdp_m2m_release(struct file *file) mutex_lock(&mdp->m2m_lock); v4l2_m2m_ctx_release(ctx->m2m_ctx); - if (mdp_m2m_ctx_is_state_set(ctx, MDP_VPU_INIT)) { - mdp_vpu_ctx_deinit(&ctx->vpu); + if (mdp_m2m_ctx_is_state_set(ctx, MDP_VPU_INIT)) mdp_vpu_put_locked(mdp); - } v4l2_ctrl_handler_free(&ctx->ctrl_handler); v4l2_fh_del(&ctx->fh); |