summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
diff options
context:
space:
mode:
authorYunfei Dong <yunfei.dong@mediatek.com>2020-08-21 12:35:52 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-09-26 09:53:52 +0200
commitbf1d556ad4e0f8d92753d3b9896d492f4f065822 (patch)
tree7598e3de946997a6885b1a758b045e6b959c7b21 /drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
parentcbd2dca74926c0e4610c40923cc786b732c9e8ef (diff)
downloadlinux-bf1d556ad4e0f8d92753d3b9896d492f4f065822.tar.bz2
media: mtk-vcodec: abstract firmware interface
MT8183's codec firmware is run by a different remote processor from MT8173. While the firmware interface is basically the same, the way to invoke it differs. Abstract all firmware calls under a layer that will allow us to handle both firmware types transparently. [acourbot: refactor, cleanup and split] [pihsun: fix error path and add mtk_vcodec_fw_release] [hverkuil: fixed some checkpatch alignment warnings] [hverkuil: fixed merge conflicts] Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Co-developed-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org> Reviewed-by: Tiffany Lin <tiffany.lin@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c')
-rw-r--r--drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
index 8d36f0362efe..6426af514526 100644
--- a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
+++ b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
@@ -17,7 +17,6 @@
#include "../venc_drv_base.h"
#include "../venc_ipi_msg.h"
#include "../venc_vpu_if.h"
-#include "mtk_vpu.h"
#define VENC_BITSTREAM_FRAME_SIZE 0x0098
#define VENC_BITSTREAM_HEADER_LEN 0x00e8
@@ -190,10 +189,12 @@ static int vp8_enc_alloc_work_buf(struct venc_vp8_inst *inst)
if (i == VENC_VP8_VPU_WORK_BUF_RC_CODE ||
i == VENC_VP8_VPU_WORK_BUF_RC_CODE2 ||
i == VENC_VP8_VPU_WORK_BUF_RC_CODE3) {
+ struct mtk_vcodec_fw *handler;
void *tmp_va;
- tmp_va = vpu_mapping_dm_addr(inst->vpu_inst.dev,
- wb[i].vpua);
+ handler = inst->vpu_inst.ctx->dev->fw_handler;
+ tmp_va = mtk_vcodec_fw_map_dm_addr(handler,
+ wb[i].vpua);
memcpy(inst->work_bufs[i].va, tmp_va, wb[i].size);
}
wb[i].iova = inst->work_bufs[i].dma_addr;
@@ -334,7 +335,6 @@ static int vp8_enc_init(struct mtk_vcodec_ctx *ctx)
inst->ctx = ctx;
inst->vpu_inst.ctx = ctx;
- inst->vpu_inst.dev = ctx->dev->vpu_plat_dev;
inst->vpu_inst.id = IPI_VENC_VP8;
inst->hw_base = mtk_vcodec_get_reg_addr(inst->ctx, VENC_LT_SYS);