Commit f25709c4 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Mauro Carvalho Chehab

media: rkvdec: Add the VP9 backend

The Rockchip VDEC supports VP9 profile 0 up to 4096x2304@30fps. Add
a backend for this new format.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Signed-off-by: default avatarAdrian Ratiu <adrian.ratiu@collabora.com>
Co-developed-by: default avatarAndrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 3e3b1fb0
...@@ -9,6 +9,7 @@ config VIDEO_ROCKCHIP_VDEC ...@@ -9,6 +9,7 @@ config VIDEO_ROCKCHIP_VDEC
select VIDEOBUF2_VMALLOC select VIDEOBUF2_VMALLOC
select V4L2_MEM2MEM_DEV select V4L2_MEM2MEM_DEV
select V4L2_H264 select V4L2_H264
select V4L2_VP9
help help
Support for the Rockchip Video Decoder IP present on Rockchip SoCs, Support for the Rockchip Video Decoder IP present on Rockchip SoCs,
which accelerates video decoding. which accelerates video decoding.
......
obj-$(CONFIG_VIDEO_ROCKCHIP_VDEC) += rockchip-vdec.o obj-$(CONFIG_VIDEO_ROCKCHIP_VDEC) += rockchip-vdec.o
rockchip-vdec-y += rkvdec.o rkvdec-h264.o rockchip-vdec-y += rkvdec.o rkvdec-h264.o rkvdec-vp9.o
This diff is collapsed.
...@@ -99,10 +99,30 @@ static const struct rkvdec_ctrls rkvdec_h264_ctrls = { ...@@ -99,10 +99,30 @@ static const struct rkvdec_ctrls rkvdec_h264_ctrls = {
.num_ctrls = ARRAY_SIZE(rkvdec_h264_ctrl_descs), .num_ctrls = ARRAY_SIZE(rkvdec_h264_ctrl_descs),
}; };
static const u32 rkvdec_h264_decoded_fmts[] = { static const u32 rkvdec_h264_vp9_decoded_fmts[] = {
V4L2_PIX_FMT_NV12, V4L2_PIX_FMT_NV12,
}; };
static const struct rkvdec_ctrl_desc rkvdec_vp9_ctrl_descs[] = {
{
.cfg.id = V4L2_CID_STATELESS_VP9_FRAME,
},
{
.cfg.id = V4L2_CID_STATELESS_VP9_COMPRESSED_HDR,
},
{
.cfg.id = V4L2_CID_MPEG_VIDEO_VP9_PROFILE,
.cfg.min = V4L2_MPEG_VIDEO_VP9_PROFILE_0,
.cfg.max = V4L2_MPEG_VIDEO_VP9_PROFILE_0,
.cfg.def = V4L2_MPEG_VIDEO_VP9_PROFILE_0,
},
};
static const struct rkvdec_ctrls rkvdec_vp9_ctrls = {
.ctrls = rkvdec_vp9_ctrl_descs,
.num_ctrls = ARRAY_SIZE(rkvdec_vp9_ctrl_descs),
};
static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = { static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = {
{ {
.fourcc = V4L2_PIX_FMT_H264_SLICE, .fourcc = V4L2_PIX_FMT_H264_SLICE,
...@@ -116,8 +136,23 @@ static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = { ...@@ -116,8 +136,23 @@ static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = {
}, },
.ctrls = &rkvdec_h264_ctrls, .ctrls = &rkvdec_h264_ctrls,
.ops = &rkvdec_h264_fmt_ops, .ops = &rkvdec_h264_fmt_ops,
.num_decoded_fmts = ARRAY_SIZE(rkvdec_h264_decoded_fmts), .num_decoded_fmts = ARRAY_SIZE(rkvdec_h264_vp9_decoded_fmts),
.decoded_fmts = rkvdec_h264_decoded_fmts, .decoded_fmts = rkvdec_h264_vp9_decoded_fmts,
},
{
.fourcc = V4L2_PIX_FMT_VP9_FRAME,
.frmsize = {
.min_width = 64,
.max_width = 4096,
.step_width = 64,
.min_height = 64,
.max_height = 2304,
.step_height = 64,
},
.ctrls = &rkvdec_vp9_ctrls,
.ops = &rkvdec_vp9_fmt_ops,
.num_decoded_fmts = ARRAY_SIZE(rkvdec_h264_vp9_decoded_fmts),
.decoded_fmts = rkvdec_h264_vp9_decoded_fmts,
} }
}; };
......
...@@ -42,14 +42,18 @@ struct rkvdec_run { ...@@ -42,14 +42,18 @@ struct rkvdec_run {
struct rkvdec_vp9_decoded_buffer_info { struct rkvdec_vp9_decoded_buffer_info {
/* Info needed when the decoded frame serves as a reference frame. */ /* Info needed when the decoded frame serves as a reference frame. */
u16 width; unsigned short width;
u16 height; unsigned short height;
u32 bit_depth : 4; unsigned int bit_depth : 4;
}; };
struct rkvdec_decoded_buffer { struct rkvdec_decoded_buffer {
/* Must be the first field in this struct. */ /* Must be the first field in this struct. */
struct v4l2_m2m_buffer base; struct v4l2_m2m_buffer base;
union {
struct rkvdec_vp9_decoded_buffer_info vp9;
};
}; };
static inline struct rkvdec_decoded_buffer * static inline struct rkvdec_decoded_buffer *
...@@ -116,4 +120,6 @@ void rkvdec_run_preamble(struct rkvdec_ctx *ctx, struct rkvdec_run *run); ...@@ -116,4 +120,6 @@ void rkvdec_run_preamble(struct rkvdec_ctx *ctx, struct rkvdec_run *run);
void rkvdec_run_postamble(struct rkvdec_ctx *ctx, struct rkvdec_run *run); void rkvdec_run_postamble(struct rkvdec_ctx *ctx, struct rkvdec_run *run);
extern const struct rkvdec_coded_fmt_ops rkvdec_h264_fmt_ops; extern const struct rkvdec_coded_fmt_ops rkvdec_h264_fmt_ops;
extern const struct rkvdec_coded_fmt_ops rkvdec_vp9_fmt_ops;
#endif /* RKVDEC_H_ */ #endif /* RKVDEC_H_ */
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