Commit fca36bab authored by Magnus Damm's avatar Magnus Damm Committed by Mauro Carvalho Chehab

V4L/DVB (9237): Add uyvy pixel format support to vivi

This patch simply adds UYVY pixel format support to the vivi driver.
Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d891f475
...@@ -134,6 +134,11 @@ static struct vivi_fmt formats[] = { ...@@ -134,6 +134,11 @@ static struct vivi_fmt formats[] = {
.fourcc = V4L2_PIX_FMT_YUYV, .fourcc = V4L2_PIX_FMT_YUYV,
.depth = 16, .depth = 16,
}, },
{
.name = "4:2:2, packed, UYVY",
.fourcc = V4L2_PIX_FMT_UYVY,
.depth = 16,
},
}; };
static struct vivi_fmt *get_format(struct v4l2_format *f) static struct vivi_fmt *get_format(struct v4l2_format *f)
...@@ -282,6 +287,20 @@ static void gen_twopix(struct vivi_fh *fh, unsigned char *buf, int colorpos) ...@@ -282,6 +287,20 @@ static void gen_twopix(struct vivi_fh *fh, unsigned char *buf, int colorpos)
break; break;
} }
break; break;
case V4L2_PIX_FMT_UYVY:
switch (color) {
case 1:
case 3:
*p = r_y;
break;
case 0:
*p = g_u;
break;
case 2:
*p = b_v;
break;
}
break;
} }
} }
} }
...@@ -756,6 +775,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, ...@@ -756,6 +775,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
switch (fh->fmt->fourcc) { switch (fh->fmt->fourcc) {
case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_YUYV:
case V4L2_PIX_FMT_UYVY:
is_yuv = 1; is_yuv = 1;
break; 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