aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-04-10 07:07:07 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-14 19:03:24 -0400
commit0dcb953a6eeae84566fe288d507aed49ead4cc6e (patch)
treedf954a910dd4a68393770468e791f39cedad80c4
parent228b791bfd52f437fd9a04fe9432dfec9c0d0333 (diff)
[media] dt3155v4l: fix timestamp handling
Use the monotonic clock and set the timestamp_type that vb2 expects. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/staging/media/dt3155v4l/dt3155v4l.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c b/drivers/staging/media/dt3155v4l/dt3155v4l.c
index 57fadead0643..c32e0acde4f4 100644
--- a/drivers/staging/media/dt3155v4l/dt3155v4l.c
+++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c
@@ -26,6 +26,7 @@
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <media/v4l2-dev.h> 27#include <media/v4l2-dev.h>
28#include <media/v4l2-ioctl.h> 28#include <media/v4l2-ioctl.h>
29#include <media/v4l2-common.h>
29#include <media/videobuf2-dma-contig.h> 30#include <media/videobuf2-dma-contig.h>
30 31
31#include "dt3155v4l.h" 32#include "dt3155v4l.h"
@@ -341,7 +342,7 @@ dt3155_irq_handler_even(int irq, void *dev_id)
341 342
342 spin_lock(&ipd->lock); 343 spin_lock(&ipd->lock);
343 if (ipd->curr_buf) { 344 if (ipd->curr_buf) {
344 do_gettimeofday(&ipd->curr_buf->v4l2_buf.timestamp); 345 v4l2_get_timestamp(&ipd->curr_buf->v4l2_buf.timestamp);
345 ipd->curr_buf->v4l2_buf.sequence = (ipd->field_count) >> 1; 346 ipd->curr_buf->v4l2_buf.sequence = (ipd->field_count) >> 1;
346 vb2_buffer_done(ipd->curr_buf, VB2_BUF_STATE_DONE); 347 vb2_buffer_done(ipd->curr_buf, VB2_BUF_STATE_DONE);
347 } 348 }
@@ -390,6 +391,7 @@ dt3155_open(struct file *filp)
390 goto err_alloc_queue; 391 goto err_alloc_queue;
391 } 392 }
392 pd->q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 393 pd->q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
394 pd->q->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
393 pd->q->io_modes = VB2_READ | VB2_MMAP; 395 pd->q->io_modes = VB2_READ | VB2_MMAP;
394 pd->q->ops = &q_ops; 396 pd->q->ops = &q_ops;
395 pd->q->mem_ops = &vb2_dma_contig_memops; 397 pd->q->mem_ops = &vb2_dma_contig_memops;