Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: amphion: support to decode RealVideo video

amphion decoder add support for the RealVideo video.
RV30 and RV40 are support by amphion decoder.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Ming Qian and committed by
Mauro Carvalho Chehab
3b514e79 ec9aa62a

+38
+14
drivers/media/platform/amphion/vdec.c
··· 172 172 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, 173 173 .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED 174 174 }, 175 + { 176 + .pixfmt = V4L2_PIX_FMT_RV30, 177 + .mem_planes = 1, 178 + .comp_planes = 1, 179 + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, 180 + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED 181 + }, 182 + { 183 + .pixfmt = V4L2_PIX_FMT_RV40, 184 + .mem_planes = 1, 185 + .comp_planes = 1, 186 + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, 187 + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED 188 + }, 175 189 {0, 0, 0, 0}, 176 190 }; 177 191
+23
drivers/media/platform/amphion/vpu_malone.c
··· 68 68 #define STREAM_CONFIG_NUM_DBE_SET(x, y) CONFIG_SET(x, y, 30, 0x40000000) 69 69 #define STREAM_CONFIG_FS_CTRL_MODE_SET(x, y) CONFIG_SET(x, y, 31, 0x80000000) 70 70 71 + #define MALONE_DEC_FMT_RV_MASK BIT(21) 72 + 71 73 enum vpu_malone_stream_input_mode { 72 74 INVALID_MODE = 0, 73 75 FRAME_LVL, ··· 480 478 { 481 479 struct malone_iface *iface = shared->iface; 482 480 481 + vpu_malone_enable_format(V4L2_PIX_FMT_RV30, iface->fw_version & MALONE_DEC_FMT_RV_MASK); 482 + vpu_malone_enable_format(V4L2_PIX_FMT_RV40, iface->fw_version & MALONE_DEC_FMT_RV_MASK); 483 + 483 484 return iface->fw_version; 484 485 } 485 486 ··· 568 563 {V4L2_PIX_FMT_JPEG, MALONE_FMT_JPG}, 569 564 {V4L2_PIX_FMT_VP8, MALONE_FMT_VP8}, 570 565 {V4L2_PIX_FMT_SPK, MALONE_FMT_SPK}, 566 + {V4L2_PIX_FMT_RV30, MALONE_FMT_RV}, 567 + {V4L2_PIX_FMT_RV40, MALONE_FMT_RV}, 571 568 }; 569 + 570 + void vpu_malone_enable_format(u32 pixelformat, int enable) 571 + { 572 + u32 i; 573 + 574 + for (i = 0; i < ARRAY_SIZE(fmt_mappings); i++) { 575 + if (pixelformat == fmt_mappings[i].pixelformat) { 576 + fmt_mappings[i].is_disabled = enable ? 0 : 1; 577 + return; 578 + } 579 + } 580 + } 572 581 573 582 static enum vpu_malone_format vpu_malone_format_remap(u32 pixelformat) 574 583 { ··· 1010 991 {SCODE_PADDING_EOS, V4L2_PIX_FMT_H263, {0xb1010000, 0x0}}, 1011 992 {SCODE_PADDING_EOS, V4L2_PIX_FMT_VP8, {0x34010000, 0x0}}, 1012 993 {SCODE_PADDING_EOS, V4L2_PIX_FMT_SPK, {0x34010000, 0x0}}, 994 + {SCODE_PADDING_EOS, V4L2_PIX_FMT_RV30, {0x34010000, 0x0}}, 995 + {SCODE_PADDING_EOS, V4L2_PIX_FMT_RV40, {0x34010000, 0x0}}, 1013 996 {SCODE_PADDING_EOS, V4L2_PIX_FMT_JPEG, {0xefff0000, 0x0}}, 1014 997 {SCODE_PADDING_ABORT, V4L2_PIX_FMT_H264, {0x0B010000, 0}}, 1015 998 {SCODE_PADDING_ABORT, V4L2_PIX_FMT_H264_MVC, {0x0B010000, 0}}, ··· 1024 1003 {SCODE_PADDING_ABORT, V4L2_PIX_FMT_H263, {0xb1010000, 0x0}}, 1025 1004 {SCODE_PADDING_ABORT, V4L2_PIX_FMT_VP8, {0x34010000, 0x0}}, 1026 1005 {SCODE_PADDING_ABORT, V4L2_PIX_FMT_SPK, {0x34010000, 0x0}}, 1006 + {SCODE_PADDING_ABORT, V4L2_PIX_FMT_RV30, {0x34010000, 0x0}}, 1007 + {SCODE_PADDING_ABORT, V4L2_PIX_FMT_RV40, {0x34010000, 0x0}}, 1027 1008 {SCODE_PADDING_EOS, V4L2_PIX_FMT_JPEG, {0x0, 0x0}}, 1028 1009 {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264, {0x15010000, 0x0}}, 1029 1010 {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC, {0x15010000, 0x0}},
+1
drivers/media/platform/amphion/vpu_malone.h
··· 41 41 int vpu_malone_init_instance(struct vpu_shared_addr *shared, u32 instance); 42 42 u32 vpu_malone_get_max_instance_count(struct vpu_shared_addr *shared); 43 43 bool vpu_malone_check_fmt(enum vpu_core_type type, u32 pixelfmt); 44 + void vpu_malone_enable_format(u32 pixelformat, int enable); 44 45 45 46 #endif