From: Arnd Bergmann <arnd@arndb.de>
To: linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, y2038@lists.linaro.org,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
linux-api@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
Hans Verkuil <hverkuil@xs4all.nl>, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH v2 4/9] [media] exynos4-is: use monotonic timestamps as advertized
Date: Thu, 17 Sep 2015 23:19:35 +0200 [thread overview]
Message-ID: <1442524780-781677-5-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1442524780-781677-1-git-send-email-arnd@arndb.de>
The exynos4 fimc capture driver claims to use monotonic
timestamps but calls ktime_get_real_ts(). This is both
an incorrect API use, and a bad idea because of the y2038
problem and the fact that the wall clock time is not reliable
for timestamps across suspend or settimeofday().
This changes the driver to use the normal v4l2_get_timestamp()
function like all other drivers.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/media/platform/exynos4-is/fimc-capture.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
index cfebf292e15a..776ea6d78d03 100644
--- a/drivers/media/platform/exynos4-is/fimc-capture.c
+++ b/drivers/media/platform/exynos4-is/fimc-capture.c
@@ -183,8 +183,6 @@ void fimc_capture_irq_handler(struct fimc_dev *fimc, int deq_buf)
struct v4l2_subdev *csis = p->subdevs[IDX_CSIS];
struct fimc_frame *f = &cap->ctx->d_frame;
struct fimc_vid_buffer *v_buf;
- struct timeval *tv;
- struct timespec ts;
if (test_and_clear_bit(ST_CAPT_SHUT, &fimc->state)) {
wake_up(&fimc->irq_queue);
@@ -193,13 +191,9 @@ void fimc_capture_irq_handler(struct fimc_dev *fimc, int deq_buf)
if (!list_empty(&cap->active_buf_q) &&
test_bit(ST_CAPT_RUN, &fimc->state) && deq_buf) {
- ktime_get_real_ts(&ts);
-
v_buf = fimc_active_queue_pop(cap);
- tv = &v_buf->vb.v4l2_buf.timestamp;
- tv->tv_sec = ts.tv_sec;
- tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC;
+ v4l2_get_timestamp(&v_buf->vb.v4l2_buf.timestamp);
v_buf->vb.v4l2_buf.sequence = cap->frame_count++;
vb2_buffer_done(&v_buf->vb, VB2_BUF_STATE_DONE);
--
2.1.0.rc2
next prev parent reply other threads:[~2015-09-17 21:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-17 21:19 [PATCH v2 0/9] [media] y2038 conversion for subsystem Arnd Bergmann
2015-09-17 21:19 ` [PATCH v2 1/9] [media] dvb: use ktime_t for internal timeout Arnd Bergmann
2015-09-17 21:19 ` [PATCH v2 2/9] [media] dvb: remove unused systime() function Arnd Bergmann
2015-09-17 21:19 ` [PATCH v2 3/9] [media] dvb: don't use 'time_t' in event ioctl Arnd Bergmann
2015-09-17 21:19 ` Arnd Bergmann [this message]
2015-09-17 21:19 ` [PATCH v2 5/9] [media] make VIDIOC_DQEVENT work with 64-bit time_t Arnd Bergmann
2015-09-17 21:19 ` [PATCH v2 6/9] [media] use v4l2_get_timestamp where possible Arnd Bergmann
2015-09-17 21:19 ` [PATCH v2 7/9] [media] v4l2: introduce v4l2_timeval Arnd Bergmann
[not found] ` <1442524780-781677-8-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2015-09-18 8:05 ` Hans Verkuil
2015-09-18 9:09 ` Arnd Bergmann
2015-09-18 9:27 ` Hans Verkuil
2015-09-18 9:43 ` Arnd Bergmann
2015-09-18 9:52 ` Hans Verkuil
2015-09-18 10:08 ` Arnd Bergmann
2015-09-18 10:22 ` Hans Verkuil
[not found] ` <1442524780-781677-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2015-09-17 21:19 ` [PATCH v2 8/9] [media] handle 64-bit time_t in v4l2_buffer Arnd Bergmann
2015-09-18 7:18 ` Hans Verkuil
2015-09-18 9:26 ` Arnd Bergmann
2015-09-18 9:49 ` Hans Verkuil
2015-09-18 10:14 ` Arnd Bergmann
2015-09-17 21:19 ` [PATCH v2 9/9] [media] omap3isp: support 64-bit version of omap3isp_stat_data Arnd Bergmann
[not found] ` <1442524780-781677-10-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2015-11-09 20:09 ` Laurent Pinchart
2015-11-09 20:30 ` Arnd Bergmann
2015-11-09 21:04 ` [Y2038] " Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442524780-781677-5-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=hverkuil@xs4all.nl \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=y2038@lists.linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).