* [PATCH v2 0/4] Add V4L2_PIX_FMT_MT21C format for MT8173 codec driver
@ 2016-09-09 15:48 Tiffany Lin
2016-09-09 15:48 ` [PATCH v2 1/4] v4l: add Mediatek compressed video block format Tiffany Lin
0 siblings, 1 reply; 7+ messages in thread
From: Tiffany Lin @ 2016-09-09 15:48 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin
This patch series add Mediatek compressed block format V4L2_PIX_FMT_MT21C,
the decoder driver will decoded bitstream to V4L2_PIX_FMT_MT21C format.
User space applications could use MT8173 MDP driver to convert V4L2_PIX_FMT_MT21C
to V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_YUV420M and V4L2_PIX_FMT_YVU420.
MDP driver[1] is stand alone driver.
Usage:
MT21C -> MT8173 MDP -> NV12M/YUV420M/YVU420 NV12M/NV21M/YUV420M/YVU420M -> mt8173 Encoder -> H264/VP8
H264/VP8/VP9 -> mtk8173 Decoder -> MT21C
When encode with MT21 source, the pipeline will be:
MT21C -> MDP driver-> NV12M/NV21M/YUV420M/YVU420M -> Encoder -> H264/VP8
When playback, the pipeline will be:
H264/VP8/VP9 -> Decoder driver -> MT21C -> MDP Driver -> DRM
[1]https://patchwork.kernel.org/patch/9305329/
---
v2: add more information for MT21C in docs-rst
---
Tiffany Lin (4):
v4l: add Mediatek compressed video block format
docs-rst: Add compressed video formats used on MT8173 codec driver
vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder
arm64: dts: mediatek: Add Video Decoder for MT8173
Documentation/media/uapi/v4l/pixfmt-reserved.rst | 10 +++++
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 44 ++++++++++++++++++++
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 7 +++-
drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
include/uapi/linux/videodev2.h | 1 +
5 files changed, 62 insertions(+), 1 deletion(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/4] v4l: add Mediatek compressed video block format
2016-09-09 15:48 [PATCH v2 0/4] Add V4L2_PIX_FMT_MT21C format for MT8173 codec driver Tiffany Lin
@ 2016-09-09 15:48 ` Tiffany Lin
2016-09-09 15:48 ` [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver Tiffany Lin
0 siblings, 1 reply; 7+ messages in thread
From: Tiffany Lin @ 2016-09-09 15:48 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin
Add V4L2_PIX_FMT_MT21C format used on MT8173 driver.
It is compressed format and need MT8173 MDP driver to transfer to other
standard format.
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
---
drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
include/uapi/linux/videodev2.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 2bd1581..1d45c58 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1288,6 +1288,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
case V4L2_PIX_FMT_JPGL: descr = "JPEG Lite"; break;
case V4L2_PIX_FMT_SE401: descr = "GSPCA SE401"; break;
case V4L2_PIX_FMT_S5C_UYVY_JPG: descr = "S5C73MX interleaved UYVY/JPEG"; break;
+ case V4L2_PIX_FMT_MT21C: descr = "Mediatek Compressed Format"; break;
default:
WARN(1, "Unknown pixelformat 0x%08x\n", fmt->pixelformat);
if (fmt->description[0])
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 43326c3..ddd0083 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -635,6 +635,7 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_Y8I v4l2_fourcc('Y', '8', 'I', ' ') /* Greyscale 8-bit L/R interleaved */
#define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 12-bit L/R interleaved */
#define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */
+#define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */
/* SDR formats - used only for Software Defined Radio devices */
#define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver
2016-09-09 15:48 ` [PATCH v2 1/4] v4l: add Mediatek compressed video block format Tiffany Lin
@ 2016-09-09 15:48 ` Tiffany Lin
2016-09-09 15:48 ` [PATCH v2 3/4] vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder Tiffany Lin
2016-09-14 11:51 ` [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver Hans Verkuil
0 siblings, 2 replies; 7+ messages in thread
From: Tiffany Lin @ 2016-09-09 15:48 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin
Add V4L2_PIX_FMT_MT21C documentation
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
---
Documentation/media/uapi/v4l/pixfmt-reserved.rst | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Documentation/media/uapi/v4l/pixfmt-reserved.rst b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
index 0dd2f7f..0989e99 100644
--- a/Documentation/media/uapi/v4l/pixfmt-reserved.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
@@ -339,7 +339,17 @@ please make a proposal on the linux-media mailing list.
array. Anything what's in between the UYVY lines is JPEG data and
should be concatenated to form the JPEG stream.
+ - .. _V4L2-PIX-FMT-MT21C:
+ - ``V4L2_PIX_FMT_MT21C``
+
+ - 'MT21C'
+
+ - Compressed two-planar YVU420 format used by Mediatek MT8173.
+ The compression is lossless.
+ It is an opaque intermediate format, and MDP HW could convert
+ V4L2_PIX_FMT_MT21C to V4L2_PIX_FMT_NV12M,
+ V4L2_PIX_FMT_YUV420M and V4L2_PIX_FMT_YVU420.
.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/4] vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder
2016-09-09 15:48 ` [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver Tiffany Lin
@ 2016-09-09 15:48 ` Tiffany Lin
2016-09-09 15:48 ` [PATCH v2 4/4] arm64: dts: mediatek: Add Video Decoder for MT8173 Tiffany Lin
2016-09-14 11:51 ` [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver Hans Verkuil
1 sibling, 1 reply; 7+ messages in thread
From: Tiffany Lin @ 2016-09-09 15:48 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin
Add V4L2_PIX_FMT_MT21C support
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
---
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
index 28a8453..fd3befc 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
@@ -25,7 +25,7 @@
#include "mtk_vcodec_dec_pm.h"
#define OUT_FMT_IDX 0
-#define CAP_FMT_IDX 0
+#define CAP_FMT_IDX 3
#define MTK_VDEC_MIN_W 64U
#define MTK_VDEC_MIN_H 64U
@@ -48,6 +48,11 @@ static struct mtk_video_fmt mtk_video_formats[] = {
.type = MTK_FMT_DEC,
.num_planes = 1,
},
+ {
+ .fourcc = V4L2_PIX_FMT_MT21C,
+ .type = MTK_FMT_FRAME,
+ .num_planes = 2,
+ },
};
static const struct mtk_codec_framesizes mtk_vdec_framesizes[] = {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 4/4] arm64: dts: mediatek: Add Video Decoder for MT8173
2016-09-09 15:48 ` [PATCH v2 3/4] vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder Tiffany Lin
@ 2016-09-09 15:48 ` Tiffany Lin
0 siblings, 0 replies; 7+ messages in thread
From: Tiffany Lin @ 2016-09-09 15:48 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin
Add video decoder node for MT8173
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
---
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 44 ++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 10f638f..2872cd7 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -974,6 +974,50 @@
#clock-cells = <1>;
};
+ vcodec_dec: vcodec@16000000 {
+ compatible = "mediatek,mt8173-vcodec-dec";
+ reg = <0 0x16000000 0 0x100>, /* VDEC_SYS */
+ <0 0x16020000 0 0x1000>, /* VDEC_MISC */
+ <0 0x16021000 0 0x800>, /* VDEC_LD */
+ <0 0x16021800 0 0x800>, /* VDEC_TOP */
+ <0 0x16022000 0 0x1000>, /* VDEC_CM */
+ <0 0x16023000 0 0x1000>, /* VDEC_AD */
+ <0 0x16024000 0 0x1000>, /* VDEC_AV */
+ <0 0x16025000 0 0x1000>, /* VDEC_PP */
+ <0 0x16026800 0 0x800>, /* VDEC_HWD */
+ <0 0x16027000 0 0x800>, /* VDEC_HWQ */
+ <0 0x16027800 0 0x800>, /* VDEC_HWB */
+ <0 0x16028400 0 0x400>; /* VDEC_HWG */
+ interrupts = <GIC_SPI 204 IRQ_TYPE_LEVEL_LOW>;
+ mediatek,larb = <&larb1>;
+ iommus = <&iommu M4U_PORT_HW_VDEC_MC_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_PP_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_AVC_MV_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_PRED_RD_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_PRED_WR_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_UFO_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_VLD_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_VLD2_EXT>;
+ mediatek,vpu = <&vpu>;
+ power-domains = <&scpsys MT8173_POWER_DOMAIN_VDEC>;
+ clocks = <&apmixedsys CLK_APMIXED_VCODECPLL>,
+ <&topckgen CLK_TOP_UNIVPLL_D2>,
+ <&topckgen CLK_TOP_CCI400_SEL>,
+ <&topckgen CLK_TOP_VDEC_SEL>,
+ <&topckgen CLK_TOP_VCODECPLL>,
+ <&apmixedsys CLK_APMIXED_VENCPLL>,
+ <&topckgen CLK_TOP_VENC_LT_SEL>,
+ <&topckgen CLK_TOP_VCODECPLL_370P5>;
+ clock-names = "vcodecpll",
+ "univpll_d2",
+ "clk_cci400_sel",
+ "vdec_sel",
+ "vdecpll",
+ "vencpll",
+ "venc_lt_sel",
+ "vdec_bus_clk_src";
+ };
+
larb1: larb@16010000 {
compatible = "mediatek,mt8173-smi-larb";
reg = <0 0x16010000 0 0x1000>;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver
2016-09-09 15:48 ` [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver Tiffany Lin
2016-09-09 15:48 ` [PATCH v2 3/4] vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder Tiffany Lin
@ 2016-09-14 11:51 ` Hans Verkuil
2016-09-19 2:06 ` Tiffany Lin
1 sibling, 1 reply; 7+ messages in thread
From: Hans Verkuil @ 2016-09-14 11:51 UTC (permalink / raw)
To: Tiffany Lin, Hans Verkuil, Laurent Pinchart,
Mauro Carvalho Chehab, Matthias Brugger, Daniel Kurtz,
Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media, linux-mediatek
Hi Tiffany,
On 09/09/2016 05:48 PM, Tiffany Lin wrote:
> Add V4L2_PIX_FMT_MT21C documentation
>
> Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
> ---
> Documentation/media/uapi/v4l/pixfmt-reserved.rst | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/Documentation/media/uapi/v4l/pixfmt-reserved.rst b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> index 0dd2f7f..0989e99 100644
> --- a/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> +++ b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> @@ -339,7 +339,17 @@ please make a proposal on the linux-media mailing list.
> array. Anything what's in between the UYVY lines is JPEG data and
> should be concatenated to form the JPEG stream.
>
> + - .. _V4L2-PIX-FMT-MT21C:
>
> + - ``V4L2_PIX_FMT_MT21C``
> +
> + - 'MT21C'
> +
> + - Compressed two-planar YVU420 format used by Mediatek MT8173.
> + The compression is lossless.
> + It is an opaque intermediate format, and MDP HW could convert
Is it OK if I change this to:
" and the MDP hardware must be used to convert"
> + V4L2_PIX_FMT_MT21C to V4L2_PIX_FMT_NV12M,
> + V4L2_PIX_FMT_YUV420M and V4L2_PIX_FMT_YVU420.
and here "and" should be replaced by "or".
Regards,
Hans
>
> .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver
2016-09-14 11:51 ` [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver Hans Verkuil
@ 2016-09-19 2:06 ` Tiffany Lin
0 siblings, 0 replies; 7+ messages in thread
From: Tiffany Lin @ 2016-09-19 2:06 UTC (permalink / raw)
To: Hans Verkuil
Cc: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak, Eddie Huang,
Yingjoe Chen, linux-kernel, linux-media, linux-mediatek
Hi Hans,
On Wed, 2016-09-14 at 13:51 +0200, Hans Verkuil wrote:
> Hi Tiffany,
>
> On 09/09/2016 05:48 PM, Tiffany Lin wrote:
> > Add V4L2_PIX_FMT_MT21C documentation
> >
> > Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
> > ---
> > Documentation/media/uapi/v4l/pixfmt-reserved.rst | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/Documentation/media/uapi/v4l/pixfmt-reserved.rst b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > index 0dd2f7f..0989e99 100644
> > --- a/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > +++ b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > @@ -339,7 +339,17 @@ please make a proposal on the linux-media mailing list.
> > array. Anything what's in between the UYVY lines is JPEG data and
> > should be concatenated to form the JPEG stream.
> >
> > + - .. _V4L2-PIX-FMT-MT21C:
> >
> > + - ``V4L2_PIX_FMT_MT21C``
> > +
> > + - 'MT21C'
> > +
> > + - Compressed two-planar YVU420 format used by Mediatek MT8173.
> > + The compression is lossless.
> > + It is an opaque intermediate format, and MDP HW could convert
>
> Is it OK if I change this to:
>
> " and the MDP hardware must be used to convert"
>
Yes. It's better to make it more clear how to use MT21C.
Thanks for the help.
> > + V4L2_PIX_FMT_MT21C to V4L2_PIX_FMT_NV12M,
> > + V4L2_PIX_FMT_YUV420M and V4L2_PIX_FMT_YVU420.
>
> and here "and" should be replaced by "or".
>
Yes. it should be "or". Sorry about that.
best regards,
Tiffany
> Regards,
>
> Hans
>
> >
> > .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
> >
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-09-19 2:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-09 15:48 [PATCH v2 0/4] Add V4L2_PIX_FMT_MT21C format for MT8173 codec driver Tiffany Lin
2016-09-09 15:48 ` [PATCH v2 1/4] v4l: add Mediatek compressed video block format Tiffany Lin
2016-09-09 15:48 ` [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver Tiffany Lin
2016-09-09 15:48 ` [PATCH v2 3/4] vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder Tiffany Lin
2016-09-09 15:48 ` [PATCH v2 4/4] arm64: dts: mediatek: Add Video Decoder for MT8173 Tiffany Lin
2016-09-14 11:51 ` [PATCH v2 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver Hans Verkuil
2016-09-19 2:06 ` Tiffany Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).