From 310fe52461e6244b01a04b011c2e886d6b69de16 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 9 Dec 2009 22:57:48 -0300 Subject: V4L/DVB (13827): uvcvideo: Switch to a monotonic clock for V4L2 buffers timestamps The realtime clock provided by do_gettimeofday() is affected by time jumps caused by NTP or DST. Furthermore, preliminary investigation showed that SMP systems the realtime clock is based on the CPU TSC, and those could get slightly out of sync, resulting in jitter in the timestamps depending on which processor handles the USB interrupts. Instead of the realtime clock, use a monotonic high resolution clock to timestamp the buffer. As this could in theory introduce a regression with some userspace applications expecting a realtime clock timestamp, add a module parameter to switch back to the realtime clock. Thanks to Paulo Assis for pointing out and investigating the issue. Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/uvc/uvc_queue.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/media/video/uvc/uvc_queue.c') diff --git a/drivers/media/video/uvc/uvc_queue.c b/drivers/media/video/uvc/uvc_queue.c index ea11839cba4..4a925a31b0e 100644 --- a/drivers/media/video/uvc/uvc_queue.c +++ b/drivers/media/video/uvc/uvc_queue.c @@ -502,7 +502,6 @@ struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue, spin_unlock_irqrestore(&queue->irqlock, flags); buf->buf.sequence = queue->sequence++; - do_gettimeofday(&buf->buf.timestamp); wake_up(&buf->wait); return nextbuf; -- cgit v1.2.3-18-g5258