Commit 59fba9ee authored by Yunfei Dong's avatar Yunfei Dong Committed by Mauro Carvalho Chehab

media: mediatek: vcodec: support stateless H.264 decoding for mt8192

Adds h264 lat and core architecture driver for mt8192,
and the decode mode is frame based for stateless decoder.
Signed-off-by: default avatarYunfei Dong <yunfei.dong@mediatek.com>
Tested-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 024b1f4f
...@@ -10,6 +10,7 @@ mtk-vcodec-dec-y := vdec/vdec_h264_if.o \ ...@@ -10,6 +10,7 @@ mtk-vcodec-dec-y := vdec/vdec_h264_if.o \
vdec/vdec_vp9_if.o \ vdec/vdec_vp9_if.o \
vdec/vdec_h264_req_if.o \ vdec/vdec_h264_req_if.o \
vdec/vdec_h264_req_common.o \ vdec/vdec_h264_req_common.o \
vdec/vdec_h264_req_multi_if.o \
mtk_vcodec_dec_drv.o \ mtk_vcodec_dec_drv.o \
vdec_drv_if.o \ vdec_drv_if.o \
vdec_vpu_if.o \ vdec_vpu_if.o \
......
...@@ -16,11 +16,18 @@ ...@@ -16,11 +16,18 @@
int vdec_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc) int vdec_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc)
{ {
enum mtk_vdec_hw_arch hw_arch = ctx->dev->vdec_pdata->hw_arch;
int ret = 0; int ret = 0;
switch (fourcc) { switch (fourcc) {
case V4L2_PIX_FMT_H264_SLICE: case V4L2_PIX_FMT_H264_SLICE:
ctx->dec_if = &vdec_h264_slice_if; if (!ctx->dev->vdec_pdata->is_subdev_supported) {
ctx->dec_if = &vdec_h264_slice_if;
ctx->hw_id = MTK_VDEC_CORE;
} else {
ctx->dec_if = &vdec_h264_slice_multi_if;
ctx->hw_id = IS_VDEC_LAT_ARCH(hw_arch) ? MTK_VDEC_LAT0 : MTK_VDEC_CORE;
}
break; break;
case V4L2_PIX_FMT_H264: case V4L2_PIX_FMT_H264:
ctx->dec_if = &vdec_h264_if; ctx->dec_if = &vdec_h264_if;
......
...@@ -56,6 +56,7 @@ struct vdec_fb_node { ...@@ -56,6 +56,7 @@ struct vdec_fb_node {
extern const struct vdec_common_if vdec_h264_if; extern const struct vdec_common_if vdec_h264_if;
extern const struct vdec_common_if vdec_h264_slice_if; extern const struct vdec_common_if vdec_h264_slice_if;
extern const struct vdec_common_if vdec_h264_slice_multi_if;
extern const struct vdec_common_if vdec_vp8_if; extern const struct vdec_common_if vdec_vp8_if;
extern const struct vdec_common_if vdec_vp9_if; extern const struct vdec_common_if vdec_vp9_if;
......
...@@ -28,6 +28,7 @@ struct mtk_vcodec_ctx; ...@@ -28,6 +28,7 @@ struct mtk_vcodec_ctx;
* @wq : wait queue to wait VPU message ack * @wq : wait queue to wait VPU message ack
* @handler : ipi handler for each decoder * @handler : ipi handler for each decoder
* @codec_type : use codec type to separate different codecs * @codec_type : use codec type to separate different codecs
* @capture_type: used capture type to separate different capture format
* @fb_sz : frame buffer size of each plane * @fb_sz : frame buffer size of each plane
*/ */
struct vdec_vpu_inst { struct vdec_vpu_inst {
...@@ -43,6 +44,7 @@ struct vdec_vpu_inst { ...@@ -43,6 +44,7 @@ struct vdec_vpu_inst {
wait_queue_head_t wq; wait_queue_head_t wq;
mtk_vcodec_ipi_handler handler; mtk_vcodec_ipi_handler handler;
unsigned int codec_type; unsigned int codec_type;
unsigned int capture_type;
unsigned int fb_sz[2]; unsigned int fb_sz[2];
}; };
......
...@@ -41,6 +41,8 @@ enum scp_ipi_id { ...@@ -41,6 +41,8 @@ enum scp_ipi_id {
SCP_IPI_ISP_FRAME, SCP_IPI_ISP_FRAME,
SCP_IPI_FD_CMD, SCP_IPI_FD_CMD,
SCP_IPI_CROS_HOST_CMD, SCP_IPI_CROS_HOST_CMD,
SCP_IPI_VDEC_LAT,
SCP_IPI_VDEC_CORE,
SCP_IPI_NS_SERVICE = 0xFF, SCP_IPI_NS_SERVICE = 0xFF,
SCP_IPI_MAX = 0x100, SCP_IPI_MAX = 0x100,
}; };
......
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