brcm2708: update against latest rpi-3.10.y branch
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0140-V4L2-Fix-JPEG-timestamp-issue.patch
1 From 126bd13f65c8e88fd4eb037433ab39f7faf803ca Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dsteve@broadcom.com>
3 Date: Thu, 19 Dec 2013 17:33:02 +0000
4 Subject: [PATCH 140/174] V4L2: Fix JPEG timestamp issue
5
6 JPEG images were coming through from the GPU with timestamp
7 of 0. Detect this and give current system time instead
8 of some invalid value.
9
10 Signed-off-by: Dave Stevenson <dsteve@broadcom.com>
11 ---
12  drivers/media/platform/bcm2835/bcm2835-camera.c | 5 +++--
13  1 file changed, 3 insertions(+), 2 deletions(-)
14
15 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
16 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
17 @@ -238,7 +238,8 @@ static void buffer_cb(struct vchiq_mmal_
18                 }
19         } else {
20                 if (dev->capture.frame_count) {
21 -                       if (dev->capture.vc_start_timestamp != -1) {
22 +                       if (dev->capture.vc_start_timestamp != -1 &&
23 +                           pts != 0) {
24                                 s64 runtime_us = pts -
25                                     dev->capture.vc_start_timestamp;
26                                 u32 div = 0;
27 @@ -259,7 +260,7 @@ static void buffer_cb(struct vchiq_mmal_
28                                             USEC_PER_SEC;
29                                 }
30                                 v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
31 -                                        "Convert start time %d.%06d and %llu"
32 +                                        "Convert start time %d.%06d and %llu "
33                                          "with offset %llu to %d.%06d\n",
34                                          (int)dev->capture.kernel_start_ts.
35                                          tv_sec,