[media] media: davinci_vpfe: use monotonic timestamp
authorLad, Prabhakar <prabhakar.csengg@gmail.com>
Mon, 25 May 2015 15:34:29 +0000 (12:34 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 5 Jun 2015 09:36:03 +0000 (06:36 -0300)
V4L2 drivers should use MONOTONIC timestamps instead of gettimeofday,
which is affected by daylight savings time.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/staging/media/davinci_vpfe/vpfe_video.c

index 674419286a9340324990863c418d8fbb75fb6d94..87048a14c34dea11a5fd79d76961b9bb511bbf8d 100644 (file)
@@ -470,7 +470,7 @@ void vpfe_video_process_buffer_complete(struct vpfe_video_device *video)
 {
        struct vpfe_pipeline *pipe = &video->pipe;
 
-       do_gettimeofday(&video->cur_frm->vb.v4l2_buf.timestamp);
+       v4l2_get_timestamp(&video->cur_frm->vb.v4l2_buf.timestamp);
        vb2_buffer_done(&video->cur_frm->vb, VB2_BUF_STATE_DONE);
        if (pipe->state == VPFE_PIPELINE_STREAM_CONTINUOUS)
                video->cur_frm = video->next_frm;
@@ -1337,6 +1337,7 @@ static int vpfe_reqbufs(struct file *file, void *priv,
        q->ops = &video_qops;
        q->mem_ops = &vb2_dma_contig_memops;
        q->buf_struct_size = sizeof(struct vpfe_cap_buffer);
+       q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
 
        ret = vb2_queue_init(q);
        if (ret) {