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
6 Set flags field correctly on enum_fmt_vid_cap for compressed
9 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
11 drivers/media/platform/bcm2835/bcm2835-camera.c | 9 +++++++++
12 drivers/media/platform/bcm2835/mmal-common.h | 1 +
13 2 files changed, 10 insertions(+)
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[] = {
21 .name = "4:2:0, packed YUV",
22 .fourcc = V4L2_PIX_FMT_YUV420,
24 .mmal = MMAL_ENCODING_I420,
26 .mmal_component = MMAL_COMPONENT_CAMERA,
27 @@ -76,6 +77,7 @@ static struct mmal_fmt formats[] = {
29 .name = "4:2:2, packed, YUYV",
30 .fourcc = V4L2_PIX_FMT_YUYV,
32 .mmal = MMAL_ENCODING_YUYV,
34 .mmal_component = MMAL_COMPONENT_CAMERA,
35 @@ -83,6 +85,7 @@ static struct mmal_fmt formats[] = {
38 .fourcc = V4L2_PIX_FMT_BGR24,
40 .mmal = MMAL_ENCODING_BGR24,
42 .mmal_component = MMAL_COMPONENT_CAMERA,
43 @@ -90,6 +93,7 @@ static struct mmal_fmt formats[] = {
46 .fourcc = V4L2_PIX_FMT_JPEG,
47 + .flags = V4L2_FMT_FLAG_COMPRESSED,
48 .mmal = MMAL_ENCODING_JPEG,
50 .mmal_component = MMAL_COMPONENT_IMAGE_ENCODE,
51 @@ -97,6 +101,7 @@ static struct mmal_fmt formats[] = {
54 .fourcc = V4L2_PIX_FMT_H264,
55 + .flags = V4L2_FMT_FLAG_COMPRESSED,
56 .mmal = MMAL_ENCODING_H264,
58 .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
59 @@ -104,6 +109,7 @@ static struct mmal_fmt formats[] = {
62 .fourcc = V4L2_PIX_FMT_MJPEG,
63 + .flags = V4L2_FMT_FLAG_COMPRESSED,
64 .mmal = MMAL_ENCODING_MJPEG,
66 .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
67 @@ -555,6 +561,7 @@ static int vidioc_enum_fmt_vid_overlay(struct file *file, void *priv,
69 strlcpy(f->description, fmt->name, sizeof(f->description));
70 f->pixelformat = fmt->fourcc;
71 + f->flags = fmt->flags;
75 @@ -750,6 +757,8 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
77 strlcpy(f->description, fmt->name, sizeof(f->description));
78 f->pixelformat = fmt->fourcc;
79 + f->flags = fmt->flags;
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
91 u32 fourcc; /* v4l2 format id */
92 + int flags; /* v4l2 flags field */
95 u32 mmal_component; /* MMAL component index to be used to encode */