brcm2708: update against latest rpi-3.10.y branch
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0147-V4L2-Correct-flag-settings-for-compressed-formats.patch
1 From dfd619eb2e3415681d726f749984ab5ecf355736 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dsteve@broadcom.com>
3 Date: Thu, 2 Jan 2014 15:57:06 +0000
4 Subject: [PATCH 147/174] V4L2: Correct flag settings for compressed formats
5
6 Set flags field correctly on enum_fmt_vid_cap for compressed
7 image formats.
8
9 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
10 ---
11  drivers/media/platform/bcm2835/bcm2835-camera.c | 9 +++++++++
12  drivers/media/platform/bcm2835/mmal-common.h    | 1 +
13  2 files changed, 10 insertions(+)
14
15 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
16 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
17 @@ -69,6 +69,7 @@ static struct mmal_fmt formats[] = {
18         {
19          .name = "4:2:0, packed YUV",
20          .fourcc = V4L2_PIX_FMT_YUV420,
21 +        .flags = 0,
22          .mmal = MMAL_ENCODING_I420,
23          .depth = 12,
24          .mmal_component = MMAL_COMPONENT_CAMERA,
25 @@ -76,6 +77,7 @@ static struct mmal_fmt formats[] = {
26         {
27          .name = "4:2:2, packed, YUYV",
28          .fourcc = V4L2_PIX_FMT_YUYV,
29 +        .flags = 0,
30          .mmal = MMAL_ENCODING_YUYV,
31          .depth = 16,
32          .mmal_component = MMAL_COMPONENT_CAMERA,
33 @@ -83,6 +85,7 @@ static struct mmal_fmt formats[] = {
34         {
35          .name = "RGB24 (BE)",
36          .fourcc = V4L2_PIX_FMT_BGR24,
37 +        .flags = 0,
38          .mmal = MMAL_ENCODING_BGR24,
39          .depth = 24,
40          .mmal_component = MMAL_COMPONENT_CAMERA,
41 @@ -90,6 +93,7 @@ static struct mmal_fmt formats[] = {
42         {
43          .name = "JPEG",
44          .fourcc = V4L2_PIX_FMT_JPEG,
45 +        .flags = V4L2_FMT_FLAG_COMPRESSED,
46          .mmal = MMAL_ENCODING_JPEG,
47          .depth = 8,
48          .mmal_component = MMAL_COMPONENT_IMAGE_ENCODE,
49 @@ -97,6 +101,7 @@ static struct mmal_fmt formats[] = {
50         {
51          .name = "H264",
52          .fourcc = V4L2_PIX_FMT_H264,
53 +        .flags = V4L2_FMT_FLAG_COMPRESSED,
54          .mmal = MMAL_ENCODING_H264,
55          .depth = 8,
56          .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
57 @@ -104,6 +109,7 @@ static struct mmal_fmt formats[] = {
58         {
59          .name = "MJPEG",
60          .fourcc = V4L2_PIX_FMT_MJPEG,
61 +        .flags = V4L2_FMT_FLAG_COMPRESSED,
62          .mmal = MMAL_ENCODING_MJPEG,
63          .depth = 8,
64          .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
65 @@ -555,6 +561,7 @@ static int vidioc_enum_fmt_vid_overlay(s
66  
67         strlcpy(f->description, fmt->name, sizeof(f->description));
68         f->pixelformat = fmt->fourcc;
69 +       f->flags = fmt->flags;
70  
71         return 0;
72  }
73 @@ -750,6 +757,8 @@ static int vidioc_enum_fmt_vid_cap(struc
74  
75         strlcpy(f->description, fmt->name, sizeof(f->description));
76         f->pixelformat = fmt->fourcc;
77 +       f->flags = fmt->flags;
78 +
79         return 0;
80  }
81  
82 --- a/drivers/media/platform/bcm2835/mmal-common.h
83 +++ b/drivers/media/platform/bcm2835/mmal-common.h
84 @@ -26,6 +26,7 @@
85  struct mmal_fmt {
86         char  *name;
87         u32   fourcc;          /* v4l2 format id */
88 +       int   flags;           /* v4l2 flags field */
89         u32   mmal;
90         int   depth;
91         u32   mmal_component;  /* MMAL component index to be used to encode */