5e4ea73c240f47582ab73c20216754031ff95a94
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0137-V4L2-Improve-G_FBUF-handling-so-we-pass-conformance.patch
1 From 6f5cc6eb60f7db36b94b9c960b5330464b4e729f 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/174] V4L2: Improve G_FBUF handling so we pass conformance
5
6 Return some sane numbers for get framebuffer so that
7 we pass conformance.
8
9 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
10 ---
11 drivers/media/platform/bcm2835/bcm2835-camera.c | 14 +++++++++++---
12 1 file changed, 11 insertions(+), 3 deletions(-)
13
14 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
15 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
16 @@ -664,10 +664,18 @@ static int vidioc_g_fbuf(struct file *fi
17 {
18 /* The video overlay must stay within the framebuffer and can't be
19 positioned independently. */
20 + struct bm2835_mmal_dev *dev = video_drvdata(file);
21 + struct vchiq_mmal_port *preview_port =
22 + &dev->component[MMAL_COMPONENT_CAMERA]->
23 + output[MMAL_CAMERA_PORT_PREVIEW];
24 a->flags = V4L2_FBUF_FLAG_OVERLAY;
25 -
26 - /* todo: v4l2_framebuffer still needs more info filling in
27 - * in order to pass the v4l2-compliance test. */
28 + a->fmt.width = preview_port->es.video.width;
29 + a->fmt.height = preview_port->es.video.height;
30 + a->fmt.pixelformat = V4L2_PIX_FMT_YUV420;
31 + a->fmt.bytesperline = (preview_port->es.video.width * 3)>>1;
32 + a->fmt.sizeimage = (preview_port->es.video.width *
33 + preview_port->es.video.height * 3)>>1;
34 + a->fmt.colorspace = V4L2_COLORSPACE_SMPTE170M;
35
36 return 0;
37 }