Linux-Media Archive on lore.kernel.org
 help / Atom feed
* [PATCH 0/4] Add support for 32-bit packed YUV formats
@ 2019-02-08  3:18 Vivek Kasireddy
  2019-02-08  3:18 ` [PATCH 1/4] media: v4l: Add " Vivek Kasireddy
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Vivek Kasireddy @ 2019-02-08  3:18 UTC (permalink / raw)
  To: linux-media; +Cc: Vivek Kasireddy

This patch series adds support for formats that can be used directly
by other drivers such as i915 drm driver. Also, the buffers generated
by vivid in one of these formats using tpg can be used by the Weston
compositor as textures.

Vivek Kasireddy (4):
  media: v4l: Add 32-bit packed YUV formats
  media: v4l2-tpg-core: Add support for 32-bit packed YUV formats
  media: vivid: Add definitions for the 32-bit packed YUV formats
  media: imx-pxp: Start using the format VUYA32 instead of YUV32

 Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst | 170 ++++++++++++++++++++-
 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c      |  13 ++
 drivers/media/platform/imx-pxp.c                   |   8 +-
 drivers/media/platform/vivid/vivid-vid-common.c    |  30 ++++
 drivers/media/v4l2-core/v4l2-ioctl.c               |   4 +
 include/uapi/linux/videodev2.h                     |   4 +
 6 files changed, 224 insertions(+), 5 deletions(-)

-- 
2.14.5


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

* [PATCH 1/4] media: v4l: Add 32-bit packed YUV formats
  2019-02-08  3:18 [PATCH 0/4] Add support for 32-bit packed YUV formats Vivek Kasireddy
@ 2019-02-08  3:18 ` " Vivek Kasireddy
  2019-02-08  3:18 ` [PATCH 2/4] media: v4l2-tpg-core: Add support for " Vivek Kasireddy
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Vivek Kasireddy @ 2019-02-08  3:18 UTC (permalink / raw)
  To: linux-media; +Cc: Vivek Kasireddy, Hans Verkuil

The formats added in this patch include:
 V4L2_PIX_FMT_AYUV32
 V4L2_PIX_FMT_XYUV32
 V4L2_PIX_FMT_VUYA32
 V4L2_PIX_FMT_VUYX32

These formats enable the trasmission of alpha channel data to other
drivers and userspace applications in addition to YUV data. For
example, buffers generated by drivers in one of these formats
can be used by the Weston compositor to display as a texture or
flipped directly onto the overlay planes with the help of a DRM
driver.

Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst | 170 ++++++++++++++++++++-
 drivers/media/v4l2-core/v4l2-ioctl.c               |   4 +
 include/uapi/linux/videodev2.h                     |   4 +
 3 files changed, 177 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst b/Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst
index f53e8f57a003..7fcee1c11ac4 100644
--- a/Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-packed-yuv.rst
@@ -190,6 +190,170 @@ component of each pixel in one 16 or 32 bit word.
       - Cr\ :sub:`2`
       - Cr\ :sub:`1`
       - Cr\ :sub:`0`
+      -
+    * .. _V4L2-PIX-FMT-AYUV32:
+
+      - ``V4L2_PIX_FMT_AYUV32``
+      - 'AYUV'
+
+      - a\ :sub:`7`
+      - a\ :sub:`6`
+      - a\ :sub:`5`
+      - a\ :sub:`4`
+      - a\ :sub:`3`
+      - a\ :sub:`2`
+      - a\ :sub:`1`
+      - a\ :sub:`0`
+
+      - Y'\ :sub:`7`
+      - Y'\ :sub:`6`
+      - Y'\ :sub:`5`
+      - Y'\ :sub:`4`
+      - Y'\ :sub:`3`
+      - Y'\ :sub:`2`
+      - Y'\ :sub:`1`
+      - Y'\ :sub:`0`
+
+      - Cb\ :sub:`7`
+      - Cb\ :sub:`6`
+      - Cb\ :sub:`5`
+      - Cb\ :sub:`4`
+      - Cb\ :sub:`3`
+      - Cb\ :sub:`2`
+      - Cb\ :sub:`1`
+      - Cb\ :sub:`0`
+
+      - Cr\ :sub:`7`
+      - Cr\ :sub:`6`
+      - Cr\ :sub:`5`
+      - Cr\ :sub:`4`
+      - Cr\ :sub:`3`
+      - Cr\ :sub:`2`
+      - Cr\ :sub:`1`
+      - Cr\ :sub:`0`
+      -
+    * .. _V4L2-PIX-FMT-XYUV32:
+
+      - ``V4L2_PIX_FMT_XYUV32``
+      - 'XYUV'
+
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+
+      - Y'\ :sub:`7`
+      - Y'\ :sub:`6`
+      - Y'\ :sub:`5`
+      - Y'\ :sub:`4`
+      - Y'\ :sub:`3`
+      - Y'\ :sub:`2`
+      - Y'\ :sub:`1`
+      - Y'\ :sub:`0`
+
+      - Cb\ :sub:`7`
+      - Cb\ :sub:`6`
+      - Cb\ :sub:`5`
+      - Cb\ :sub:`4`
+      - Cb\ :sub:`3`
+      - Cb\ :sub:`2`
+      - Cb\ :sub:`1`
+      - Cb\ :sub:`0`
+
+      - Cr\ :sub:`7`
+      - Cr\ :sub:`6`
+      - Cr\ :sub:`5`
+      - Cr\ :sub:`4`
+      - Cr\ :sub:`3`
+      - Cr\ :sub:`2`
+      - Cr\ :sub:`1`
+      - Cr\ :sub:`0`
+      -
+    * .. _V4L2-PIX-FMT-VUYA32:
+
+      - ``V4L2_PIX_FMT_VUYA32``
+      - 'VUYA'
+
+      - Cr\ :sub:`7`
+      - Cr\ :sub:`6`
+      - Cr\ :sub:`5`
+      - Cr\ :sub:`4`
+      - Cr\ :sub:`3`
+      - Cr\ :sub:`2`
+      - Cr\ :sub:`1`
+      - Cr\ :sub:`0`
+
+      - Cb\ :sub:`7`
+      - Cb\ :sub:`6`
+      - Cb\ :sub:`5`
+      - Cb\ :sub:`4`
+      - Cb\ :sub:`3`
+      - Cb\ :sub:`2`
+      - Cb\ :sub:`1`
+      - Cb\ :sub:`0`
+
+      - Y'\ :sub:`7`
+      - Y'\ :sub:`6`
+      - Y'\ :sub:`5`
+      - Y'\ :sub:`4`
+      - Y'\ :sub:`3`
+      - Y'\ :sub:`2`
+      - Y'\ :sub:`1`
+      - Y'\ :sub:`0`
+
+      - a\ :sub:`7`
+      - a\ :sub:`6`
+      - a\ :sub:`5`
+      - a\ :sub:`4`
+      - a\ :sub:`3`
+      - a\ :sub:`2`
+      - a\ :sub:`1`
+      - a\ :sub:`0`
+      -
+    * .. _V4L2-PIX-FMT-VUYX32:
+
+      - ``V4L2_PIX_FMT_VUYX32``
+      - 'VUYX'
+
+      - Cr\ :sub:`7`
+      - Cr\ :sub:`6`
+      - Cr\ :sub:`5`
+      - Cr\ :sub:`4`
+      - Cr\ :sub:`3`
+      - Cr\ :sub:`2`
+      - Cr\ :sub:`1`
+      - Cr\ :sub:`0`
+
+      - Cb\ :sub:`7`
+      - Cb\ :sub:`6`
+      - Cb\ :sub:`5`
+      - Cb\ :sub:`4`
+      - Cb\ :sub:`3`
+      - Cb\ :sub:`2`
+      - Cb\ :sub:`1`
+      - Cb\ :sub:`0`
+
+      - Y'\ :sub:`7`
+      - Y'\ :sub:`6`
+      - Y'\ :sub:`5`
+      - Y'\ :sub:`4`
+      - Y'\ :sub:`3`
+      - Y'\ :sub:`2`
+      - Y'\ :sub:`1`
+      - Y'\ :sub:`0`
+
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
 
 .. raw:: latex
 
@@ -202,4 +366,8 @@ component of each pixel in one 16 or 32 bit word.
     #) The value of a = alpha bits is undefined when reading from the driver,
        ignored when writing to the driver, except when alpha blending has
        been negotiated for a :ref:`Video Overlay <overlay>` or
-       :ref:`Video Output Overlay <osd>`.
+       :ref:`Video Output Overlay <osd>` for the formats Y444, YUV555 and
+       YUV4. However, for formats AYUV32 and VUYA32, the alpha component is
+       expected to contain a meaningful value that can be used by drivers
+       and applications. And, the formats XYUV32 and VUYX32 contain undefined
+       alpha values that must be ignored by all applications and drivers.
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 1441a73ce64c..2947a696f720 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1212,6 +1212,10 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
 	case V4L2_PIX_FMT_YUV555:	descr = "16-bit A/XYUV 1-5-5-5"; break;
 	case V4L2_PIX_FMT_YUV565:	descr = "16-bit YUV 5-6-5"; break;
 	case V4L2_PIX_FMT_YUV32:	descr = "32-bit A/XYUV 8-8-8-8"; break;
+	case V4L2_PIX_FMT_AYUV32:	descr = "32-bit AYUV 8-8-8-8"; break;
+	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_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 9a920f071ff9..1db220da3bcc 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -562,6 +562,10 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_YUV555  v4l2_fourcc('Y', 'U', 'V', 'O') /* 16  YUV-5-5-5     */
 #define V4L2_PIX_FMT_YUV565  v4l2_fourcc('Y', 'U', 'V', 'P') /* 16  YUV-5-6-5     */
 #define V4L2_PIX_FMT_YUV32   v4l2_fourcc('Y', 'U', 'V', '4') /* 32  YUV-8-8-8-8   */
+#define V4L2_PIX_FMT_AYUV32  v4l2_fourcc('A', 'Y', 'U', 'V') /* 32  AYUV-8-8-8-8  */
+#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_HI240   v4l2_fourcc('H', 'I', '2', '4') /*  8  8-bit color   */
 #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 */
-- 
2.14.5


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

* [PATCH 2/4] media: v4l2-tpg-core: Add support for 32-bit packed YUV formats
  2019-02-08  3:18 [PATCH 0/4] Add support for 32-bit packed YUV formats Vivek Kasireddy
  2019-02-08  3:18 ` [PATCH 1/4] media: v4l: Add " Vivek Kasireddy
@ 2019-02-08  3:18 ` " Vivek Kasireddy
  2019-02-08 10:21   ` kbuild test robot
  2019-02-08 10:49   ` kbuild test robot
  2019-02-08  3:18 ` [PATCH 3/4] media: vivid: Add definitions for the 32-bit packed YUV formats Vivek Kasireddy
  2019-02-08  3:18 ` [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 Vivek Kasireddy
  3 siblings, 2 replies; 14+ messages in thread
From: Vivek Kasireddy @ 2019-02-08  3:18 UTC (permalink / raw)
  To: linux-media; +Cc: Vivek Kasireddy, Hans Verkuil

Add support for the following formats to tpg:
 V4L2_PIX_FMT_AYUV32
 V4L2_PIX_FMT_XYUV32
 V4L2_PIX_FMT_VUYA32
 V4L2_PIX_FMT_VUYX32

Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
index d9a590ae7545..fa3d40a1c935 100644
--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
+++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
@@ -246,6 +246,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
 	case V4L2_PIX_FMT_YUV555:
 	case V4L2_PIX_FMT_YUV565:
 	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_AYUV32:
+	case V4L2_PIX_FMT_XYUV32:
+	case V4L2_PIX_FMT_VUYA32:
+	case V4L2_PIX_FMT_VUYX32:
 		tpg->color_enc = TGP_COLOR_ENC_YCBCR;
 		break;
 	case V4L2_PIX_FMT_YUV420M:
@@ -372,6 +376,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
 	case V4L2_PIX_FMT_ARGB32:
 	case V4L2_PIX_FMT_ABGR32:
 	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_AYUV32:
+	case V4L2_PIX_FMT_XYUV32:
+	case V4L2_PIX_FMT_VUYA32:
+	case V4L2_PIX_FMT_VUYX32:
 	case V4L2_PIX_FMT_HSV32:
 		tpg->twopixelsize[0] = 2 * 4;
 		break;
@@ -1267,10 +1275,13 @@ static void gen_twopix(struct tpg_data *tpg,
 	case V4L2_PIX_FMT_RGB32:
 	case V4L2_PIX_FMT_XRGB32:
 	case V4L2_PIX_FMT_HSV32:
+	case V4L2_PIX_FMT_XYUV32:
 		alpha = 0;
 		/* fall through */
 	case V4L2_PIX_FMT_YUV32:
 	case V4L2_PIX_FMT_ARGB32:
+	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_AYUV32:
 		buf[0][offset] = alpha;
 		buf[0][offset + 1] = r_y_h;
 		buf[0][offset + 2] = g_u_s;
@@ -1278,9 +1289,11 @@ static void gen_twopix(struct tpg_data *tpg,
 		break;
 	case V4L2_PIX_FMT_BGR32:
 	case V4L2_PIX_FMT_XBGR32:
+	case V4L2_PIX_FMT_VUYX32:
 		alpha = 0;
 		/* fall through */
 	case V4L2_PIX_FMT_ABGR32:
+	case V4L2_PIX_FMT_VUYA32:
 		buf[0][offset] = b_v;
 		buf[0][offset + 1] = g_u_s;
 		buf[0][offset + 2] = r_y_h;
-- 
2.14.5


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

* [PATCH 3/4] media: vivid: Add definitions for the 32-bit packed YUV formats
  2019-02-08  3:18 [PATCH 0/4] Add support for 32-bit packed YUV formats Vivek Kasireddy
  2019-02-08  3:18 ` [PATCH 1/4] media: v4l: Add " Vivek Kasireddy
  2019-02-08  3:18 ` [PATCH 2/4] media: v4l2-tpg-core: Add support for " Vivek Kasireddy
@ 2019-02-08  3:18 ` Vivek Kasireddy
  2019-02-08  3:18 ` [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 Vivek Kasireddy
  3 siblings, 0 replies; 14+ messages in thread
From: Vivek Kasireddy @ 2019-02-08  3:18 UTC (permalink / raw)
  To: linux-media; +Cc: Vivek Kasireddy, Hans Verkuil

Enable vivid to make use of the following formats:
 V4L2_PIX_FMT_AYUV32
 V4L2_PIX_FMT_XYUV32
 V4L2_PIX_FMT_VUYA32
 V4L2_PIX_FMT_VUYX32

Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 drivers/media/platform/vivid/vivid-vid-common.c | 30 +++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c
index 661f4015fba1..74b83bcc6119 100644
--- a/drivers/media/platform/vivid/vivid-vid-common.c
+++ b/drivers/media/platform/vivid/vivid-vid-common.c
@@ -168,6 +168,36 @@ struct vivid_fmt vivid_formats[] = {
 		.buffers = 1,
 		.alpha_mask = 0x000000ff,
 	},
+	{
+		.fourcc   = V4L2_PIX_FMT_AYUV32,
+		.vdownsampling = { 1 },
+		.bit_depth = { 32 },
+		.planes   = 1,
+		.buffers = 1,
+		.alpha_mask = 0x000000ff,
+	},
+	{
+		.fourcc   = V4L2_PIX_FMT_XYUV32,
+		.vdownsampling = { 1 },
+		.bit_depth = { 32 },
+		.planes   = 1,
+		.buffers = 1,
+	},
+	{
+		.fourcc   = V4L2_PIX_FMT_VUYA32,
+		.vdownsampling = { 1 },
+		.bit_depth = { 32 },
+		.planes   = 1,
+		.buffers = 1,
+		.alpha_mask = 0xff000000,
+	},
+	{
+		.fourcc   = V4L2_PIX_FMT_VUYX32,
+		.vdownsampling = { 1 },
+		.bit_depth = { 32 },
+		.planes   = 1,
+		.buffers = 1,
+	},
 	{
 		.fourcc   = V4L2_PIX_FMT_GREY,
 		.vdownsampling = { 1 },
-- 
2.14.5


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

* [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32
  2019-02-08  3:18 [PATCH 0/4] Add support for 32-bit packed YUV formats Vivek Kasireddy
                   ` (2 preceding siblings ...)
  2019-02-08  3:18 ` [PATCH 3/4] media: vivid: Add definitions for the 32-bit packed YUV formats Vivek Kasireddy
@ 2019-02-08  3:18 ` Vivek Kasireddy
  2019-02-08  9:14   ` Philipp Zabel
                     ` (2 more replies)
  3 siblings, 3 replies; 14+ messages in thread
From: Vivek Kasireddy @ 2019-02-08  3:18 UTC (permalink / raw)
  To: linux-media; +Cc: Vivek Kasireddy, Philipp Zabel

Buffers generated with YUV32 format seems to be incorrect, hence use
VUYA32 instead.

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 drivers/media/platform/imx-pxp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c
index f087dc4fc729..70adbe38f802 100644
--- a/drivers/media/platform/imx-pxp.c
+++ b/drivers/media/platform/imx-pxp.c
@@ -90,7 +90,7 @@ static struct pxp_fmt formats[] = {
 		.depth	= 16,
 		.types	= MEM2MEM_CAPTURE | MEM2MEM_OUTPUT,
 	}, {
-		.fourcc = V4L2_PIX_FMT_YUV32,
+		.fourcc = V4L2_PIX_FMT_VUYA32,
 		.depth	= 32,
 		.types	= MEM2MEM_CAPTURE | MEM2MEM_OUTPUT,
 	}, {
@@ -236,7 +236,7 @@ static u32 pxp_v4l2_pix_fmt_to_ps_format(u32 v4l2_pix_fmt)
 	case V4L2_PIX_FMT_RGB555:  return BV_PXP_PS_CTRL_FORMAT__RGB555;
 	case V4L2_PIX_FMT_RGB444:  return BV_PXP_PS_CTRL_FORMAT__RGB444;
 	case V4L2_PIX_FMT_RGB565:  return BV_PXP_PS_CTRL_FORMAT__RGB565;
-	case V4L2_PIX_FMT_YUV32:   return BV_PXP_PS_CTRL_FORMAT__YUV1P444;
+	case V4L2_PIX_FMT_VUYA32:  return BV_PXP_PS_CTRL_FORMAT__YUV1P444;
 	case V4L2_PIX_FMT_UYVY:    return BV_PXP_PS_CTRL_FORMAT__UYVY1P422;
 	case V4L2_PIX_FMT_YUYV:    return BM_PXP_PS_CTRL_WB_SWAP |
 					  BV_PXP_PS_CTRL_FORMAT__UYVY1P422;
@@ -265,7 +265,7 @@ static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
 	case V4L2_PIX_FMT_RGB555:   return BV_PXP_OUT_CTRL_FORMAT__RGB555;
 	case V4L2_PIX_FMT_RGB444:   return BV_PXP_OUT_CTRL_FORMAT__RGB444;
 	case V4L2_PIX_FMT_RGB565:   return BV_PXP_OUT_CTRL_FORMAT__RGB565;
-	case V4L2_PIX_FMT_YUV32:    return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;
+	case V4L2_PIX_FMT_VUYA32:   return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;
 	case V4L2_PIX_FMT_UYVY:     return BV_PXP_OUT_CTRL_FORMAT__UYVY1P422;
 	case V4L2_PIX_FMT_VYUY:     return BV_PXP_OUT_CTRL_FORMAT__VYUY1P422;
 	case V4L2_PIX_FMT_GREY:     return BV_PXP_OUT_CTRL_FORMAT__Y8;
@@ -281,7 +281,7 @@ static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
 static bool pxp_v4l2_pix_fmt_is_yuv(u32 v4l2_pix_fmt)
 {
 	switch (v4l2_pix_fmt) {
-	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_VUYA32:
 	case V4L2_PIX_FMT_UYVY:
 	case V4L2_PIX_FMT_YUYV:
 	case V4L2_PIX_FMT_VYUY:
-- 
2.14.5


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

* Re: [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32
  2019-02-08  3:18 ` [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 Vivek Kasireddy
@ 2019-02-08  9:14   ` Philipp Zabel
  2019-02-08  9:15   ` Hans Verkuil
  2019-02-08 10:31   ` Philipp Zabel
  2 siblings, 0 replies; 14+ messages in thread
From: Philipp Zabel @ 2019-02-08  9:14 UTC (permalink / raw)
  To: Vivek Kasireddy, linux-media

On Thu, 2019-02-07 at 19:18 -0800, Vivek Kasireddy wrote:
> Buffers generated with YUV32 format seems to be incorrect, hence use
> VUYA32 instead.
> 
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>

Thanks!

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp


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

* Re: [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32
  2019-02-08  3:18 ` [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 Vivek Kasireddy
  2019-02-08  9:14   ` Philipp Zabel
@ 2019-02-08  9:15   ` Hans Verkuil
  2019-02-08  9:47     ` Philipp Zabel
  2019-02-08 10:31   ` Philipp Zabel
  2 siblings, 1 reply; 14+ messages in thread
From: Hans Verkuil @ 2019-02-08  9:15 UTC (permalink / raw)
  To: Vivek Kasireddy, linux-media; +Cc: Philipp Zabel

On 2/8/19 4:18 AM, Vivek Kasireddy wrote:
> Buffers generated with YUV32 format seems to be incorrect, hence use
> VUYA32 instead.
> 
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>

Philipp, I wonder whether VUYA32 or VUYX32 should be used? I think the alpha
channel is completely ignored on the source side and on the destination side
it is probably set by some fixed value?

Note that there exists a control V4L2_CID_ALPHA_COMPONENT that can be used
to let userspace specify the generated alpha value.

What if both source and destination formats have an alpha channel? Can the
hardware preserved the alpha values?

Regards,

	Hans

> ---
>  drivers/media/platform/imx-pxp.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c
> index f087dc4fc729..70adbe38f802 100644
> --- a/drivers/media/platform/imx-pxp.c
> +++ b/drivers/media/platform/imx-pxp.c
> @@ -90,7 +90,7 @@ static struct pxp_fmt formats[] = {
>  		.depth	= 16,
>  		.types	= MEM2MEM_CAPTURE | MEM2MEM_OUTPUT,
>  	}, {
> -		.fourcc = V4L2_PIX_FMT_YUV32,
> +		.fourcc = V4L2_PIX_FMT_VUYA32,
>  		.depth	= 32,
>  		.types	= MEM2MEM_CAPTURE | MEM2MEM_OUTPUT,
>  	}, {
> @@ -236,7 +236,7 @@ static u32 pxp_v4l2_pix_fmt_to_ps_format(u32 v4l2_pix_fmt)
>  	case V4L2_PIX_FMT_RGB555:  return BV_PXP_PS_CTRL_FORMAT__RGB555;
>  	case V4L2_PIX_FMT_RGB444:  return BV_PXP_PS_CTRL_FORMAT__RGB444;
>  	case V4L2_PIX_FMT_RGB565:  return BV_PXP_PS_CTRL_FORMAT__RGB565;
> -	case V4L2_PIX_FMT_YUV32:   return BV_PXP_PS_CTRL_FORMAT__YUV1P444;
> +	case V4L2_PIX_FMT_VUYA32:  return BV_PXP_PS_CTRL_FORMAT__YUV1P444;
>  	case V4L2_PIX_FMT_UYVY:    return BV_PXP_PS_CTRL_FORMAT__UYVY1P422;
>  	case V4L2_PIX_FMT_YUYV:    return BM_PXP_PS_CTRL_WB_SWAP |
>  					  BV_PXP_PS_CTRL_FORMAT__UYVY1P422;
> @@ -265,7 +265,7 @@ static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
>  	case V4L2_PIX_FMT_RGB555:   return BV_PXP_OUT_CTRL_FORMAT__RGB555;
>  	case V4L2_PIX_FMT_RGB444:   return BV_PXP_OUT_CTRL_FORMAT__RGB444;
>  	case V4L2_PIX_FMT_RGB565:   return BV_PXP_OUT_CTRL_FORMAT__RGB565;
> -	case V4L2_PIX_FMT_YUV32:    return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;
> +	case V4L2_PIX_FMT_VUYA32:   return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;
>  	case V4L2_PIX_FMT_UYVY:     return BV_PXP_OUT_CTRL_FORMAT__UYVY1P422;
>  	case V4L2_PIX_FMT_VYUY:     return BV_PXP_OUT_CTRL_FORMAT__VYUY1P422;
>  	case V4L2_PIX_FMT_GREY:     return BV_PXP_OUT_CTRL_FORMAT__Y8;
> @@ -281,7 +281,7 @@ static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
>  static bool pxp_v4l2_pix_fmt_is_yuv(u32 v4l2_pix_fmt)
>  {
>  	switch (v4l2_pix_fmt) {
> -	case V4L2_PIX_FMT_YUV32:
> +	case V4L2_PIX_FMT_VUYA32:
>  	case V4L2_PIX_FMT_UYVY:
>  	case V4L2_PIX_FMT_YUYV:
>  	case V4L2_PIX_FMT_VYUY:
> 


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

* Re: [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32
  2019-02-08  9:15   ` Hans Verkuil
@ 2019-02-08  9:47     ` Philipp Zabel
  0 siblings, 0 replies; 14+ messages in thread
From: Philipp Zabel @ 2019-02-08  9:47 UTC (permalink / raw)
  To: Hans Verkuil, Vivek Kasireddy, linux-media

On Fri, 2019-02-08 at 10:15 +0100, Hans Verkuil wrote:
> On 2/8/19 4:18 AM, Vivek Kasireddy wrote:
> > Buffers generated with YUV32 format seems to be incorrect, hence use
> > VUYA32 instead.
> > 
> > Cc: Philipp Zabel <p.zabel@pengutronix.de>
> > Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> 
> Philipp, I wonder whether VUYA32 or VUYX32 should be used? I think the alpha
> channel is completely ignored on the source side and on the destination side
> it is probably set by some fixed value?
>
> Note that there exists a control V4L2_CID_ALPHA_COMPONENT that can be used
> to let userspace specify the generated alpha value.

Oh, that is correct. V4L2_CID_ALPHA_COMPONENT is wired up in the imx-pxp 
driver to the alpha output override, and the value correctly appears in
the VUYA32 output.

> What if both source and destination formats have an alpha channel? Can the
> hardware preserved the alpha values?

The hardware should support preserving the alpha channel, but the driver
currently always enables the V4L2_CID_ALPHA_COMPONENT override. Right
now it would be correct to allow only VUYX32 on the output queue and
both VUYA32 and VUYX32 on the capture queue.

For VUYA32 on the output queue we'd have to disable the alpha override
and check whether the hardware properly preserves the alpha channel.

regards
Philipp

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

* Re: [PATCH 2/4] media: v4l2-tpg-core: Add support for 32-bit packed YUV formats
  2019-02-08  3:18 ` [PATCH 2/4] media: v4l2-tpg-core: Add support for " Vivek Kasireddy
@ 2019-02-08 10:21   ` kbuild test robot
  2019-02-08 10:49   ` kbuild test robot
  1 sibling, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2019-02-08 10:21 UTC (permalink / raw)
  To: Vivek Kasireddy; +Cc: kbuild-all, linux-media, Vivek Kasireddy, Hans Verkuil

[-- Attachment #1: Type: text/plain, Size: 13706 bytes --]

Hi Vivek,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v5.0-rc4 next-20190207]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Vivek-Kasireddy/Add-support-for-32-bit-packed-YUV-formats/20190208-173506
base:   git://linuxtv.org/media_tree.git master
config: i386-randconfig-x017-201905 (attached as .config)
compiler: gcc-8 (Debian 8.2.0-15) 8.2.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/media/common/v4l2-tpg/v4l2-tpg-core.c: In function 'gen_twopix':
>> drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1283:2: error: duplicate case value
     case V4L2_PIX_FMT_YUV32:
     ^~~~
   drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1281:2: note: previously used here
     case V4L2_PIX_FMT_YUV32:
     ^~~~

vim +1283 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c

  1051	
  1052	/* 'odd' is true for pixels 1, 3, 5, etc. and false for pixels 0, 2, 4, etc. */
  1053	static void gen_twopix(struct tpg_data *tpg,
  1054			u8 buf[TPG_MAX_PLANES][8], int color, bool odd)
  1055	{
  1056		unsigned offset = odd * tpg->twopixelsize[0] / 2;
  1057		u8 alpha = tpg->alpha_component;
  1058		u8 r_y_h, g_u_s, b_v;
  1059	
  1060		if (tpg->alpha_red_only && color != TPG_COLOR_CSC_RED &&
  1061					   color != TPG_COLOR_100_RED &&
  1062					   color != TPG_COLOR_75_RED)
  1063			alpha = 0;
  1064		if (color == TPG_COLOR_RANDOM)
  1065			precalculate_color(tpg, color);
  1066		r_y_h = tpg->colors[color][0]; /* R or precalculated Y, H */
  1067		g_u_s = tpg->colors[color][1]; /* G or precalculated U, V */
  1068		b_v = tpg->colors[color][2]; /* B or precalculated V */
  1069	
  1070		switch (tpg->fourcc) {
  1071		case V4L2_PIX_FMT_GREY:
  1072			buf[0][offset] = r_y_h;
  1073			break;
  1074		case V4L2_PIX_FMT_Y10:
  1075			buf[0][offset] = (r_y_h << 2) & 0xff;
  1076			buf[0][offset+1] = r_y_h >> 6;
  1077			break;
  1078		case V4L2_PIX_FMT_Y12:
  1079			buf[0][offset] = (r_y_h << 4) & 0xff;
  1080			buf[0][offset+1] = r_y_h >> 4;
  1081			break;
  1082		case V4L2_PIX_FMT_Y16:
  1083		case V4L2_PIX_FMT_Z16:
  1084			/*
  1085			 * Ideally both bytes should be set to r_y_h, but then you won't
  1086			 * be able to detect endian problems. So keep it 0 except for
  1087			 * the corner case where r_y_h is 0xff so white really will be
  1088			 * white (0xffff).
  1089			 */
  1090			buf[0][offset] = r_y_h == 0xff ? r_y_h : 0;
  1091			buf[0][offset+1] = r_y_h;
  1092			break;
  1093		case V4L2_PIX_FMT_Y16_BE:
  1094			/* See comment for V4L2_PIX_FMT_Y16 above */
  1095			buf[0][offset] = r_y_h;
  1096			buf[0][offset+1] = r_y_h == 0xff ? r_y_h : 0;
  1097			break;
  1098		case V4L2_PIX_FMT_YUV422M:
  1099		case V4L2_PIX_FMT_YUV422P:
  1100		case V4L2_PIX_FMT_YUV420:
  1101		case V4L2_PIX_FMT_YUV420M:
  1102			buf[0][offset] = r_y_h;
  1103			if (odd) {
  1104				buf[1][0] = (buf[1][0] + g_u_s) / 2;
  1105				buf[2][0] = (buf[2][0] + b_v) / 2;
  1106				buf[1][1] = buf[1][0];
  1107				buf[2][1] = buf[2][0];
  1108				break;
  1109			}
  1110			buf[1][0] = g_u_s;
  1111			buf[2][0] = b_v;
  1112			break;
  1113		case V4L2_PIX_FMT_YVU422M:
  1114		case V4L2_PIX_FMT_YVU420:
  1115		case V4L2_PIX_FMT_YVU420M:
  1116			buf[0][offset] = r_y_h;
  1117			if (odd) {
  1118				buf[1][0] = (buf[1][0] + b_v) / 2;
  1119				buf[2][0] = (buf[2][0] + g_u_s) / 2;
  1120				buf[1][1] = buf[1][0];
  1121				buf[2][1] = buf[2][0];
  1122				break;
  1123			}
  1124			buf[1][0] = b_v;
  1125			buf[2][0] = g_u_s;
  1126			break;
  1127	
  1128		case V4L2_PIX_FMT_NV12:
  1129		case V4L2_PIX_FMT_NV12M:
  1130		case V4L2_PIX_FMT_NV16:
  1131		case V4L2_PIX_FMT_NV16M:
  1132			buf[0][offset] = r_y_h;
  1133			if (odd) {
  1134				buf[1][0] = (buf[1][0] + g_u_s) / 2;
  1135				buf[1][1] = (buf[1][1] + b_v) / 2;
  1136				break;
  1137			}
  1138			buf[1][0] = g_u_s;
  1139			buf[1][1] = b_v;
  1140			break;
  1141		case V4L2_PIX_FMT_NV21:
  1142		case V4L2_PIX_FMT_NV21M:
  1143		case V4L2_PIX_FMT_NV61:
  1144		case V4L2_PIX_FMT_NV61M:
  1145			buf[0][offset] = r_y_h;
  1146			if (odd) {
  1147				buf[1][0] = (buf[1][0] + b_v) / 2;
  1148				buf[1][1] = (buf[1][1] + g_u_s) / 2;
  1149				break;
  1150			}
  1151			buf[1][0] = b_v;
  1152			buf[1][1] = g_u_s;
  1153			break;
  1154	
  1155		case V4L2_PIX_FMT_YUV444M:
  1156			buf[0][offset] = r_y_h;
  1157			buf[1][offset] = g_u_s;
  1158			buf[2][offset] = b_v;
  1159			break;
  1160	
  1161		case V4L2_PIX_FMT_YVU444M:
  1162			buf[0][offset] = r_y_h;
  1163			buf[1][offset] = b_v;
  1164			buf[2][offset] = g_u_s;
  1165			break;
  1166	
  1167		case V4L2_PIX_FMT_NV24:
  1168			buf[0][offset] = r_y_h;
  1169			buf[1][2 * offset] = g_u_s;
  1170			buf[1][(2 * offset + 1) % 8] = b_v;
  1171			break;
  1172	
  1173		case V4L2_PIX_FMT_NV42:
  1174			buf[0][offset] = r_y_h;
  1175			buf[1][2 * offset] = b_v;
  1176			buf[1][(2 * offset + 1) % 8] = g_u_s;
  1177			break;
  1178	
  1179		case V4L2_PIX_FMT_YUYV:
  1180			buf[0][offset] = r_y_h;
  1181			if (odd) {
  1182				buf[0][1] = (buf[0][1] + g_u_s) / 2;
  1183				buf[0][3] = (buf[0][3] + b_v) / 2;
  1184				break;
  1185			}
  1186			buf[0][1] = g_u_s;
  1187			buf[0][3] = b_v;
  1188			break;
  1189		case V4L2_PIX_FMT_UYVY:
  1190			buf[0][offset + 1] = r_y_h;
  1191			if (odd) {
  1192				buf[0][0] = (buf[0][0] + g_u_s) / 2;
  1193				buf[0][2] = (buf[0][2] + b_v) / 2;
  1194				break;
  1195			}
  1196			buf[0][0] = g_u_s;
  1197			buf[0][2] = b_v;
  1198			break;
  1199		case V4L2_PIX_FMT_YVYU:
  1200			buf[0][offset] = r_y_h;
  1201			if (odd) {
  1202				buf[0][1] = (buf[0][1] + b_v) / 2;
  1203				buf[0][3] = (buf[0][3] + g_u_s) / 2;
  1204				break;
  1205			}
  1206			buf[0][1] = b_v;
  1207			buf[0][3] = g_u_s;
  1208			break;
  1209		case V4L2_PIX_FMT_VYUY:
  1210			buf[0][offset + 1] = r_y_h;
  1211			if (odd) {
  1212				buf[0][0] = (buf[0][0] + b_v) / 2;
  1213				buf[0][2] = (buf[0][2] + g_u_s) / 2;
  1214				break;
  1215			}
  1216			buf[0][0] = b_v;
  1217			buf[0][2] = g_u_s;
  1218			break;
  1219		case V4L2_PIX_FMT_RGB332:
  1220			buf[0][offset] = (r_y_h << 5) | (g_u_s << 2) | b_v;
  1221			break;
  1222		case V4L2_PIX_FMT_YUV565:
  1223		case V4L2_PIX_FMT_RGB565:
  1224			buf[0][offset] = (g_u_s << 5) | b_v;
  1225			buf[0][offset + 1] = (r_y_h << 3) | (g_u_s >> 3);
  1226			break;
  1227		case V4L2_PIX_FMT_RGB565X:
  1228			buf[0][offset] = (r_y_h << 3) | (g_u_s >> 3);
  1229			buf[0][offset + 1] = (g_u_s << 5) | b_v;
  1230			break;
  1231		case V4L2_PIX_FMT_RGB444:
  1232		case V4L2_PIX_FMT_XRGB444:
  1233			alpha = 0;
  1234			/* fall through */
  1235		case V4L2_PIX_FMT_YUV444:
  1236		case V4L2_PIX_FMT_ARGB444:
  1237			buf[0][offset] = (g_u_s << 4) | b_v;
  1238			buf[0][offset + 1] = (alpha & 0xf0) | r_y_h;
  1239			break;
  1240		case V4L2_PIX_FMT_RGB555:
  1241		case V4L2_PIX_FMT_XRGB555:
  1242			alpha = 0;
  1243			/* fall through */
  1244		case V4L2_PIX_FMT_YUV555:
  1245		case V4L2_PIX_FMT_ARGB555:
  1246			buf[0][offset] = (g_u_s << 5) | b_v;
  1247			buf[0][offset + 1] = (alpha & 0x80) | (r_y_h << 2)
  1248							    | (g_u_s >> 3);
  1249			break;
  1250		case V4L2_PIX_FMT_RGB555X:
  1251		case V4L2_PIX_FMT_XRGB555X:
  1252			alpha = 0;
  1253			/* fall through */
  1254		case V4L2_PIX_FMT_ARGB555X:
  1255			buf[0][offset] = (alpha & 0x80) | (r_y_h << 2) | (g_u_s >> 3);
  1256			buf[0][offset + 1] = (g_u_s << 5) | b_v;
  1257			break;
  1258		case V4L2_PIX_FMT_RGB24:
  1259		case V4L2_PIX_FMT_HSV24:
  1260			buf[0][offset] = r_y_h;
  1261			buf[0][offset + 1] = g_u_s;
  1262			buf[0][offset + 2] = b_v;
  1263			break;
  1264		case V4L2_PIX_FMT_BGR24:
  1265			buf[0][offset] = b_v;
  1266			buf[0][offset + 1] = g_u_s;
  1267			buf[0][offset + 2] = r_y_h;
  1268			break;
  1269		case V4L2_PIX_FMT_BGR666:
  1270			buf[0][offset] = (b_v << 2) | (g_u_s >> 4);
  1271			buf[0][offset + 1] = (g_u_s << 4) | (r_y_h >> 2);
  1272			buf[0][offset + 2] = r_y_h << 6;
  1273			buf[0][offset + 3] = 0;
  1274			break;
  1275		case V4L2_PIX_FMT_RGB32:
  1276		case V4L2_PIX_FMT_XRGB32:
  1277		case V4L2_PIX_FMT_HSV32:
  1278		case V4L2_PIX_FMT_XYUV32:
  1279			alpha = 0;
  1280			/* fall through */
  1281		case V4L2_PIX_FMT_YUV32:
  1282		case V4L2_PIX_FMT_ARGB32:
> 1283		case V4L2_PIX_FMT_YUV32:
  1284		case V4L2_PIX_FMT_AYUV32:
  1285			buf[0][offset] = alpha;
  1286			buf[0][offset + 1] = r_y_h;
  1287			buf[0][offset + 2] = g_u_s;
  1288			buf[0][offset + 3] = b_v;
  1289			break;
  1290		case V4L2_PIX_FMT_BGR32:
  1291		case V4L2_PIX_FMT_XBGR32:
  1292		case V4L2_PIX_FMT_VUYX32:
  1293			alpha = 0;
  1294			/* fall through */
  1295		case V4L2_PIX_FMT_ABGR32:
  1296		case V4L2_PIX_FMT_VUYA32:
  1297			buf[0][offset] = b_v;
  1298			buf[0][offset + 1] = g_u_s;
  1299			buf[0][offset + 2] = r_y_h;
  1300			buf[0][offset + 3] = alpha;
  1301			break;
  1302		case V4L2_PIX_FMT_SBGGR8:
  1303			buf[0][offset] = odd ? g_u_s : b_v;
  1304			buf[1][offset] = odd ? r_y_h : g_u_s;
  1305			break;
  1306		case V4L2_PIX_FMT_SGBRG8:
  1307			buf[0][offset] = odd ? b_v : g_u_s;
  1308			buf[1][offset] = odd ? g_u_s : r_y_h;
  1309			break;
  1310		case V4L2_PIX_FMT_SGRBG8:
  1311			buf[0][offset] = odd ? r_y_h : g_u_s;
  1312			buf[1][offset] = odd ? g_u_s : b_v;
  1313			break;
  1314		case V4L2_PIX_FMT_SRGGB8:
  1315			buf[0][offset] = odd ? g_u_s : r_y_h;
  1316			buf[1][offset] = odd ? b_v : g_u_s;
  1317			break;
  1318		case V4L2_PIX_FMT_SBGGR10:
  1319			buf[0][offset] = odd ? g_u_s << 2 : b_v << 2;
  1320			buf[0][offset + 1] = odd ? g_u_s >> 6 : b_v >> 6;
  1321			buf[1][offset] = odd ? r_y_h << 2 : g_u_s << 2;
  1322			buf[1][offset + 1] = odd ? r_y_h >> 6 : g_u_s >> 6;
  1323			buf[0][offset] |= (buf[0][offset] >> 2) & 3;
  1324			buf[1][offset] |= (buf[1][offset] >> 2) & 3;
  1325			break;
  1326		case V4L2_PIX_FMT_SGBRG10:
  1327			buf[0][offset] = odd ? b_v << 2 : g_u_s << 2;
  1328			buf[0][offset + 1] = odd ? b_v >> 6 : g_u_s >> 6;
  1329			buf[1][offset] = odd ? g_u_s << 2 : r_y_h << 2;
  1330			buf[1][offset + 1] = odd ? g_u_s >> 6 : r_y_h >> 6;
  1331			buf[0][offset] |= (buf[0][offset] >> 2) & 3;
  1332			buf[1][offset] |= (buf[1][offset] >> 2) & 3;
  1333			break;
  1334		case V4L2_PIX_FMT_SGRBG10:
  1335			buf[0][offset] = odd ? r_y_h << 2 : g_u_s << 2;
  1336			buf[0][offset + 1] = odd ? r_y_h >> 6 : g_u_s >> 6;
  1337			buf[1][offset] = odd ? g_u_s << 2 : b_v << 2;
  1338			buf[1][offset + 1] = odd ? g_u_s >> 6 : b_v >> 6;
  1339			buf[0][offset] |= (buf[0][offset] >> 2) & 3;
  1340			buf[1][offset] |= (buf[1][offset] >> 2) & 3;
  1341			break;
  1342		case V4L2_PIX_FMT_SRGGB10:
  1343			buf[0][offset] = odd ? g_u_s << 2 : r_y_h << 2;
  1344			buf[0][offset + 1] = odd ? g_u_s >> 6 : r_y_h >> 6;
  1345			buf[1][offset] = odd ? b_v << 2 : g_u_s << 2;
  1346			buf[1][offset + 1] = odd ? b_v >> 6 : g_u_s >> 6;
  1347			buf[0][offset] |= (buf[0][offset] >> 2) & 3;
  1348			buf[1][offset] |= (buf[1][offset] >> 2) & 3;
  1349			break;
  1350		case V4L2_PIX_FMT_SBGGR12:
  1351			buf[0][offset] = odd ? g_u_s << 4 : b_v << 4;
  1352			buf[0][offset + 1] = odd ? g_u_s >> 4 : b_v >> 4;
  1353			buf[1][offset] = odd ? r_y_h << 4 : g_u_s << 4;
  1354			buf[1][offset + 1] = odd ? r_y_h >> 4 : g_u_s >> 4;
  1355			buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
  1356			buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
  1357			break;
  1358		case V4L2_PIX_FMT_SGBRG12:
  1359			buf[0][offset] = odd ? b_v << 4 : g_u_s << 4;
  1360			buf[0][offset + 1] = odd ? b_v >> 4 : g_u_s >> 4;
  1361			buf[1][offset] = odd ? g_u_s << 4 : r_y_h << 4;
  1362			buf[1][offset + 1] = odd ? g_u_s >> 4 : r_y_h >> 4;
  1363			buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
  1364			buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
  1365			break;
  1366		case V4L2_PIX_FMT_SGRBG12:
  1367			buf[0][offset] = odd ? r_y_h << 4 : g_u_s << 4;
  1368			buf[0][offset + 1] = odd ? r_y_h >> 4 : g_u_s >> 4;
  1369			buf[1][offset] = odd ? g_u_s << 4 : b_v << 4;
  1370			buf[1][offset + 1] = odd ? g_u_s >> 4 : b_v >> 4;
  1371			buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
  1372			buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
  1373			break;
  1374		case V4L2_PIX_FMT_SRGGB12:
  1375			buf[0][offset] = odd ? g_u_s << 4 : r_y_h << 4;
  1376			buf[0][offset + 1] = odd ? g_u_s >> 4 : r_y_h >> 4;
  1377			buf[1][offset] = odd ? b_v << 4 : g_u_s << 4;
  1378			buf[1][offset + 1] = odd ? b_v >> 4 : g_u_s >> 4;
  1379			buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
  1380			buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
  1381			break;
  1382		case V4L2_PIX_FMT_SBGGR16:
  1383			buf[0][offset] = buf[0][offset + 1] = odd ? g_u_s : b_v;
  1384			buf[1][offset] = buf[1][offset + 1] = odd ? r_y_h : g_u_s;
  1385			break;
  1386		case V4L2_PIX_FMT_SGBRG16:
  1387			buf[0][offset] = buf[0][offset + 1] = odd ? b_v : g_u_s;
  1388			buf[1][offset] = buf[1][offset + 1] = odd ? g_u_s : r_y_h;
  1389			break;
  1390		case V4L2_PIX_FMT_SGRBG16:
  1391			buf[0][offset] = buf[0][offset + 1] = odd ? r_y_h : g_u_s;
  1392			buf[1][offset] = buf[1][offset + 1] = odd ? g_u_s : b_v;
  1393			break;
  1394		case V4L2_PIX_FMT_SRGGB16:
  1395			buf[0][offset] = buf[0][offset + 1] = odd ? g_u_s : r_y_h;
  1396			buf[1][offset] = buf[1][offset + 1] = odd ? b_v : g_u_s;
  1397			break;
  1398		}
  1399	}
  1400	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30569 bytes --]

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

* Re: [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32
  2019-02-08  3:18 ` [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 Vivek Kasireddy
  2019-02-08  9:14   ` Philipp Zabel
  2019-02-08  9:15   ` Hans Verkuil
@ 2019-02-08 10:31   ` Philipp Zabel
  2019-02-09  1:38     ` [PATCH v2 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 (v2) Vivek Kasireddy
  2 siblings, 1 reply; 14+ messages in thread
From: Philipp Zabel @ 2019-02-08 10:31 UTC (permalink / raw)
  To: Vivek Kasireddy, linux-media

Hi Vivek,

On Thu, 2019-02-07 at 19:18 -0800, Vivek Kasireddy wrote:
> Buffers generated with YUV32 format seems to be incorrect, hence use
> VUYA32 instead.
> 
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
>  drivers/media/platform/imx-pxp.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c
> index f087dc4fc729..70adbe38f802 100644
> --- a/drivers/media/platform/imx-pxp.c
> +++ b/drivers/media/platform/imx-pxp.c
> @@ -90,7 +90,7 @@ static struct pxp_fmt formats[] = {
>  		.depth	= 16,
>  		.types	= MEM2MEM_CAPTURE | MEM2MEM_OUTPUT,
>  	}, {
> -		.fourcc = V4L2_PIX_FMT_YUV32,
> +		.fourcc = V4L2_PIX_FMT_VUYA32,

After Hans' comment I noticed that to support VUYA32 input correctly,
we'll have to disable the alpha override. Currently the alpha channel of
buffers on the OUTPUT queue is ignored. The driver always uses the value
of V4L2_CID_ALPHA_COMPONENT when writing alpha values. Therefore, it
would be more correct to replace VUYA32 with VUYX32 everywhere.

Or alternatively add both formats, but only VUYX32 on the output queue:

 	}, {
-		.fourcc = V4L2_PIX_FMT_YUV32,
+		.fourcc = V4L2_PIX_FMT_VUYA32,
+		.depth  = 32,
+		.types  = MEM2MEM_CAPTURE,
+	}, {
+		.fourcc = V4L2_PIX_FMT_VUYX32,
 		.depth  = 32,

>  		.depth	= 32,
>  		.types	= MEM2MEM_CAPTURE | MEM2MEM_OUTPUT,
>  	}, {
> @@ -236,7 +236,7 @@ static u32 pxp_v4l2_pix_fmt_to_ps_format(u32 v4l2_pix_fmt)
>  	case V4L2_PIX_FMT_RGB555:  return BV_PXP_PS_CTRL_FORMAT__RGB555;
>  	case V4L2_PIX_FMT_RGB444:  return BV_PXP_PS_CTRL_FORMAT__RGB444;
>  	case V4L2_PIX_FMT_RGB565:  return BV_PXP_PS_CTRL_FORMAT__RGB565;
> -	case V4L2_PIX_FMT_YUV32:   return BV_PXP_PS_CTRL_FORMAT__YUV1P444;
> +	case V4L2_PIX_FMT_VUYA32:  return BV_PXP_PS_CTRL_FORMAT__YUV1P444;

This should be replaced with VUYX32:

-	case V4L2_PIX_FMT_YUV32:   return BV_PXP_PS_CTRL_FORMAT__YUV1P444;
+	case V4L2_PIX_FMT_VUYX32:  return BV_PXP_PS_CTRL_FORMAT__YUV1P444;

>  	case V4L2_PIX_FMT_UYVY:    return BV_PXP_PS_CTRL_FORMAT__UYVY1P422;
>  	case V4L2_PIX_FMT_YUYV:    return BM_PXP_PS_CTRL_WB_SWAP |
>  					  BV_PXP_PS_CTRL_FORMAT__UYVY1P422;
> @@ -265,7 +265,7 @@ static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
>  	case V4L2_PIX_FMT_RGB555:   return BV_PXP_OUT_CTRL_FORMAT__RGB555;
>  	case V4L2_PIX_FMT_RGB444:   return BV_PXP_OUT_CTRL_FORMAT__RGB444;
>  	case V4L2_PIX_FMT_RGB565:   return BV_PXP_OUT_CTRL_FORMAT__RGB565;
> -	case V4L2_PIX_FMT_YUV32:    return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;
> +	case V4L2_PIX_FMT_VUYA32:   return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;

Here you could add both:

-	case V4L2_PIX_FMT_YUV32:    return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;
+	case V4L2_PIX_FMT_VUYA32:
+	case V4L2_PIX_FMT_VUYX32:   return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;

>  	case V4L2_PIX_FMT_UYVY:     return BV_PXP_OUT_CTRL_FORMAT__UYVY1P422;
>  	case V4L2_PIX_FMT_VYUY:     return BV_PXP_OUT_CTRL_FORMAT__VYUY1P422;
>  	case V4L2_PIX_FMT_GREY:     return BV_PXP_OUT_CTRL_FORMAT__Y8;
> @@ -281,7 +281,7 @@ static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
>  static bool pxp_v4l2_pix_fmt_is_yuv(u32 v4l2_pix_fmt)
>  {
>  	switch (v4l2_pix_fmt) {
> -	case V4L2_PIX_FMT_YUV32:
> +	case V4L2_PIX_FMT_VUYA32:

And here as well:

-	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_VUYA32:
+	case V4L2_PIX_FMT_VUYX32:

>  	case V4L2_PIX_FMT_UYVY:
>  	case V4L2_PIX_FMT_YUYV:
>  	case V4L2_PIX_FMT_VYUY:

regards
Philipp

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

* Re: [PATCH 2/4] media: v4l2-tpg-core: Add support for 32-bit packed YUV formats
  2019-02-08  3:18 ` [PATCH 2/4] media: v4l2-tpg-core: Add support for " Vivek Kasireddy
  2019-02-08 10:21   ` kbuild test robot
@ 2019-02-08 10:49   ` kbuild test robot
  2019-02-09  1:29     ` [PATCH v2 2/4] media: v4l2-tpg-core: Add support for 32-bit packed YUV formats (v2) Vivek Kasireddy
  1 sibling, 1 reply; 14+ messages in thread
From: kbuild test robot @ 2019-02-08 10:49 UTC (permalink / raw)
  To: Vivek Kasireddy; +Cc: kbuild-all, linux-media, Vivek Kasireddy, Hans Verkuil

[-- Attachment #1: Type: text/plain, Size: 46331 bytes --]

Hi Vivek,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v5.0-rc4 next-20190207]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Vivek-Kasireddy/Add-support-for-32-bit-packed-YUV-formats/20190208-173506
base:   git://linuxtv.org/media_tree.git master
config: nds32-allmodconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 6.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=6.4.0 make.cross ARCH=nds32 

All errors (new ones prefixed by >>):

   drivers/media/common/v4l2-tpg/v4l2-tpg-core.c: In function 'gen_twopix':
   drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1283:2: error: duplicate case value
     case V4L2_PIX_FMT_YUV32:
     ^~~~
>> drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1281:2: error: previously used here
     case V4L2_PIX_FMT_YUV32:
     ^~~~

vim +1281 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c

63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1051  
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1052  /* 'odd' is true for pixels 1, 3, 5, etc. and false for pixels 0, 2, 4, etc. */
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1053  static void gen_twopix(struct tpg_data *tpg,
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1054  		u8 buf[TPG_MAX_PLANES][8], int color, bool odd)
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1055  {
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1056  	unsigned offset = odd * tpg->twopixelsize[0] / 2;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1057  	u8 alpha = tpg->alpha_component;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1058  	u8 r_y_h, g_u_s, b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1059  
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1060  	if (tpg->alpha_red_only && color != TPG_COLOR_CSC_RED &&
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1061  				   color != TPG_COLOR_100_RED &&
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1062  				   color != TPG_COLOR_75_RED)
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1063  		alpha = 0;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1064  	if (color == TPG_COLOR_RANDOM)
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1065  		precalculate_color(tpg, color);
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1066  	r_y_h = tpg->colors[color][0]; /* R or precalculated Y, H */
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1067  	g_u_s = tpg->colors[color][1]; /* G or precalculated U, V */
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1068  	b_v = tpg->colors[color][2]; /* B or precalculated V */
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1069  
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1070  	switch (tpg->fourcc) {
51f3096835 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1071  	case V4L2_PIX_FMT_GREY:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1072  		buf[0][offset] = r_y_h;
51f3096835 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1073  		break;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1074  	case V4L2_PIX_FMT_Y10:
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1075  		buf[0][offset] = (r_y_h << 2) & 0xff;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1076  		buf[0][offset+1] = r_y_h >> 6;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1077  		break;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1078  	case V4L2_PIX_FMT_Y12:
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1079  		buf[0][offset] = (r_y_h << 4) & 0xff;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1080  		buf[0][offset+1] = r_y_h >> 4;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1081  		break;
18b3b3b8ed drivers/media/platform/vivid/vivid-tpg.c      Ricardo Ribalda Delgado 2015-05-04  1082  	case V4L2_PIX_FMT_Y16:
648301b456 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2018-08-11  1083  	case V4L2_PIX_FMT_Z16:
afeef4ee23 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-06-05  1084  		/*
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1085  		 * Ideally both bytes should be set to r_y_h, but then you won't
afeef4ee23 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-06-05  1086  		 * be able to detect endian problems. So keep it 0 except for
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1087  		 * the corner case where r_y_h is 0xff so white really will be
afeef4ee23 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-06-05  1088  		 * white (0xffff).
afeef4ee23 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-06-05  1089  		 */
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1090  		buf[0][offset] = r_y_h == 0xff ? r_y_h : 0;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1091  		buf[0][offset+1] = r_y_h;
18b3b3b8ed drivers/media/platform/vivid/vivid-tpg.c      Ricardo Ribalda Delgado 2015-05-04  1092  		break;
b0ce23f065 drivers/media/platform/vivid/vivid-tpg.c      Ricardo Ribalda Delgado 2015-05-04  1093  	case V4L2_PIX_FMT_Y16_BE:
afeef4ee23 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-06-05  1094  		/* See comment for V4L2_PIX_FMT_Y16 above */
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1095  		buf[0][offset] = r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1096  		buf[0][offset+1] = r_y_h == 0xff ? r_y_h : 0;
b0ce23f065 drivers/media/platform/vivid/vivid-tpg.c      Ricardo Ribalda Delgado 2015-05-04  1097  		break;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1098  	case V4L2_PIX_FMT_YUV422M:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1099  	case V4L2_PIX_FMT_YUV422P:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1100  	case V4L2_PIX_FMT_YUV420:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1101  	case V4L2_PIX_FMT_YUV420M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1102  		buf[0][offset] = r_y_h;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1103  		if (odd) {
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1104  			buf[1][0] = (buf[1][0] + g_u_s) / 2;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1105  			buf[2][0] = (buf[2][0] + b_v) / 2;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1106  			buf[1][1] = buf[1][0];
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1107  			buf[2][1] = buf[2][0];
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1108  			break;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1109  		}
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1110  		buf[1][0] = g_u_s;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1111  		buf[2][0] = b_v;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1112  		break;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1113  	case V4L2_PIX_FMT_YVU422M:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1114  	case V4L2_PIX_FMT_YVU420:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1115  	case V4L2_PIX_FMT_YVU420M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1116  		buf[0][offset] = r_y_h;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1117  		if (odd) {
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1118  			buf[1][0] = (buf[1][0] + b_v) / 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1119  			buf[2][0] = (buf[2][0] + g_u_s) / 2;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1120  			buf[1][1] = buf[1][0];
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1121  			buf[2][1] = buf[2][0];
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1122  			break;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1123  		}
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1124  		buf[1][0] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1125  		buf[2][0] = g_u_s;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1126  		break;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1127  
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1128  	case V4L2_PIX_FMT_NV12:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1129  	case V4L2_PIX_FMT_NV12M:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1130  	case V4L2_PIX_FMT_NV16:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1131  	case V4L2_PIX_FMT_NV16M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1132  		buf[0][offset] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1133  		if (odd) {
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1134  			buf[1][0] = (buf[1][0] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1135  			buf[1][1] = (buf[1][1] + b_v) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1136  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1137  		}
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1138  		buf[1][0] = g_u_s;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1139  		buf[1][1] = b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1140  		break;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1141  	case V4L2_PIX_FMT_NV21:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1142  	case V4L2_PIX_FMT_NV21M:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1143  	case V4L2_PIX_FMT_NV61:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1144  	case V4L2_PIX_FMT_NV61M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1145  		buf[0][offset] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1146  		if (odd) {
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1147  			buf[1][0] = (buf[1][0] + b_v) / 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1148  			buf[1][1] = (buf[1][1] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1149  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1150  		}
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1151  		buf[1][0] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1152  		buf[1][1] = g_u_s;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1153  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1154  
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1155  	case V4L2_PIX_FMT_YUV444M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1156  		buf[0][offset] = r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1157  		buf[1][offset] = g_u_s;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1158  		buf[2][offset] = b_v;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1159  		break;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1160  
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1161  	case V4L2_PIX_FMT_YVU444M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1162  		buf[0][offset] = r_y_h;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1163  		buf[1][offset] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1164  		buf[2][offset] = g_u_s;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1165  		break;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1166  
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1167  	case V4L2_PIX_FMT_NV24:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1168  		buf[0][offset] = r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1169  		buf[1][2 * offset] = g_u_s;
1a086879fd drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Mauro Carvalho Chehab   2018-03-22  1170  		buf[1][(2 * offset + 1) % 8] = b_v;
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1171  		break;
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1172  
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1173  	case V4L2_PIX_FMT_NV42:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1174  		buf[0][offset] = r_y_h;
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1175  		buf[1][2 * offset] = b_v;
1a086879fd drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Mauro Carvalho Chehab   2018-03-22  1176  		buf[1][(2 * offset + 1) % 8] = g_u_s;
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1177  		break;
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1178  
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1179  	case V4L2_PIX_FMT_YUYV:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1180  		buf[0][offset] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1181  		if (odd) {
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1182  			buf[0][1] = (buf[0][1] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1183  			buf[0][3] = (buf[0][3] + b_v) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1184  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1185  		}
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1186  		buf[0][1] = g_u_s;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1187  		buf[0][3] = b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1188  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1189  	case V4L2_PIX_FMT_UYVY:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1190  		buf[0][offset + 1] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1191  		if (odd) {
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1192  			buf[0][0] = (buf[0][0] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1193  			buf[0][2] = (buf[0][2] + b_v) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1194  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1195  		}
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1196  		buf[0][0] = g_u_s;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1197  		buf[0][2] = b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1198  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1199  	case V4L2_PIX_FMT_YVYU:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1200  		buf[0][offset] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1201  		if (odd) {
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1202  			buf[0][1] = (buf[0][1] + b_v) / 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1203  			buf[0][3] = (buf[0][3] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1204  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1205  		}
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1206  		buf[0][1] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1207  		buf[0][3] = g_u_s;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1208  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1209  	case V4L2_PIX_FMT_VYUY:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1210  		buf[0][offset + 1] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1211  		if (odd) {
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1212  			buf[0][0] = (buf[0][0] + b_v) / 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1213  			buf[0][2] = (buf[0][2] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1214  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1215  		}
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1216  		buf[0][0] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1217  		buf[0][2] = g_u_s;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1218  		break;
71491063b8 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1219  	case V4L2_PIX_FMT_RGB332:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1220  		buf[0][offset] = (r_y_h << 5) | (g_u_s << 2) | b_v;
71491063b8 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1221  		break;
628821c84e drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1222  	case V4L2_PIX_FMT_YUV565:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1223  	case V4L2_PIX_FMT_RGB565:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1224  		buf[0][offset] = (g_u_s << 5) | b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1225  		buf[0][offset + 1] = (r_y_h << 3) | (g_u_s >> 3);
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1226  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1227  	case V4L2_PIX_FMT_RGB565X:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1228  		buf[0][offset] = (r_y_h << 3) | (g_u_s >> 3);
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1229  		buf[0][offset + 1] = (g_u_s << 5) | b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1230  		break;
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1231  	case V4L2_PIX_FMT_RGB444:
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1232  	case V4L2_PIX_FMT_XRGB444:
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1233  		alpha = 0;
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1234  		/* fall through */
628821c84e drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1235  	case V4L2_PIX_FMT_YUV444:
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1236  	case V4L2_PIX_FMT_ARGB444:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1237  		buf[0][offset] = (g_u_s << 4) | b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1238  		buf[0][offset + 1] = (alpha & 0xf0) | r_y_h;
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1239  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1240  	case V4L2_PIX_FMT_RGB555:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1241  	case V4L2_PIX_FMT_XRGB555:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1242  		alpha = 0;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1243  		/* fall through */
628821c84e drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1244  	case V4L2_PIX_FMT_YUV555:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1245  	case V4L2_PIX_FMT_ARGB555:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1246  		buf[0][offset] = (g_u_s << 5) | b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1247  		buf[0][offset + 1] = (alpha & 0x80) | (r_y_h << 2)
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1248  						    | (g_u_s >> 3);
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1249  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1250  	case V4L2_PIX_FMT_RGB555X:
8f1ff5435d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1251  	case V4L2_PIX_FMT_XRGB555X:
8f1ff5435d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1252  		alpha = 0;
8f1ff5435d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1253  		/* fall through */
8f1ff5435d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1254  	case V4L2_PIX_FMT_ARGB555X:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1255  		buf[0][offset] = (alpha & 0x80) | (r_y_h << 2) | (g_u_s >> 3);
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1256  		buf[0][offset + 1] = (g_u_s << 5) | b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1257  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1258  	case V4L2_PIX_FMT_RGB24:
54fb153483 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1259  	case V4L2_PIX_FMT_HSV24:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1260  		buf[0][offset] = r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1261  		buf[0][offset + 1] = g_u_s;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1262  		buf[0][offset + 2] = b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1263  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1264  	case V4L2_PIX_FMT_BGR24:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1265  		buf[0][offset] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1266  		buf[0][offset + 1] = g_u_s;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1267  		buf[0][offset + 2] = r_y_h;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1268  		break;
68cd4e9f21 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1269  	case V4L2_PIX_FMT_BGR666:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1270  		buf[0][offset] = (b_v << 2) | (g_u_s >> 4);
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1271  		buf[0][offset + 1] = (g_u_s << 4) | (r_y_h >> 2);
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1272  		buf[0][offset + 2] = r_y_h << 6;
68cd4e9f21 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1273  		buf[0][offset + 3] = 0;
68cd4e9f21 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1274  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1275  	case V4L2_PIX_FMT_RGB32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1276  	case V4L2_PIX_FMT_XRGB32:
54fb153483 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1277  	case V4L2_PIX_FMT_HSV32:
5796e67411 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Vivek Kasireddy         2019-02-07  1278  	case V4L2_PIX_FMT_XYUV32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1279  		alpha = 0;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1280  		/* fall through */
628821c84e drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13 @1281  	case V4L2_PIX_FMT_YUV32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1282  	case V4L2_PIX_FMT_ARGB32:
5796e67411 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Vivek Kasireddy         2019-02-07 @1283  	case V4L2_PIX_FMT_YUV32:
5796e67411 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Vivek Kasireddy         2019-02-07  1284  	case V4L2_PIX_FMT_AYUV32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1285  		buf[0][offset] = alpha;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1286  		buf[0][offset + 1] = r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1287  		buf[0][offset + 2] = g_u_s;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1288  		buf[0][offset + 3] = b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1289  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1290  	case V4L2_PIX_FMT_BGR32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1291  	case V4L2_PIX_FMT_XBGR32:
5796e67411 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Vivek Kasireddy         2019-02-07  1292  	case V4L2_PIX_FMT_VUYX32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1293  		alpha = 0;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1294  		/* fall through */
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1295  	case V4L2_PIX_FMT_ABGR32:
5796e67411 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Vivek Kasireddy         2019-02-07  1296  	case V4L2_PIX_FMT_VUYA32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1297  		buf[0][offset] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1298  		buf[0][offset + 1] = g_u_s;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1299  		buf[0][offset + 2] = r_y_h;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1300  		buf[0][offset + 3] = alpha;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1301  		break;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1302  	case V4L2_PIX_FMT_SBGGR8:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1303  		buf[0][offset] = odd ? g_u_s : b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1304  		buf[1][offset] = odd ? r_y_h : g_u_s;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1305  		break;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1306  	case V4L2_PIX_FMT_SGBRG8:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1307  		buf[0][offset] = odd ? b_v : g_u_s;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1308  		buf[1][offset] = odd ? g_u_s : r_y_h;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1309  		break;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1310  	case V4L2_PIX_FMT_SGRBG8:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1311  		buf[0][offset] = odd ? r_y_h : g_u_s;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1312  		buf[1][offset] = odd ? g_u_s : b_v;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1313  		break;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1314  	case V4L2_PIX_FMT_SRGGB8:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1315  		buf[0][offset] = odd ? g_u_s : r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1316  		buf[1][offset] = odd ? b_v : g_u_s;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1317  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1318  	case V4L2_PIX_FMT_SBGGR10:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1319  		buf[0][offset] = odd ? g_u_s << 2 : b_v << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1320  		buf[0][offset + 1] = odd ? g_u_s >> 6 : b_v >> 6;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1321  		buf[1][offset] = odd ? r_y_h << 2 : g_u_s << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1322  		buf[1][offset + 1] = odd ? r_y_h >> 6 : g_u_s >> 6;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1323  		buf[0][offset] |= (buf[0][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1324  		buf[1][offset] |= (buf[1][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1325  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1326  	case V4L2_PIX_FMT_SGBRG10:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1327  		buf[0][offset] = odd ? b_v << 2 : g_u_s << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1328  		buf[0][offset + 1] = odd ? b_v >> 6 : g_u_s >> 6;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1329  		buf[1][offset] = odd ? g_u_s << 2 : r_y_h << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1330  		buf[1][offset + 1] = odd ? g_u_s >> 6 : r_y_h >> 6;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1331  		buf[0][offset] |= (buf[0][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1332  		buf[1][offset] |= (buf[1][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1333  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1334  	case V4L2_PIX_FMT_SGRBG10:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1335  		buf[0][offset] = odd ? r_y_h << 2 : g_u_s << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1336  		buf[0][offset + 1] = odd ? r_y_h >> 6 : g_u_s >> 6;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1337  		buf[1][offset] = odd ? g_u_s << 2 : b_v << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1338  		buf[1][offset + 1] = odd ? g_u_s >> 6 : b_v >> 6;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1339  		buf[0][offset] |= (buf[0][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1340  		buf[1][offset] |= (buf[1][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1341  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1342  	case V4L2_PIX_FMT_SRGGB10:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1343  		buf[0][offset] = odd ? g_u_s << 2 : r_y_h << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1344  		buf[0][offset + 1] = odd ? g_u_s >> 6 : r_y_h >> 6;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1345  		buf[1][offset] = odd ? b_v << 2 : g_u_s << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1346  		buf[1][offset + 1] = odd ? b_v >> 6 : g_u_s >> 6;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1347  		buf[0][offset] |= (buf[0][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1348  		buf[1][offset] |= (buf[1][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1349  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1350  	case V4L2_PIX_FMT_SBGGR12:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1351  		buf[0][offset] = odd ? g_u_s << 4 : b_v << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1352  		buf[0][offset + 1] = odd ? g_u_s >> 4 : b_v >> 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1353  		buf[1][offset] = odd ? r_y_h << 4 : g_u_s << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1354  		buf[1][offset + 1] = odd ? r_y_h >> 4 : g_u_s >> 4;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1355  		buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1356  		buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1357  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1358  	case V4L2_PIX_FMT_SGBRG12:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1359  		buf[0][offset] = odd ? b_v << 4 : g_u_s << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1360  		buf[0][offset + 1] = odd ? b_v >> 4 : g_u_s >> 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1361  		buf[1][offset] = odd ? g_u_s << 4 : r_y_h << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1362  		buf[1][offset + 1] = odd ? g_u_s >> 4 : r_y_h >> 4;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1363  		buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1364  		buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1365  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1366  	case V4L2_PIX_FMT_SGRBG12:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1367  		buf[0][offset] = odd ? r_y_h << 4 : g_u_s << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1368  		buf[0][offset + 1] = odd ? r_y_h >> 4 : g_u_s >> 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1369  		buf[1][offset] = odd ? g_u_s << 4 : b_v << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1370  		buf[1][offset + 1] = odd ? g_u_s >> 4 : b_v >> 4;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1371  		buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1372  		buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1373  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1374  	case V4L2_PIX_FMT_SRGGB12:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1375  		buf[0][offset] = odd ? g_u_s << 4 : r_y_h << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1376  		buf[0][offset + 1] = odd ? g_u_s >> 4 : r_y_h >> 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1377  		buf[1][offset] = odd ? b_v << 4 : g_u_s << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1378  		buf[1][offset + 1] = odd ? b_v >> 4 : g_u_s >> 4;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1379  		buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1380  		buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1381  		break;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1382  	case V4L2_PIX_FMT_SBGGR16:
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1383  		buf[0][offset] = buf[0][offset + 1] = odd ? g_u_s : b_v;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1384  		buf[1][offset] = buf[1][offset + 1] = odd ? r_y_h : g_u_s;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1385  		break;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1386  	case V4L2_PIX_FMT_SGBRG16:
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1387  		buf[0][offset] = buf[0][offset + 1] = odd ? b_v : g_u_s;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1388  		buf[1][offset] = buf[1][offset + 1] = odd ? g_u_s : r_y_h;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1389  		break;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1390  	case V4L2_PIX_FMT_SGRBG16:
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1391  		buf[0][offset] = buf[0][offset + 1] = odd ? r_y_h : g_u_s;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1392  		buf[1][offset] = buf[1][offset + 1] = odd ? g_u_s : b_v;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1393  		break;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1394  	case V4L2_PIX_FMT_SRGGB16:
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1395  		buf[0][offset] = buf[0][offset + 1] = odd ? g_u_s : r_y_h;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1396  		buf[1][offset] = buf[1][offset + 1] = odd ? b_v : g_u_s;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1397  		break;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1398  	}
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1399  }
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1400  

:::::: The code at line 1281 was first introduced by commit
:::::: 628821c84e9047bffab8357668a6b1ef6c0038a5 [media] vivid: add support for packed YUV formats

:::::: TO: Hans Verkuil <hans.verkuil@cisco.com>
:::::: CC: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 49787 bytes --]

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

* [PATCH v2 2/4] media: v4l2-tpg-core: Add support for 32-bit packed YUV formats (v2)
  2019-02-08 10:49   ` kbuild test robot
@ 2019-02-09  1:29     ` Vivek Kasireddy
  0 siblings, 0 replies; 14+ messages in thread
From: Vivek Kasireddy @ 2019-02-09  1:29 UTC (permalink / raw)
  To: linux-media; +Cc: Vivek Kasireddy, Hans Verkuil

Add support for the following formats to tpg:
 V4L2_PIX_FMT_AYUV32
 V4L2_PIX_FMT_XYUV32
 V4L2_PIX_FMT_VUYA32
 V4L2_PIX_FMT_VUYX32

Changes from v1:
Remove the duplicate case value

Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
index d9a590ae7545..07e0629af8ed 100644
--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
+++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
@@ -246,6 +246,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
 	case V4L2_PIX_FMT_YUV555:
 	case V4L2_PIX_FMT_YUV565:
 	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_AYUV32:
+	case V4L2_PIX_FMT_XYUV32:
+	case V4L2_PIX_FMT_VUYA32:
+	case V4L2_PIX_FMT_VUYX32:
 		tpg->color_enc = TGP_COLOR_ENC_YCBCR;
 		break;
 	case V4L2_PIX_FMT_YUV420M:
@@ -372,6 +376,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
 	case V4L2_PIX_FMT_ARGB32:
 	case V4L2_PIX_FMT_ABGR32:
 	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_AYUV32:
+	case V4L2_PIX_FMT_XYUV32:
+	case V4L2_PIX_FMT_VUYA32:
+	case V4L2_PIX_FMT_VUYX32:
 	case V4L2_PIX_FMT_HSV32:
 		tpg->twopixelsize[0] = 2 * 4;
 		break;
@@ -1267,10 +1275,12 @@ static void gen_twopix(struct tpg_data *tpg,
 	case V4L2_PIX_FMT_RGB32:
 	case V4L2_PIX_FMT_XRGB32:
 	case V4L2_PIX_FMT_HSV32:
+	case V4L2_PIX_FMT_XYUV32:
 		alpha = 0;
 		/* fall through */
 	case V4L2_PIX_FMT_YUV32:
 	case V4L2_PIX_FMT_ARGB32:
+	case V4L2_PIX_FMT_AYUV32:
 		buf[0][offset] = alpha;
 		buf[0][offset + 1] = r_y_h;
 		buf[0][offset + 2] = g_u_s;
@@ -1278,9 +1288,11 @@ static void gen_twopix(struct tpg_data *tpg,
 		break;
 	case V4L2_PIX_FMT_BGR32:
 	case V4L2_PIX_FMT_XBGR32:
+	case V4L2_PIX_FMT_VUYX32:
 		alpha = 0;
 		/* fall through */
 	case V4L2_PIX_FMT_ABGR32:
+	case V4L2_PIX_FMT_VUYA32:
 		buf[0][offset] = b_v;
 		buf[0][offset + 1] = g_u_s;
 		buf[0][offset + 2] = r_y_h;
-- 
2.14.5


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

* [PATCH v2 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 (v2)
  2019-02-08 10:31   ` Philipp Zabel
@ 2019-02-09  1:38     ` Vivek Kasireddy
  2019-02-11 10:29       ` Philipp Zabel
  0 siblings, 1 reply; 14+ messages in thread
From: Vivek Kasireddy @ 2019-02-09  1:38 UTC (permalink / raw)
  To: linux-media; +Cc: Vivek Kasireddy, Philipp Zabel

Buffers generated with YUV32 format seems to be incorrect, hence use
VUYA32 instead.

Changes from v1:
Add both formats VUYA32 and VUYX32 but associate only VUYX32 to the
output queue as the alpha channel of buffers is ignored on this queue.

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 drivers/media/platform/imx-pxp.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c
index f087dc4fc729..0bcfc5aa8f3d 100644
--- a/drivers/media/platform/imx-pxp.c
+++ b/drivers/media/platform/imx-pxp.c
@@ -90,7 +90,11 @@ static struct pxp_fmt formats[] = {
 		.depth	= 16,
 		.types	= MEM2MEM_CAPTURE | MEM2MEM_OUTPUT,
 	}, {
-		.fourcc = V4L2_PIX_FMT_YUV32,
+		.fourcc = V4L2_PIX_FMT_VUYA32,
+		.depth	= 32,
+		.types	= MEM2MEM_CAPTURE,
+	}, {
+		.fourcc = V4L2_PIX_FMT_VUYX32,
 		.depth	= 32,
 		.types	= MEM2MEM_CAPTURE | MEM2MEM_OUTPUT,
 	}, {
@@ -236,7 +240,7 @@ static u32 pxp_v4l2_pix_fmt_to_ps_format(u32 v4l2_pix_fmt)
 	case V4L2_PIX_FMT_RGB555:  return BV_PXP_PS_CTRL_FORMAT__RGB555;
 	case V4L2_PIX_FMT_RGB444:  return BV_PXP_PS_CTRL_FORMAT__RGB444;
 	case V4L2_PIX_FMT_RGB565:  return BV_PXP_PS_CTRL_FORMAT__RGB565;
-	case V4L2_PIX_FMT_YUV32:   return BV_PXP_PS_CTRL_FORMAT__YUV1P444;
+	case V4L2_PIX_FMT_VUYX32:  return BV_PXP_PS_CTRL_FORMAT__YUV1P444;
 	case V4L2_PIX_FMT_UYVY:    return BV_PXP_PS_CTRL_FORMAT__UYVY1P422;
 	case V4L2_PIX_FMT_YUYV:    return BM_PXP_PS_CTRL_WB_SWAP |
 					  BV_PXP_PS_CTRL_FORMAT__UYVY1P422;
@@ -265,7 +269,8 @@ static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
 	case V4L2_PIX_FMT_RGB555:   return BV_PXP_OUT_CTRL_FORMAT__RGB555;
 	case V4L2_PIX_FMT_RGB444:   return BV_PXP_OUT_CTRL_FORMAT__RGB444;
 	case V4L2_PIX_FMT_RGB565:   return BV_PXP_OUT_CTRL_FORMAT__RGB565;
-	case V4L2_PIX_FMT_YUV32:    return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;
+	case V4L2_PIX_FMT_VUYA32:
+	case V4L2_PIX_FMT_VUYX32:   return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;
 	case V4L2_PIX_FMT_UYVY:     return BV_PXP_OUT_CTRL_FORMAT__UYVY1P422;
 	case V4L2_PIX_FMT_VYUY:     return BV_PXP_OUT_CTRL_FORMAT__VYUY1P422;
 	case V4L2_PIX_FMT_GREY:     return BV_PXP_OUT_CTRL_FORMAT__Y8;
@@ -281,7 +286,8 @@ static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
 static bool pxp_v4l2_pix_fmt_is_yuv(u32 v4l2_pix_fmt)
 {
 	switch (v4l2_pix_fmt) {
-	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_VUYA32:
+	case V4L2_PIX_FMT_VUYX32:
 	case V4L2_PIX_FMT_UYVY:
 	case V4L2_PIX_FMT_YUYV:
 	case V4L2_PIX_FMT_VYUY:
-- 
2.14.5


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

* Re: [PATCH v2 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 (v2)
  2019-02-09  1:38     ` [PATCH v2 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 (v2) Vivek Kasireddy
@ 2019-02-11 10:29       ` Philipp Zabel
  0 siblings, 0 replies; 14+ messages in thread
From: Philipp Zabel @ 2019-02-11 10:29 UTC (permalink / raw)
  To: Vivek Kasireddy, linux-media

On Fri, 2019-02-08 at 17:38 -0800, Vivek Kasireddy wrote:
> Buffers generated with YUV32 format seems to be incorrect, hence use
> VUYA32 instead.
> 
> Changes from v1:
> Add both formats VUYA32 and VUYX32 but associate only VUYX32 to the
> output queue as the alpha channel of buffers is ignored on this queue.
>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>

Thank you,
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

> ---
>  drivers/media/platform/imx-pxp.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c
> index f087dc4fc729..0bcfc5aa8f3d 100644
> --- a/drivers/media/platform/imx-pxp.c
> +++ b/drivers/media/platform/imx-pxp.c
> @@ -90,7 +90,11 @@ static struct pxp_fmt formats[] = {
>  		.depth	= 16,
>  		.types	= MEM2MEM_CAPTURE | MEM2MEM_OUTPUT,
>  	}, {
> -		.fourcc = V4L2_PIX_FMT_YUV32,
> +		.fourcc = V4L2_PIX_FMT_VUYA32,
> +		.depth	= 32,
> +		.types	= MEM2MEM_CAPTURE,
> +	}, {
> +		.fourcc = V4L2_PIX_FMT_VUYX32,
>  		.depth	= 32,
>  		.types	= MEM2MEM_CAPTURE | MEM2MEM_OUTPUT,
>  	}, {
> @@ -236,7 +240,7 @@ static u32 pxp_v4l2_pix_fmt_to_ps_format(u32 v4l2_pix_fmt)
>  	case V4L2_PIX_FMT_RGB555:  return BV_PXP_PS_CTRL_FORMAT__RGB555;
>  	case V4L2_PIX_FMT_RGB444:  return BV_PXP_PS_CTRL_FORMAT__RGB444;
>  	case V4L2_PIX_FMT_RGB565:  return BV_PXP_PS_CTRL_FORMAT__RGB565;
> -	case V4L2_PIX_FMT_YUV32:   return BV_PXP_PS_CTRL_FORMAT__YUV1P444;
> +	case V4L2_PIX_FMT_VUYX32:  return BV_PXP_PS_CTRL_FORMAT__YUV1P444;
>  	case V4L2_PIX_FMT_UYVY:    return BV_PXP_PS_CTRL_FORMAT__UYVY1P422;
>  	case V4L2_PIX_FMT_YUYV:    return BM_PXP_PS_CTRL_WB_SWAP |
>  					  BV_PXP_PS_CTRL_FORMAT__UYVY1P422;
> @@ -265,7 +269,8 @@ static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
>  	case V4L2_PIX_FMT_RGB555:   return BV_PXP_OUT_CTRL_FORMAT__RGB555;
>  	case V4L2_PIX_FMT_RGB444:   return BV_PXP_OUT_CTRL_FORMAT__RGB444;
>  	case V4L2_PIX_FMT_RGB565:   return BV_PXP_OUT_CTRL_FORMAT__RGB565;
> -	case V4L2_PIX_FMT_YUV32:    return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;
> +	case V4L2_PIX_FMT_VUYA32:
> +	case V4L2_PIX_FMT_VUYX32:   return BV_PXP_OUT_CTRL_FORMAT__YUV1P444;
>  	case V4L2_PIX_FMT_UYVY:     return BV_PXP_OUT_CTRL_FORMAT__UYVY1P422;
>  	case V4L2_PIX_FMT_VYUY:     return BV_PXP_OUT_CTRL_FORMAT__VYUY1P422;
>  	case V4L2_PIX_FMT_GREY:     return BV_PXP_OUT_CTRL_FORMAT__Y8;
> @@ -281,7 +286,8 @@ static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
>  static bool pxp_v4l2_pix_fmt_is_yuv(u32 v4l2_pix_fmt)
>  {
>  	switch (v4l2_pix_fmt) {
> -	case V4L2_PIX_FMT_YUV32:
> +	case V4L2_PIX_FMT_VUYA32:
> +	case V4L2_PIX_FMT_VUYX32:
>  	case V4L2_PIX_FMT_UYVY:
>  	case V4L2_PIX_FMT_YUYV:
>  	case V4L2_PIX_FMT_VYUY:

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

end of thread, back to index

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-08  3:18 [PATCH 0/4] Add support for 32-bit packed YUV formats Vivek Kasireddy
2019-02-08  3:18 ` [PATCH 1/4] media: v4l: Add " Vivek Kasireddy
2019-02-08  3:18 ` [PATCH 2/4] media: v4l2-tpg-core: Add support for " Vivek Kasireddy
2019-02-08 10:21   ` kbuild test robot
2019-02-08 10:49   ` kbuild test robot
2019-02-09  1:29     ` [PATCH v2 2/4] media: v4l2-tpg-core: Add support for 32-bit packed YUV formats (v2) Vivek Kasireddy
2019-02-08  3:18 ` [PATCH 3/4] media: vivid: Add definitions for the 32-bit packed YUV formats Vivek Kasireddy
2019-02-08  3:18 ` [PATCH 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 Vivek Kasireddy
2019-02-08  9:14   ` Philipp Zabel
2019-02-08  9:15   ` Hans Verkuil
2019-02-08  9:47     ` Philipp Zabel
2019-02-08 10:31   ` Philipp Zabel
2019-02-09  1:38     ` [PATCH v2 4/4] media: imx-pxp: Start using the format VUYA32 instead of YUV32 (v2) Vivek Kasireddy
2019-02-11 10:29       ` Philipp Zabel

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org linux-media@archiver.kernel.org
	public-inbox-index linux-media


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/ public-inbox