Message ID | 20220616183656.19089-1-laurent.pinchart@ideasonboard.com |
---|---|
Headers | show |
Series | media: nxp: i.MX8 ISI driver | expand |
Hi Hans, On Thu, Jun 16, 2022 at 09:36:52PM +0300, Laurent Pinchart wrote: > Extend vivid to support the newly added YUVA and YUVX pixel formats > through the TPG. While the ISI driver itself can't be merged yet due to the dependency on the streams series, I was wondering if we could merge patches 1/7 to 3/7 already. They add two new pixel formats needed by the driver, and having them upstream would help merging their support in libcamera. I'll keep working on the ISI driver (and the streams series) to get those in too. If you agree with that, could you review patches 2/7 and 3/7 (as well as 1/7 if you desire) ? They are small. > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > .../media/test-drivers/vivid/vivid-vid-common.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/media/test-drivers/vivid/vivid-vid-common.c b/drivers/media/test-drivers/vivid/vivid-vid-common.c > index 19701fe72030..38d788b5cf19 100644 > --- a/drivers/media/test-drivers/vivid/vivid-vid-common.c > +++ b/drivers/media/test-drivers/vivid/vivid-vid-common.c > @@ -198,6 +198,21 @@ struct vivid_fmt vivid_formats[] = { > .planes = 1, > .buffers = 1, > }, > + { > + .fourcc = V4L2_PIX_FMT_YUVA32, > + .vdownsampling = { 1 }, > + .bit_depth = { 32 }, > + .planes = 1, > + .buffers = 1, > + .alpha_mask = 0xff000000, > + }, > + { > + .fourcc = V4L2_PIX_FMT_YUVX32, > + .vdownsampling = { 1 }, > + .bit_depth = { 32 }, > + .planes = 1, > + .buffers = 1, > + }, > { > .fourcc = V4L2_PIX_FMT_GREY, > .vdownsampling = { 1 },
On 16/06/2022 20:36, Laurent Pinchart wrote: > The new YUVA and YUVX are permutations of the existing AYUV and XYUV > formats. They are use by the NXP i.MX8 ISI hardware. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Regards, Hans > --- > .../media/v4l/pixfmt-packed-yuv.rst | 20 +++++++++++++++++++ > drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ > include/uapi/linux/videodev2.h | 2 ++ > 3 files changed, 24 insertions(+) > > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst b/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst > index 65520c3af7cf..bf283a1b5581 100644 > --- a/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst > +++ b/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst > @@ -220,6 +220,26 @@ the second byte and Y'\ :sub:`7-0` in the third byte. > - Y'\ :sub:`7-0` > - X\ :sub:`7-0` > > + * .. _V4L2-PIX-FMT-YUVA32: > + > + - ``V4L2_PIX_FMT_YUVA32`` > + - 'YUVA' > + > + - Y'\ :sub:`7-0` > + - Cb\ :sub:`7-0` > + - Cr\ :sub:`7-0` > + - A\ :sub:`7-0` > + > + * .. _V4L2-PIX-FMT-YUVX32: > + > + - ``V4L2_PIX_FMT_YUVX32`` > + - 'YUVX' > + > + - Y'\ :sub:`7-0` > + - Cb\ :sub:`7-0` > + - Cr\ :sub:`7-0` > + - X\ :sub:`7-0` > + > * .. _V4L2-PIX-FMT-YUV24: > > - ``V4L2_PIX_FMT_YUV24`` > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c > index f42f7ffcc247..18ed2227255a 100644 > --- a/drivers/media/v4l2-core/v4l2-ioctl.c > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c > @@ -1297,6 +1297,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) > case V4L2_PIX_FMT_XYUV32: descr = "32-bit XYUV 8-8-8-8"; break; > case V4L2_PIX_FMT_VUYA32: descr = "32-bit VUYA 8-8-8-8"; break; > case V4L2_PIX_FMT_VUYX32: descr = "32-bit VUYX 8-8-8-8"; break; > + case V4L2_PIX_FMT_YUVA32: descr = "32-bit YUVA 8-8-8-8"; break; > + case V4L2_PIX_FMT_YUVX32: descr = "32-bit YUVX 8-8-8-8"; break; > case V4L2_PIX_FMT_YUV410: descr = "Planar YUV 4:1:0"; break; > case V4L2_PIX_FMT_YUV420: descr = "Planar YUV 4:2:0"; break; > case V4L2_PIX_FMT_HI240: descr = "8-bit Dithered RGB (BTTV)"; break; > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > index 343b95107fce..f6f9a690971e 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -593,6 +593,8 @@ struct v4l2_pix_format { > #define V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V') /* 32 XYUV-8-8-8-8 */ > #define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */ > #define V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X') /* 32 VUYX-8-8-8-8 */ > +#define V4L2_PIX_FMT_YUVA32 v4l2_fourcc('Y', 'U', 'V', 'A') /* 32 YUVA-8-8-8-8 */ > +#define V4L2_PIX_FMT_YUVX32 v4l2_fourcc('Y', 'U', 'V', 'X') /* 32 YUVX-8-8-8-8 */ > #define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */ > > /* two planes -- one Y, one Cr + Cb interleaved */
On 16/06/2022 20:36, Laurent Pinchart wrote: > Extend vivid to support the newly added YUVA and YUVX pixel formats > through the TPG. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Regards, Hans > --- > .../media/test-drivers/vivid/vivid-vid-common.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/media/test-drivers/vivid/vivid-vid-common.c b/drivers/media/test-drivers/vivid/vivid-vid-common.c > index 19701fe72030..38d788b5cf19 100644 > --- a/drivers/media/test-drivers/vivid/vivid-vid-common.c > +++ b/drivers/media/test-drivers/vivid/vivid-vid-common.c > @@ -198,6 +198,21 @@ struct vivid_fmt vivid_formats[] = { > .planes = 1, > .buffers = 1, > }, > + { > + .fourcc = V4L2_PIX_FMT_YUVA32, > + .vdownsampling = { 1 }, > + .bit_depth = { 32 }, > + .planes = 1, > + .buffers = 1, > + .alpha_mask = 0xff000000, > + }, > + { > + .fourcc = V4L2_PIX_FMT_YUVX32, > + .vdownsampling = { 1 }, > + .bit_depth = { 32 }, > + .planes = 1, > + .buffers = 1, > + }, > { > .fourcc = V4L2_PIX_FMT_GREY, > .vdownsampling = { 1 },
On 16/06/2022 20:36, Laurent Pinchart wrote: > Extend vivid to support the newly added YUVA and YUVX pixel formats > through the TPG. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Note that v4l-utils should receive a patch adding support for these two new formats, esp. since the tpg and vivid uses them. Basically just grep for V4L2_PIX_FMT_VUYX/A32 and add support for these two new formats. Regards, Hans > --- > .../media/test-drivers/vivid/vivid-vid-common.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/media/test-drivers/vivid/vivid-vid-common.c b/drivers/media/test-drivers/vivid/vivid-vid-common.c > index 19701fe72030..38d788b5cf19 100644 > --- a/drivers/media/test-drivers/vivid/vivid-vid-common.c > +++ b/drivers/media/test-drivers/vivid/vivid-vid-common.c > @@ -198,6 +198,21 @@ struct vivid_fmt vivid_formats[] = { > .planes = 1, > .buffers = 1, > }, > + { > + .fourcc = V4L2_PIX_FMT_YUVA32, > + .vdownsampling = { 1 }, > + .bit_depth = { 32 }, > + .planes = 1, > + .buffers = 1, > + .alpha_mask = 0xff000000, > + }, > + { > + .fourcc = V4L2_PIX_FMT_YUVX32, > + .vdownsampling = { 1 }, > + .bit_depth = { 32 }, > + .planes = 1, > + .buffers = 1, > + }, > { > .fourcc = V4L2_PIX_FMT_GREY, > .vdownsampling = { 1 },