summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-04-19 13:05:47 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-20 12:32:14 +0200
commita9d7bbcc6bb8358a8e2e7f3e8db918baf221c2bf (patch)
tree2e06451d17aa2ae9f29fb50274269c5a7b5825ec
parente58eeb5a7335218498218cde8e96bcf3b7ae4a4a (diff)
media: atomisp: Fix support for time 64 API
The time 64 API patchset changed the ts stamp to u64. Update this driver accordingly. Fixes: 15a40b27beb0 ("media: videobuf: use u64 for the timestamp internally") Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 874165654850..8aa5a3019e45 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -686,14 +686,6 @@ static struct videobuf_buffer *atomisp_css_frame_to_vbuf(
return NULL;
}
-static void get_buf_timestamp(struct timeval *tv)
-{
- struct timespec ts;
- ktime_get_ts(&ts);
- tv->tv_sec = ts.tv_sec;
- tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC;
-}
-
static void atomisp_flush_video_pipe(struct atomisp_sub_device *asd,
struct atomisp_video_pipe *pipe)
{
@@ -707,7 +699,7 @@ static void atomisp_flush_video_pipe(struct atomisp_sub_device *asd,
spin_lock_irqsave(&pipe->irq_lock, irqflags);
if (pipe->capq.bufs[i]->state == VIDEOBUF_ACTIVE ||
pipe->capq.bufs[i]->state == VIDEOBUF_QUEUED) {
- get_buf_timestamp(&pipe->capq.bufs[i]->ts);
+ pipe->capq.bufs[i]->ts = ktime_get_ns();
pipe->capq.bufs[i]->field_count =
atomic_read(&asd->sequence) << 1;
dev_dbg(asd->isp->dev, "release buffers on device %s\n",
@@ -1206,7 +1198,7 @@ void atomisp_buf_done(struct atomisp_sub_device *asd, int error,
break;
}
if (vb) {
- get_buf_timestamp(&vb->ts);
+ vb->ts = ktime_get_ns();
vb->field_count = atomic_read(&asd->sequence) << 1;
/*mark videobuffer done for dequeue*/
spin_lock_irqsave(&pipe->irq_lock, irqflags);