brcm2708: update against latest rpi-3.10.y branch
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0171-V4L2-Add-additional-pixel-formats.-Correct-colourspa.patch
1 From 0be62650adff2cfac1aab39fc72a41b08df59885 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/174] 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 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
16 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
17 @@ -114,7 +114,39 @@ static struct mmal_fmt formats[] = {
18          .mmal = MMAL_ENCODING_MJPEG,
19          .depth = 8,
20          .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
21 -        }
22 +        },
23 +       {
24 +        .name = "4:2:2, packed, YVYU",
25 +        .fourcc = V4L2_PIX_FMT_YVYU,
26 +        .flags = 0,
27 +        .mmal = MMAL_ENCODING_YVYU,
28 +        .depth = 16,
29 +        .mmal_component = MMAL_COMPONENT_CAMERA,
30 +        },
31 +       {
32 +        .name = "4:2:2, packed, VYUY",
33 +        .fourcc = V4L2_PIX_FMT_VYUY,
34 +        .flags = 0,
35 +        .mmal = MMAL_ENCODING_VYUY,
36 +        .depth = 16,
37 +        .mmal_component = MMAL_COMPONENT_CAMERA,
38 +        },
39 +       {
40 +        .name = "4:2:2, packed, UYVY",
41 +        .fourcc = V4L2_PIX_FMT_UYVY,
42 +        .flags = 0,
43 +        .mmal = MMAL_ENCODING_UYVY,
44 +        .depth = 16,
45 +        .mmal_component = MMAL_COMPONENT_CAMERA,
46 +        },
47 +       {
48 +        .name = "4:2:0, packed, NV12",
49 +        .fourcc = V4L2_PIX_FMT_NV12,
50 +        .flags = 0,
51 +        .mmal = MMAL_ENCODING_NV12,
52 +        .depth = 12,
53 +        .mmal_component = MMAL_COMPONENT_CAMERA,
54 +        },
55  };
56  
57  static struct mmal_fmt *get_format(struct v4l2_format *f)
58 @@ -691,7 +723,7 @@ static int vidioc_g_fbuf(struct file *fi
59         a->fmt.bytesperline = (preview_port->es.video.width * 3)>>1;
60         a->fmt.sizeimage = (preview_port->es.video.width *
61                                preview_port->es.video.height * 3)>>1;
62 -       a->fmt.colorspace = V4L2_COLORSPACE_SMPTE170M;
63 +       a->fmt.colorspace = V4L2_COLORSPACE_JPEG;
64  
65         return 0;
66  }