]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
media: mtk-vcodec: vdec: Support H264 profile control
authorHirokazu Honda <hiroh@chromium.org>
Fri, 6 Aug 2021 04:15:17 +0000 (06:15 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:07:40 +0000 (10:07 +0200)
Add H264 profiles supported by the MediaTek 8173 decoder.

[acourbot: fix commit log a bit, move to mtk_vcodec_dec.c]

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c

index 56d86e59421e078f0a6715feb4ccbf64c7de10d1..8df8bcfe5e9cf5160c1159f8726fa74310d9cb8f 100644 (file)
@@ -1421,6 +1421,16 @@ int mtk_vcodec_dec_ctrls_setup(struct mtk_vcodec_ctx *ctx)
                                V4L2_CID_MPEG_VIDEO_VP9_PROFILE,
                                V4L2_MPEG_VIDEO_VP9_PROFILE_0,
                                0, V4L2_MPEG_VIDEO_VP9_PROFILE_0);
+       /*
+        * H264. Baseline / Extended decoding is not supported.
+        */
+       v4l2_ctrl_new_std_menu(&ctx->ctrl_hdl,
+                              &mtk_vcodec_dec_ctrl_ops,
+                              V4L2_CID_MPEG_VIDEO_H264_PROFILE,
+                              V4L2_MPEG_VIDEO_H264_PROFILE_HIGH,
+                              BIT(V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE) |
+                              BIT(V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED),
+                              V4L2_MPEG_VIDEO_H264_PROFILE_MAIN);
 
        if (ctx->ctrl_hdl.error) {
                mtk_v4l2_err("Adding control failed %d",