[media] media: davinci: vpbe: use v4l2_get_timestamp()
authorLad, Prabhakar <prabhakar.csengg@gmail.com>
Tue, 26 May 2015 14:20:27 +0000 (11:20 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 5 Jun 2015 09:36:23 +0000 (06:36 -0300)
this patch makes use of helper function v4l2_get_timestamp()
to set the timestamp of vb2 buffer.

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/media/platform/davinci/vpbe_display.c

index c4ab46f5bd92d80e8a54b943694766f2ee5c4b1b..f69cdd7da10cf7c029b9965bb5aad5ac4414da52 100644 (file)
@@ -71,15 +71,10 @@ static int venc_is_second_field(struct vpbe_display *disp_dev)
 static void vpbe_isr_even_field(struct vpbe_display *disp_obj,
                                struct vpbe_layer *layer)
 {
-       struct timespec timevalue;
-
        if (layer->cur_frm == layer->next_frm)
                return;
-       ktime_get_ts(&timevalue);
-       layer->cur_frm->vb.v4l2_buf.timestamp.tv_sec =
-               timevalue.tv_sec;
-       layer->cur_frm->vb.v4l2_buf.timestamp.tv_usec =
-               timevalue.tv_nsec / NSEC_PER_USEC;
+
+       v4l2_get_timestamp(&layer->cur_frm->vb.v4l2_buf.timestamp);
        vb2_buffer_done(&layer->cur_frm->vb, VB2_BUF_STATE_DONE);
        /* Make cur_frm pointing to next_frm */
        layer->cur_frm = layer->next_frm;