brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
[openwrt/staging/chunkeey.git] / target / linux / brcm2708 / patches-3.10 / 0171-V4L2-Add-additional-pixel-formats.-Correct-colourspa.patch
1 From 1f1d93391b9662de72187a5a709bacf2d25f6e86 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dsteve@broadcom.com>
3 Date: Wed, 12 Feb 2014 15:35:41 +0000
4 Subject: [PATCH 171/196] V4L2: Add additional pixel formats. Correct
5 colourspace
6
7 Adds the other flavours of YUYV, and NV12.
8 Corrects the overlay advertised colourspace.
9
10 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
11 ---
12 drivers/media/platform/bcm2835/bcm2835-camera.c | 36 +++++++++++++++++++++++--
13 1 file changed, 34 insertions(+), 2 deletions(-)
14
15 diff --git a/drivers/media/platform/bcm2835/bcm2835-camera.c b/drivers/media/platform/bcm2835/bcm2835-camera.c
16 index 8285e6a..3dea993 100644
17 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
18 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
19 @@ -114,7 +114,39 @@ static struct mmal_fmt formats[] = {
20 .mmal = MMAL_ENCODING_MJPEG,
21 .depth = 8,
22 .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
23 - }
24 + },
25 + {
26 + .name = "4:2:2, packed, YVYU",
27 + .fourcc = V4L2_PIX_FMT_YVYU,
28 + .flags = 0,
29 + .mmal = MMAL_ENCODING_YVYU,
30 + .depth = 16,
31 + .mmal_component = MMAL_COMPONENT_CAMERA,
32 + },
33 + {
34 + .name = "4:2:2, packed, VYUY",
35 + .fourcc = V4L2_PIX_FMT_VYUY,
36 + .flags = 0,
37 + .mmal = MMAL_ENCODING_VYUY,
38 + .depth = 16,
39 + .mmal_component = MMAL_COMPONENT_CAMERA,
40 + },
41 + {
42 + .name = "4:2:2, packed, UYVY",
43 + .fourcc = V4L2_PIX_FMT_UYVY,
44 + .flags = 0,
45 + .mmal = MMAL_ENCODING_UYVY,
46 + .depth = 16,
47 + .mmal_component = MMAL_COMPONENT_CAMERA,
48 + },
49 + {
50 + .name = "4:2:0, packed, NV12",
51 + .fourcc = V4L2_PIX_FMT_NV12,
52 + .flags = 0,
53 + .mmal = MMAL_ENCODING_NV12,
54 + .depth = 12,
55 + .mmal_component = MMAL_COMPONENT_CAMERA,
56 + },
57 };
58
59 static struct mmal_fmt *get_format(struct v4l2_format *f)
60 @@ -691,7 +723,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh,
61 a->fmt.bytesperline = (preview_port->es.video.width * 3)>>1;
62 a->fmt.sizeimage = (preview_port->es.video.width *
63 preview_port->es.video.height * 3)>>1;
64 - a->fmt.colorspace = V4L2_COLORSPACE_SMPTE170M;
65 + a->fmt.colorspace = V4L2_COLORSPACE_JPEG;
66
67 return 0;
68 }
69 --
70 1.9.1
71