Skip to contentSkip to conversation

davinci: vpif_capture: fix default pixel format for BT.656/BT.1120 video

PATCH In review Sekhar Nori 4 participants 5 messages May 26, 2017 – May 30, 2017 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 davinci: vpif_capture: fix default pixel format for BT.656/BT.1120 video

For both BT.656 and BT.1120 video, the pixel format used by VPIF is Y/CbCr 4:2:2 in semi-planar format (Luma in one plane and Chroma in another). This corresponds to NV16 pixel format.

This is documented in section 36.2.3 of OMAP-L138 Technical Reference Manual, SPRUH77A.

The VPIF driver incorrectly sets the default format to V4L2_PIX_FMT_YUV422P. Fix it.

---
 drivers/media/platform/davinci/vpif_capture.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/media/platform/davinci/vpif_capture.c +5 -5
index 44f702752d3a..128e92d1dd5a 100644
@@ -513,7 +513,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
 	if (ch->vpifparams.iface.if_type == VPIF_IF_RAW_BAYER)
 		common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8;
 	else
-		common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV422P;
+		common->fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_NV16;
 
 	common->fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 
@@ -917,8 +917,8 @@ static int vpif_enum_fmt_vid_cap(struct file *file, void  *priv,
 		fmt->pixelformat = V4L2_PIX_FMT_SBGGR8;
 	} else {
 		fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-		strcpy(fmt->description, "YCbCr4:2:2 YC Planar");
-		fmt->pixelformat = V4L2_PIX_FMT_YUV422P;
+		strcpy(fmt->description, "YCbCr4:2:2 Semi-Planar");
+		fmt->pixelformat = V4L2_PIX_FMT_NV16;
 	}
 	return 0;
 }
@@ -946,8 +946,8 @@ static int vpif_try_fmt_vid_cap(struct file *file, void *priv,
 		if (pixfmt->pixelformat != V4L2_PIX_FMT_SBGGR8)
 			pixfmt->pixelformat = V4L2_PIX_FMT_SBGGR8;
 	} else {
-		if (pixfmt->pixelformat != V4L2_PIX_FMT_YUV422P)
-			pixfmt->pixelformat = V4L2_PIX_FMT_YUV422P;
+		if (pixfmt->pixelformat != V4L2_PIX_FMT_NV16)
+			pixfmt->pixelformat = V4L2_PIX_FMT_NV16;
 	}
 
 	common->fmt.fmt.pix.pixelformat = pixfmt->pixelformat;
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Sekhar Nori

For both BT.656 and BT.1120 video, the pixel format used by VPIF is Y/CbCr 4:2:2 in semi-planar format (Luma in one plane and Chroma in another). This corresponds to NV16 pixel format.

Quoted 8 lines

This is documented in section 36.2.3 of OMAP-L138 Technical Reference Manual, SPRUH77A.

The VPIF driver incorrectly sets the default format to V4L2_PIX_FMT_YUV422P. Fix it.

Acked-by on v1 1/1
#2 lore raw
In reply to Sekhar Nori

Hi Sekhar,

Thanks for the patch.

Quoted 5 lines · Sekhar Nori

For both BT.656 and BT.1120 video, the pixel format used by VPIF is Y/CbCr 4:2:2 in semi-planar format (Luma in one plane and Chroma in another). This corresponds to NV16 pixel format.

Quoted 8 lines

This is documented in section 36.2.3 of OMAP-L138 Technical Reference Manual, SPRUH77A.

The VPIF driver incorrectly sets the default format to V4L2_PIX_FMT_YUV422P. Fix it.

Can you also post a similar patch for vpif_display as well ?

Cheers,
--Prabhakar Lad

#3 lore raw
Quoted 13 lines · Prabhakar

Hi Sekhar,

Thanks for the patch.

Quoted 8 lines · Sekhar Nori

For both BT.656 and BT.1120 video, the pixel format used by VPIF is Y/CbCr 4:2:2 in semi-planar format (Luma in one plane and Chroma in another). This corresponds to NV16 pixel format.

This is documented in section 36.2.3 of OMAP-L138 Technical Reference Manual, SPRUH77A.

Quoted 7 lines
Quoted 5 lines

The VPIF driver incorrectly sets the default format to V4L2_PIX_FMT_YUV422P. Fix it.

Thanks!

Quoted 2 lines

Can you also post a similar patch for vpif_display as well ?

Sure. The LCDK board I am working on does not have the VPIF display. But I should be able to test that on the EVM.

Thanks,
Sekhar

Acked-by on v1 1/1
#4 lore raw
In reply to Sekhar Nori

Sekhar Nori <[email protected]> wrote on Fri [2017-May-26 16:25:27 +0530]:

Quoted 8 lines

For both BT.656 and BT.1120 video, the pixel format used by VPIF is Y/CbCr 4:2:2 in semi-planar format (Luma in one plane and Chroma in another). This corresponds to NV16 pixel format.

This is documented in section 36.2.3 of OMAP-L138 Technical Reference Manual, SPRUH77A.

Quoted 9 lines

The VPIF driver incorrectly sets the default format to V4L2_PIX_FMT_YUV422P. Fix it.

---
 drivers/media/platform/davinci/vpif_capture.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)