8dc82bc1488f8f3c0f13fdf9759c1f0aacc753a2
[openwrt/staging/dedeckeh.git] / target / linux / brcm2708 / patches-3.10 / 0147-V4L2-Correct-flag-settings-for-compressed-formats.patch
1 From 3481fef0091c023c634ecf747b3dea455b24b32c 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/196] 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 diff --git a/drivers/media/platform/bcm2835/bcm2835-camera.c b/drivers/media/platform/bcm2835/bcm2835-camera.c
16 index 166039e..7f99a14 100644
17 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
18 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
19 @@ -69,6 +69,7 @@ static struct mmal_fmt formats[] = {
20 {
21 .name = "4:2:0, packed YUV",
22 .fourcc = V4L2_PIX_FMT_YUV420,
23 + .flags = 0,
24 .mmal = MMAL_ENCODING_I420,
25 .depth = 12,
26 .mmal_component = MMAL_COMPONENT_CAMERA,
27 @@ -76,6 +77,7 @@ static struct mmal_fmt formats[] = {
28 {
29 .name = "4:2:2, packed, YUYV",
30 .fourcc = V4L2_PIX_FMT_YUYV,
31 + .flags = 0,
32 .mmal = MMAL_ENCODING_YUYV,
33 .depth = 16,
34 .mmal_component = MMAL_COMPONENT_CAMERA,
35 @@ -83,6 +85,7 @@ static struct mmal_fmt formats[] = {
36 {
37 .name = "RGB24 (BE)",
38 .fourcc = V4L2_PIX_FMT_BGR24,
39 + .flags = 0,
40 .mmal = MMAL_ENCODING_BGR24,
41 .depth = 24,
42 .mmal_component = MMAL_COMPONENT_CAMERA,
43 @@ -90,6 +93,7 @@ static struct mmal_fmt formats[] = {
44 {
45 .name = "JPEG",
46 .fourcc = V4L2_PIX_FMT_JPEG,
47 + .flags = V4L2_FMT_FLAG_COMPRESSED,
48 .mmal = MMAL_ENCODING_JPEG,
49 .depth = 8,
50 .mmal_component = MMAL_COMPONENT_IMAGE_ENCODE,
51 @@ -97,6 +101,7 @@ static struct mmal_fmt formats[] = {
52 {
53 .name = "H264",
54 .fourcc = V4L2_PIX_FMT_H264,
55 + .flags = V4L2_FMT_FLAG_COMPRESSED,
56 .mmal = MMAL_ENCODING_H264,
57 .depth = 8,
58 .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
59 @@ -104,6 +109,7 @@ static struct mmal_fmt formats[] = {
60 {
61 .name = "MJPEG",
62 .fourcc = V4L2_PIX_FMT_MJPEG,
63 + .flags = V4L2_FMT_FLAG_COMPRESSED,
64 .mmal = MMAL_ENCODING_MJPEG,
65 .depth = 8,
66 .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
67 @@ -555,6 +561,7 @@ static int vidioc_enum_fmt_vid_overlay(struct file *file, void *priv,
68
69 strlcpy(f->description, fmt->name, sizeof(f->description));
70 f->pixelformat = fmt->fourcc;
71 + f->flags = fmt->flags;
72
73 return 0;
74 }
75 @@ -750,6 +757,8 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
76
77 strlcpy(f->description, fmt->name, sizeof(f->description));
78 f->pixelformat = fmt->fourcc;
79 + f->flags = fmt->flags;
80 +
81 return 0;
82 }
83
84 diff --git a/drivers/media/platform/bcm2835/mmal-common.h b/drivers/media/platform/bcm2835/mmal-common.h
85 index 602b4a7..076f9a8 100644
86 --- a/drivers/media/platform/bcm2835/mmal-common.h
87 +++ b/drivers/media/platform/bcm2835/mmal-common.h
88 @@ -26,6 +26,7 @@
89 struct mmal_fmt {
90 char *name;
91 u32 fourcc; /* v4l2 format id */
92 + int flags; /* v4l2 flags field */
93 u32 mmal;
94 int depth;
95 u32 mmal_component; /* MMAL component index to be used to encode */
96 --
97 1.9.1
98