media: rkvdec: h264: Support profile and level controls
authorJonas Karlman <jonas@kwiboo.se>
Thu, 26 Nov 2020 09:36:07 +0000 (10:36 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 3 Dec 2020 11:27:32 +0000 (12:27 +0100)
The Rockchip Video Decoder used in RK3399 supports H.264 profiles from
Baseline to High 4:2:2 up to Level 5.1, except for the Extended profile.

Expose the V4L2_CID_MPEG_VIDEO_H264_PROFILE and the
V4L2_CID_MPEG_VIDEO_H264_LEVEL control, so that userspace can query the
driver for the list of supported profiles and level.

For now, we don't expose 4:2:2 since the driver doesn't
implement the required support.

[Ezequiel: Don't expose 4:2:2 profile for now]

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/rkvdec/rkvdec.c

index 552e0bd..fe65f55 100644 (file)
@@ -82,6 +82,19 @@ static const struct rkvdec_ctrl_desc rkvdec_h264_ctrl_descs[] = {
                .cfg.def = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B,
                .cfg.max = V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B,
        },
+       {
+               .cfg.id = V4L2_CID_MPEG_VIDEO_H264_PROFILE,
+               .cfg.min = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE,
+               .cfg.max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH,
+               .cfg.menu_skip_mask =
+                       BIT(V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED),
+               .cfg.def = V4L2_MPEG_VIDEO_H264_PROFILE_MAIN,
+       },
+       {
+               .cfg.id = V4L2_CID_MPEG_VIDEO_H264_LEVEL,
+               .cfg.min = V4L2_MPEG_VIDEO_H264_LEVEL_1_0,
+               .cfg.max = V4L2_MPEG_VIDEO_H264_LEVEL_5_1,
+       },
 };
 
 static const struct rkvdec_ctrls rkvdec_h264_ctrls = {