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

media: mtk-vcodec: add support for MT8183 encoder

Now that all the supporting blocks are present, enable encoder for
MT8183.

[acourbot: refactor, cleanup and split]
Signed-off-by: default avatarYunfei Dong <yunfei.dong@mediatek.com>
Co-developed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Signed-off-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Acked-by: default avatarTiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent f466afdf
...@@ -302,6 +302,7 @@ struct mtk_vcodec_ctx { ...@@ -302,6 +302,7 @@ struct mtk_vcodec_ctx {
enum mtk_chip { enum mtk_chip {
MTK_MT8173, MTK_MT8173,
MTK_MT8183,
}; };
/** /**
......
...@@ -62,6 +62,14 @@ static const struct mtk_video_fmt mtk_video_formats_capture_mt8173[] = { ...@@ -62,6 +62,14 @@ static const struct mtk_video_fmt mtk_video_formats_capture_mt8173[] = {
}, },
}; };
static const struct mtk_video_fmt mtk_video_formats_capture_mt8183[] = {
{
.fourcc = V4L2_PIX_FMT_H264,
.type = MTK_FMT_ENC,
.num_planes = 1,
},
};
/* Wake up context wait_queue */ /* Wake up context wait_queue */
static void wake_up_ctx(struct mtk_vcodec_ctx *ctx, unsigned int reason) static void wake_up_ctx(struct mtk_vcodec_ctx *ctx, unsigned int reason)
{ {
...@@ -439,8 +447,22 @@ static const struct mtk_vcodec_enc_pdata mt8173_pdata = { ...@@ -439,8 +447,22 @@ static const struct mtk_vcodec_enc_pdata mt8173_pdata = {
.max_bitrate = 4000000, .max_bitrate = 4000000,
}; };
static const struct mtk_vcodec_enc_pdata mt8183_pdata = {
.chip = MTK_MT8183,
.has_lt_irq = false,
.uses_ext = true,
.capture_formats = mtk_video_formats_capture_mt8183,
.num_capture_formats = ARRAY_SIZE(mtk_video_formats_capture_mt8183),
/* MT8183 supports the same output formats as MT8173 */
.output_formats = mtk_video_formats_output_mt8173,
.num_output_formats = ARRAY_SIZE(mtk_video_formats_output_mt8173),
.min_bitrate = 64,
.max_bitrate = 40000000,
};
static const struct of_device_id mtk_vcodec_enc_match[] = { static const struct of_device_id mtk_vcodec_enc_match[] = {
{.compatible = "mediatek,mt8173-vcodec-enc", .data = &mt8173_pdata}, {.compatible = "mediatek,mt8173-vcodec-enc", .data = &mt8173_pdata},
{.compatible = "mediatek,mt8183-vcodec-enc", .data = &mt8183_pdata},
{}, {},
}; };
MODULE_DEVICE_TABLE(of, mtk_vcodec_enc_match); MODULE_DEVICE_TABLE(of, mtk_vcodec_enc_match);
......
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