Commit bad76dac authored by Sheng Nan's avatar Sheng Nan Committed by Jason Liu

ENGR00235665: mxc_v4l2_capture: add YV12 format support in camera driver

Android CTS verifier have a must requirement for YV12 format. Since IPUv3
common driver has supported IPU_PIX_FMT_YVU420P pixel format, add the
support of YV12 format in mxc_v4l2_capture.
Signed-off-by: 's avatarSheng Nan <b38800@freescale.com>
parent e0f0b6b1
......@@ -104,6 +104,8 @@ static int csi_enc_setup(cam_data *cam)
if (cam->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YUV420)
pixel_fmt = IPU_PIX_FMT_YUV420P;
else if (cam->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YVU420)
pixel_fmt = IPU_PIX_FMT_YVU420P;
else if (cam->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YUV422P)
pixel_fmt = IPU_PIX_FMT_YUV422P;
else if (cam->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_UYVY)
......
......@@ -99,6 +99,9 @@ static int prp_enc_setup(cam_data *cam)
if (cam->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YUV420) {
enc.csi_prp_enc_mem.out_pixel_fmt = IPU_PIX_FMT_YUV420P;
pr_info("YUV420\n");
} else if (cam->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YVU420) {
enc.csi_prp_enc_mem.out_pixel_fmt = IPU_PIX_FMT_YVU420P;
pr_info("YVU420\n");
} else if (cam->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YUV422P) {
enc.csi_prp_enc_mem.out_pixel_fmt = IPU_PIX_FMT_YUV422P;
pr_info("YUV422P\n");
......
......@@ -366,6 +366,7 @@ static inline int valid_mode(u32 palette)
(palette == V4L2_PIX_FMT_UYVY) ||
(palette == V4L2_PIX_FMT_YUYV) ||
(palette == V4L2_PIX_FMT_YUV420) ||
(palette == V4L2_PIX_FMT_YVU420) ||
(palette == V4L2_PIX_FMT_NV12));
}
......@@ -881,6 +882,7 @@ static int mxc_v4l2_s_fmt(cam_data *cam, struct v4l2_format *f)
bytesperline = f->fmt.pix.width * 2;
break;
case V4L2_PIX_FMT_YUV420:
case V4L2_PIX_FMT_YVU420:
size = f->fmt.pix.width * f->fmt.pix.height * 3 / 2;
bytesperline = f->fmt.pix.width;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment