3efa7660bf5457cac25bb4a91fa643f1ab2b63b7
[openwrt/staging/chunkeey.git] / target / linux / brcm2708 / patches-3.10 / 0140-V4L2-Fix-JPEG-timestamp-issue.patch
1 From a1eed4a5fcd05d266f68dd30fa17ba045a2a322e 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/196] 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 diff --git a/drivers/media/platform/bcm2835/bcm2835-camera.c b/drivers/media/platform/bcm2835/bcm2835-camera.c
16 index 4766a9c..9fc90a2 100644
17 --- a/drivers/media/platform/bcm2835/bcm2835-camera.c
18 +++ b/drivers/media/platform/bcm2835/bcm2835-camera.c
19 @@ -238,7 +238,8 @@ static void buffer_cb(struct vchiq_mmal_instance *instance,
20 }
21 } else {
22 if (dev->capture.frame_count) {
23 - if (dev->capture.vc_start_timestamp != -1) {
24 + if (dev->capture.vc_start_timestamp != -1 &&
25 + pts != 0) {
26 s64 runtime_us = pts -
27 dev->capture.vc_start_timestamp;
28 u32 div = 0;
29 @@ -259,7 +260,7 @@ static void buffer_cb(struct vchiq_mmal_instance *instance,
30 USEC_PER_SEC;
31 }
32 v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
33 - "Convert start time %d.%06d and %llu"
34 + "Convert start time %d.%06d and %llu "
35 "with offset %llu to %d.%06d\n",
36 (int)dev->capture.kernel_start_ts.
37 tv_sec,
38 --
39 1.9.1
40