diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2019-07-31 18:23:26 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2019-08-02 18:51:32 +0200 |
commit | 19226502bf6393706defe7f049c587b32c9b4f33 (patch) | |
tree | 0bff89a72b7006051a6eec1ac3c0c9250490cf4f /target/linux/brcm2708/patches-4.19/950-0253-staging-bcm2835-camera-Ensure-timestamps-never-go-ba.patch | |
parent | 66458c49aa14ebc9ba2e4f9b6a323b8ff122807b (diff) | |
download | upstream-19226502bf6393706defe7f049c587b32c9b4f33.tar.gz upstream-19226502bf6393706defe7f049c587b32c9b4f33.tar.bz2 upstream-19226502bf6393706defe7f049c587b32c9b4f33.zip |
brcm2708: update to latest patches from the RPi foundation
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.19/950-0253-staging-bcm2835-camera-Ensure-timestamps-never-go-ba.patch')
-rw-r--r-- | target/linux/brcm2708/patches-4.19/950-0253-staging-bcm2835-camera-Ensure-timestamps-never-go-ba.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.19/950-0253-staging-bcm2835-camera-Ensure-timestamps-never-go-ba.patch b/target/linux/brcm2708/patches-4.19/950-0253-staging-bcm2835-camera-Ensure-timestamps-never-go-ba.patch new file mode 100644 index 0000000000..188bf23b21 --- /dev/null +++ b/target/linux/brcm2708/patches-4.19/950-0253-staging-bcm2835-camera-Ensure-timestamps-never-go-ba.patch @@ -0,0 +1,38 @@ +From b29685ae7838b052cab7c7e26ff16e249edea294 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson <dave.stevenson@raspberrypi.org> +Date: Tue, 24 Jul 2018 12:08:29 +0100 +Subject: [PATCH 253/725] staging: bcm2835-camera: Ensure timestamps never go + backwards. + +There is an awkward situation with H264 header bytes. Currently +they are returned with a PTS of 0 because they aren't associated +with a timestamped frame to encode. These are handled by either +returning the timestamp of the last buffer to have been received, +or in the case of the first buffer the timestamp taken at +start_streaming. +This results in a race where the current frame may have started +before we take the start time, which results in the first encoded +frame having an earlier timestamp than the header bytes. + +Ensure that we never return a negative delta to the user by checking +against the previous timestamp. + +Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> +--- + .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c ++++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +@@ -393,6 +393,11 @@ static void buffer_cb(struct vchiq_mmal_ + ktime_to_ns(dev->capture.kernel_start_ts), + dev->capture.vc_start_timestamp, pts, + ktime_to_ns(timestamp)); ++ if (timestamp < dev->capture.last_timestamp) { ++ v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, ++ "Negative delta - using last time\n"); ++ timestamp = dev->capture.last_timestamp; ++ } + buf->vb.vb2_buf.timestamp = ktime_to_ns(timestamp); + } else { + if (dev->capture.last_timestamp) { |