brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
[openwrt/svn-archive/archive.git] / target / linux / brcm2708 / patches-3.10 / 0179-V4L2-Increase-threshold-for-switching-between-video-.patch
1 From 94172081d9bc1f358d799fcef2b6f07615bcca60 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dsteve@broadcom.com>
3 Date: Fri, 14 Mar 2014 17:03:45 +0000
4 Subject: [PATCH 179/196] V4L2: Increase threshold for switching between video
5 & stills
6
7 The threshold used to be hard and fast at 1280x720 and failed if
8 either width or height exceeded those limits. Now it limits it at
9 a pixel count of 1280*720 (ie 921600), so 1024x768 is now considered
10 a video mode.
11
12 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
13 ---
14 drivers/media/platform/bcm2835/bcm2835-camera.c | 7 +++++--
15 1 file changed, 5 insertions(+), 2 deletions(-)
16
17 diff --git a/drivers/media/platform/bcm2835/bcm2835-camera.c b/drivers/media/platform/bcm2835/bcm2835-camera.c
18 index b6880cc..b1eac21 100644
19 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
20 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
21 @@ -42,6 +42,9 @@
22 #define MAX_HEIGHT 1944
23 #define MIN_BUFFER_SIZE (80*1024)
24
25 +/* Max number of pixels supported whilst still being considered
26 + * a video mode by the GPU.
27 + */
28 #define MAX_VIDEO_MODE_WIDTH 1280
29 #define MAX_VIDEO_MODE_HEIGHT 720
30
31 @@ -893,8 +896,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
32 switch (mfmt->mmal_component) {
33 case MMAL_COMPONENT_CAMERA:
34 /* Make a further decision on port based on resolution */
35 - if (f->fmt.pix.width <= MAX_VIDEO_MODE_WIDTH
36 - && f->fmt.pix.height <= MAX_VIDEO_MODE_HEIGHT)
37 + if ((f->fmt.pix.width*f->fmt.pix.height) <=
38 + (MAX_VIDEO_MODE_WIDTH * MAX_VIDEO_MODE_HEIGHT))
39 camera_port = port =
40 &dev->component[MMAL_COMPONENT_CAMERA]->
41 output[MMAL_CAMERA_PORT_VIDEO];
42 --
43 1.9.1
44