1 From cd3d0404cf78e7ae0d4f3320c9d900ad88dbd5ed Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dsteve@broadcom.com>
3 Date: Mon, 9 Dec 2013 17:30:09 +0000
4 Subject: [PATCH 137/196] V4L2: Improve G_FBUF handling so we pass conformance
6 Return some sane numbers for get framebuffer so that
9 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
11 drivers/media/platform/bcm2835/bcm2835-camera.c | 14 +++++++++++---
12 1 file changed, 11 insertions(+), 3 deletions(-)
14 diff --git a/drivers/media/platform/bcm2835/bcm2835-camera.c b/drivers/media/platform/bcm2835/bcm2835-camera.c
15 index 8c38d03..c8d8742 100644
16 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
17 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
18 @@ -664,10 +664,18 @@ static int vidioc_g_fbuf(struct file *file, void *fh,
20 /* The video overlay must stay within the framebuffer and can't be
21 positioned independently. */
22 + struct bm2835_mmal_dev *dev = video_drvdata(file);
23 + struct vchiq_mmal_port *preview_port =
24 + &dev->component[MMAL_COMPONENT_CAMERA]->
25 + output[MMAL_CAMERA_PORT_PREVIEW];
26 a->flags = V4L2_FBUF_FLAG_OVERLAY;
28 - /* todo: v4l2_framebuffer still needs more info filling in
29 - * in order to pass the v4l2-compliance test. */
30 + a->fmt.width = preview_port->es.video.width;
31 + a->fmt.height = preview_port->es.video.height;
32 + a->fmt.pixelformat = V4L2_PIX_FMT_YUV420;
33 + a->fmt.bytesperline = (preview_port->es.video.width * 3)>>1;
34 + a->fmt.sizeimage = (preview_port->es.video.width *
35 + preview_port->es.video.height * 3)>>1;
36 + a->fmt.colorspace = V4L2_COLORSPACE_SMPTE170M;