Re: [PATCH 1/7] [media]: v4l: add Mediatek MT21 video block format

From: Nicolas Dufresne
Date: Wed Apr 13 2016 - 10:23:45 EST


Le mercredi 13 avril 2016 Ã 20:01 +0800, Tiffany Lin a ÃcritÂ:
> From: Daniel Kurtz <djkurtz@xxxxxxxxxxxx>
>
> Mediatek video format is YVU8_420_2PLANE_PACK8_PROGRESSIVE.
>
> Create V4L2_PIX_FMT_MT21 and DRM_FORMAT_MT21 to be consistent with
> V4L2_PIX_FMT_NV12 notation.
>
> Signed-off-by: Tiffany Lin <tiffany.lin@xxxxxxxxxxxx>
> ---
> Âinclude/uapi/drm/drm_fourcc.hÂÂ|ÂÂÂÂ1 +
> Âinclude/uapi/linux/videodev2.h |ÂÂÂÂ2 ++

Might be better to split this patch.

> Â2 files changed, 3 insertions(+)
>
> diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
> index 0b69a77..a193905 100644
> --- a/include/uapi/drm/drm_fourcc.h
> +++ b/include/uapi/drm/drm_fourcc.h
> @@ -116,6 +116,7 @@
> Â#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */
> Â#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
> Â
> +#define DRM_FORMAT_MT21 fourcc_code('M', 'T', '2', '1') /* Mediatek Block Mode */

Please document the tiling format, don't just add a define here.

> Â/*
> Â * 3 plane YCbCr
> Â * index 0: Y plane, [7:0] Y
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index d0acd26..e9e3276 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -527,6 +527,8 @@ struct v4l2_pix_format {
> Â#define V4L2_PIX_FMT_HM12ÂÂÂÂv4l2_fourcc('H', 'M', '1', '2') /*ÂÂ8ÂÂYUV 4:2:0 16x16 macroblocks */
> Â#define V4L2_PIX_FMT_M420ÂÂÂÂv4l2_fourcc('M', '4', '2', '0') /* 12ÂÂYUV 4:2:0 2 lines y, 1 line uv interleaved */
> Â
> +#define V4L2_PIX_FMT_MT21ÂÂÂÂv4l2_fourcc('M', 'T', '2', '1') /* Mediatek Block ModeÂÂ*/
> +

Same. On Linux Media side, there is docbook documentation where you can
explain in detail.

> Â/* two planes -- one Y, one Cr + Cb interleavedÂÂ*/
> Â#define V4L2_PIX_FMT_NV12ÂÂÂÂv4l2_fourcc('N', 'V', '1', '2') /* 12ÂÂY/CbCr 4:2:0ÂÂ*/
> Â#define V4L2_PIX_FMT_NV21ÂÂÂÂv4l2_fourcc('N', 'V', '2', '1') /* 12ÂÂY/CrCb 4:2:0ÂÂ*/