All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] [RFC] v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats
@ 2022-03-07 18:03 Laurent Pinchart
  2022-03-07 18:03 ` [PATCH 1/3] media: " Laurent Pinchart
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Laurent Pinchart @ 2022-03-07 18:03 UTC (permalink / raw)
  To: linux-media; +Cc: Jacopo Mondi

Hello,

This small patch series adds support for two addition YUV 4:4:4 packed
formats. There's nothing very special, but I've marked the patch series
as RFC as the driver which will use this (NXP i.MX8 ISI) is still work
in progress. Review of the pixel formats would however be already
appreciated.

Laurent Pinchart (3):
  media: v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats
  media: v4l2-tpg: Add support for the new YUVA and YUVX formats
  media: vivid: Add support for the new YUVA and YUVX formats

 .../media/v4l/pixfmt-packed-yuv.rst           | 20 +++++++++++++++++++
 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c |  6 ++++++
 .../test-drivers/vivid/vivid-vid-common.c     | 15 ++++++++++++++
 drivers/media/v4l2-core/v4l2-ioctl.c          |  2 ++
 include/uapi/linux/videodev2.h                |  2 ++
 5 files changed, 45 insertions(+)

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/3] media: v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats
  2022-03-07 18:03 [PATCH 0/3] [RFC] v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats Laurent Pinchart
@ 2022-03-07 18:03 ` Laurent Pinchart
  2022-03-07 19:18   ` Nicolas Dufresne
  2022-03-08  8:37   ` Jacopo Mondi
  2022-03-07 18:03 ` [PATCH 2/3] media: v4l2-tpg: Add support for the new YUVA and YUVX formats Laurent Pinchart
  2022-03-07 18:03 ` [PATCH 3/3] media: vivid: " Laurent Pinchart
  2 siblings, 2 replies; 11+ messages in thread
From: Laurent Pinchart @ 2022-03-07 18:03 UTC (permalink / raw)
  To: linux-media; +Cc: Jacopo Mondi

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>
---
 .../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 62bc2bb3f499..92394786251a 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst
@@ -229,6 +229,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 aeecaca3edba..ca3c7bd19d7e 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1290,6 +1290,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 df8b9c486ba1..16dcd9dd1a50 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -592,6 +592,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  */
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/3] media: v4l2-tpg: Add support for the new YUVA and YUVX formats
  2022-03-07 18:03 [PATCH 0/3] [RFC] v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats Laurent Pinchart
  2022-03-07 18:03 ` [PATCH 1/3] media: " Laurent Pinchart
@ 2022-03-07 18:03 ` Laurent Pinchart
  2022-04-21 23:07   ` Laurent Pinchart
  2022-03-07 18:03 ` [PATCH 3/3] media: vivid: " Laurent Pinchart
  2 siblings, 1 reply; 11+ messages in thread
From: Laurent Pinchart @ 2022-03-07 18:03 UTC (permalink / raw)
  To: linux-media; +Cc: Jacopo Mondi

Extend the TPG to support generating the newly added YUVA and YUVX pixel
formats.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
index 7607b516a7c4..763347919d81 100644
--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
+++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
@@ -266,6 +266,8 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
 	case V4L2_PIX_FMT_XYUV32:
 	case V4L2_PIX_FMT_VUYA32:
 	case V4L2_PIX_FMT_VUYX32:
+	case V4L2_PIX_FMT_YUV32A:
+	case V4L2_PIX_FMT_YUV32X:
 		tpg->color_enc = TGP_COLOR_ENC_YCBCR;
 		break;
 	case V4L2_PIX_FMT_YUV420M:
@@ -412,6 +414,8 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
 	case V4L2_PIX_FMT_XYUV32:
 	case V4L2_PIX_FMT_VUYA32:
 	case V4L2_PIX_FMT_VUYX32:
+	case V4L2_PIX_FMT_YUVA32:
+	case V4L2_PIX_FMT_YUVX32:
 	case V4L2_PIX_FMT_HSV32:
 		tpg->twopixelsize[0] = 2 * 4;
 		break;
@@ -1376,9 +1380,11 @@ static void gen_twopix(struct tpg_data *tpg,
 		buf[0][offset + 3] = b_v;
 		break;
 	case V4L2_PIX_FMT_RGBX32:
+	case V4L2_PIX_FMT_YUVX32:
 		alpha = 0;
 		fallthrough;
 	case V4L2_PIX_FMT_RGBA32:
+	case V4L2_PIX_FMT_YUVA32:
 		buf[0][offset] = r_y_h;
 		buf[0][offset + 1] = g_u_s;
 		buf[0][offset + 2] = b_v;
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/3] media: vivid: Add support for the new YUVA and YUVX formats
  2022-03-07 18:03 [PATCH 0/3] [RFC] v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats Laurent Pinchart
  2022-03-07 18:03 ` [PATCH 1/3] media: " Laurent Pinchart
  2022-03-07 18:03 ` [PATCH 2/3] media: v4l2-tpg: Add support for the new YUVA and YUVX formats Laurent Pinchart
@ 2022-03-07 18:03 ` Laurent Pinchart
  2022-04-21 23:07   ` Laurent Pinchart
  2 siblings, 1 reply; 11+ messages in thread
From: Laurent Pinchart @ 2022-03-07 18:03 UTC (permalink / raw)
  To: linux-media; +Cc: Jacopo Mondi

Extend vivid to support the newly added YUVA and YUVX pixel formats
through the TPG.

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 },
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] media: v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats
  2022-03-07 18:03 ` [PATCH 1/3] media: " Laurent Pinchart
@ 2022-03-07 19:18   ` Nicolas Dufresne
  2022-03-08  8:37   ` Jacopo Mondi
  1 sibling, 0 replies; 11+ messages in thread
From: Nicolas Dufresne @ 2022-03-07 19:18 UTC (permalink / raw)
  To: Laurent Pinchart, linux-media; +Cc: Jacopo Mondi

Le lundi 07 mars 2022 à 20:03 +0200, Laurent Pinchart a écrit :
> 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>

These are pretty straightforward.

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
>  .../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 62bc2bb3f499..92394786251a 100644
> --- a/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst
> @@ -229,6 +229,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 aeecaca3edba..ca3c7bd19d7e 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1290,6 +1290,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 df8b9c486ba1..16dcd9dd1a50 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -592,6 +592,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  */


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] media: v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats
  2022-03-07 18:03 ` [PATCH 1/3] media: " Laurent Pinchart
  2022-03-07 19:18   ` Nicolas Dufresne
@ 2022-03-08  8:37   ` Jacopo Mondi
  2022-03-08  9:20     ` Laurent Pinchart
  1 sibling, 1 reply; 11+ messages in thread
From: Jacopo Mondi @ 2022-03-08  8:37 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media

Hi Laurent

On Mon, Mar 07, 2022 at 08:03:40PM +0200, 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>

All three patches looks good
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Slighlty unrelated: aren't the following format definitions identical ?
Is this intentional ?

    * .. _V4L2-PIX-FMT-YUV32:

      - ``V4L2_PIX_FMT_YUV32``
      - 'YUV4'

      - A\ :sub:`7-0`
      - Y'\ :sub:`7-0`
      - Cb\ :sub:`7-0`
      - Cr\ :sub:`7-0`

    * .. _V4L2-PIX-FMT-AYUV32:

      - ``V4L2_PIX_FMT_AYUV32``
      - 'AYUV'

      - A\ :sub:`7-0`
      - Y'\ :sub:`7-0`
      - Cb\ :sub:`7-0`
      - Cr\ :sub:`7-0`

Thanks
   j

> ---
>  .../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 62bc2bb3f499..92394786251a 100644
> --- a/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst
> @@ -229,6 +229,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 aeecaca3edba..ca3c7bd19d7e 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1290,6 +1290,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 df8b9c486ba1..16dcd9dd1a50 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -592,6 +592,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  */
> --
> Regards,
>
> Laurent Pinchart
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] media: v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats
  2022-03-08  8:37   ` Jacopo Mondi
@ 2022-03-08  9:20     ` Laurent Pinchart
  2022-03-08 16:28       ` Nicolas Dufresne
  0 siblings, 1 reply; 11+ messages in thread
From: Laurent Pinchart @ 2022-03-08  9:20 UTC (permalink / raw)
  To: Jacopo Mondi; +Cc: linux-media, Hans Verkuil

On Tue, Mar 08, 2022 at 09:37:22AM +0100, Jacopo Mondi wrote:
> Hi Laurent
> 
> On Mon, Mar 07, 2022 at 08:03:40PM +0200, 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>
> 
> All three patches looks good
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> 
> Slighlty unrelated: aren't the following format definitions identical ?
> Is this intentional ?

They are identical indeed. I think it's a historical mistake, AYUV32 has
likely been added without realizing YUV32 was already providing the same
format.

V4L2_PIX_FMT_YUV32 is used by ivtv, exynos-gsc, vivid and the staging
IMX drivers. I think it would make sense to deprecate it so that new
drivers will exaplicitly pick either the A or the X variant.

Hans, any opinion on this ?

>     * .. _V4L2-PIX-FMT-YUV32:
> 
>       - ``V4L2_PIX_FMT_YUV32``
>       - 'YUV4'
> 
>       - A\ :sub:`7-0`
>       - Y'\ :sub:`7-0`
>       - Cb\ :sub:`7-0`
>       - Cr\ :sub:`7-0`
> 
>     * .. _V4L2-PIX-FMT-AYUV32:
> 
>       - ``V4L2_PIX_FMT_AYUV32``
>       - 'AYUV'
> 
>       - A\ :sub:`7-0`
>       - Y'\ :sub:`7-0`
>       - Cb\ :sub:`7-0`
>       - Cr\ :sub:`7-0`
> 
> > ---
> >  .../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 62bc2bb3f499..92394786251a 100644
> > --- a/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst
> > +++ b/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst
> > @@ -229,6 +229,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 aeecaca3edba..ca3c7bd19d7e 100644
> > --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> > @@ -1290,6 +1290,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 df8b9c486ba1..16dcd9dd1a50 100644
> > --- a/include/uapi/linux/videodev2.h
> > +++ b/include/uapi/linux/videodev2.h
> > @@ -592,6 +592,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  */

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] media: v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats
  2022-03-08  9:20     ` Laurent Pinchart
@ 2022-03-08 16:28       ` Nicolas Dufresne
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Dufresne @ 2022-03-08 16:28 UTC (permalink / raw)
  To: Laurent Pinchart, Jacopo Mondi; +Cc: linux-media, Hans Verkuil

Le mardi 08 mars 2022 à 11:20 +0200, Laurent Pinchart a écrit :
> On Tue, Mar 08, 2022 at 09:37:22AM +0100, Jacopo Mondi wrote:
> > Hi Laurent
> > 
> > On Mon, Mar 07, 2022 at 08:03:40PM +0200, 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>
> > 
> > All three patches looks good
> > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> > 
> > Slighlty unrelated: aren't the following format definitions identical ?
> > Is this intentional ?
> 
> They are identical indeed. I think it's a historical mistake, AYUV32 has
> likely been added without realizing YUV32 was already providing the same
> format.
> 
> V4L2_PIX_FMT_YUV32 is used by ivtv, exynos-gsc, vivid and the staging
> IMX drivers. I think it would make sense to deprecate it so that new
> drivers will exaplicitly pick either the A or the X variant.

I think we deprecated a similar format with RGB32, as it was ambiguously with
alpha or padding, which can cause issues.

> 
> Hans, any opinion on this ?
> 
> >     * .. _V4L2-PIX-FMT-YUV32:
> > 
> >       - ``V4L2_PIX_FMT_YUV32``
> >       - 'YUV4'
> > 
> >       - A\ :sub:`7-0`
> >       - Y'\ :sub:`7-0`
> >       - Cb\ :sub:`7-0`
> >       - Cr\ :sub:`7-0`
> > 
> >     * .. _V4L2-PIX-FMT-AYUV32:
> > 
> >       - ``V4L2_PIX_FMT_AYUV32``
> >       - 'AYUV'
> > 
> >       - A\ :sub:`7-0`
> >       - Y'\ :sub:`7-0`
> >       - Cb\ :sub:`7-0`
> >       - Cr\ :sub:`7-0`
> > 
> > > ---
> > >  .../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 62bc2bb3f499..92394786251a 100644
> > > --- a/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst
> > > +++ b/Documentation/userspace-api/media/v4l/pixfmt-packed-yuv.rst
> > > @@ -229,6 +229,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 aeecaca3edba..ca3c7bd19d7e 100644
> > > --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> > > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> > > @@ -1290,6 +1290,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 df8b9c486ba1..16dcd9dd1a50 100644
> > > --- a/include/uapi/linux/videodev2.h
> > > +++ b/include/uapi/linux/videodev2.h
> > > @@ -592,6 +592,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  */
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/3] media: v4l2-tpg: Add support for the new YUVA and YUVX formats
  2022-03-07 18:03 ` [PATCH 2/3] media: v4l2-tpg: Add support for the new YUVA and YUVX formats Laurent Pinchart
@ 2022-04-21 23:07   ` Laurent Pinchart
  0 siblings, 0 replies; 11+ messages in thread
From: Laurent Pinchart @ 2022-04-21 23:07 UTC (permalink / raw)
  To: linux-media; +Cc: Jacopo Mondi, Hans Verkuil

Would anyone be able to review this patch ?

On Mon, Mar 07, 2022 at 08:03:41PM +0200, Laurent Pinchart wrote:
> Extend the TPG to support generating the newly added YUVA and YUVX pixel
> formats.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
> index 7607b516a7c4..763347919d81 100644
> --- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
> +++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
> @@ -266,6 +266,8 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
>  	case V4L2_PIX_FMT_XYUV32:
>  	case V4L2_PIX_FMT_VUYA32:
>  	case V4L2_PIX_FMT_VUYX32:
> +	case V4L2_PIX_FMT_YUV32A:
> +	case V4L2_PIX_FMT_YUV32X:
>  		tpg->color_enc = TGP_COLOR_ENC_YCBCR;
>  		break;
>  	case V4L2_PIX_FMT_YUV420M:
> @@ -412,6 +414,8 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
>  	case V4L2_PIX_FMT_XYUV32:
>  	case V4L2_PIX_FMT_VUYA32:
>  	case V4L2_PIX_FMT_VUYX32:
> +	case V4L2_PIX_FMT_YUVA32:
> +	case V4L2_PIX_FMT_YUVX32:
>  	case V4L2_PIX_FMT_HSV32:
>  		tpg->twopixelsize[0] = 2 * 4;
>  		break;
> @@ -1376,9 +1380,11 @@ static void gen_twopix(struct tpg_data *tpg,
>  		buf[0][offset + 3] = b_v;
>  		break;
>  	case V4L2_PIX_FMT_RGBX32:
> +	case V4L2_PIX_FMT_YUVX32:
>  		alpha = 0;
>  		fallthrough;
>  	case V4L2_PIX_FMT_RGBA32:
> +	case V4L2_PIX_FMT_YUVA32:
>  		buf[0][offset] = r_y_h;
>  		buf[0][offset + 1] = g_u_s;
>  		buf[0][offset + 2] = b_v;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/3] media: vivid: Add support for the new YUVA and YUVX formats
  2022-03-07 18:03 ` [PATCH 3/3] media: vivid: " Laurent Pinchart
@ 2022-04-21 23:07   ` Laurent Pinchart
  2022-06-16 16:31     ` Laurent Pinchart
  0 siblings, 1 reply; 11+ messages in thread
From: Laurent Pinchart @ 2022-04-21 23:07 UTC (permalink / raw)
  To: linux-media; +Cc: Jacopo Mondi, Hans Verkuil

Would anyone be able to review this patch ?

On Mon, Mar 07, 2022 at 08:03:42PM +0200, 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>
> ---
>  .../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 },

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/3] media: vivid: Add support for the new YUVA and YUVX formats
  2022-04-21 23:07   ` Laurent Pinchart
@ 2022-06-16 16:31     ` Laurent Pinchart
  0 siblings, 0 replies; 11+ messages in thread
From: Laurent Pinchart @ 2022-06-16 16:31 UTC (permalink / raw)
  To: linux-media; +Cc: Jacopo Mondi, Hans Verkuil

On Fri, Apr 22, 2022 at 02:07:58AM +0300, Laurent Pinchart wrote:
> Would anyone be able to review this patch ?

Hans maybe ? :-) Same for 2/3.

> On Mon, Mar 07, 2022 at 08:03:42PM +0200, 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>
> > ---
> >  .../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 },

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-06-16 16:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 18:03 [PATCH 0/3] [RFC] v4l: Add packed YUV 4:4:4 YUVA and YUVX pixel formats Laurent Pinchart
2022-03-07 18:03 ` [PATCH 1/3] media: " Laurent Pinchart
2022-03-07 19:18   ` Nicolas Dufresne
2022-03-08  8:37   ` Jacopo Mondi
2022-03-08  9:20     ` Laurent Pinchart
2022-03-08 16:28       ` Nicolas Dufresne
2022-03-07 18:03 ` [PATCH 2/3] media: v4l2-tpg: Add support for the new YUVA and YUVX formats Laurent Pinchart
2022-04-21 23:07   ` Laurent Pinchart
2022-03-07 18:03 ` [PATCH 3/3] media: vivid: " Laurent Pinchart
2022-04-21 23:07   ` Laurent Pinchart
2022-06-16 16:31     ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.