aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasmin Jessich2018-01-14 05:21:43 -0500
committerMauro Carvalho Chehab2018-02-23 02:24:29 -0500
commit43df6ea0c6ae85ae81edda3261d8d257d88a78a2 (patch)
tree4de2fb41749fdab8ebd09d29b4398f5739412252
parentf14d4988c28e5243e43ba792ee34994951240b0f (diff)
media: uvcvideo: Fixed ktime_t to ns conversion
Commit 828ee8c71950 ("media: uvcvideo: Use ktime_t for timestamps") changed to use ktime_t for timestamps. Older Kernels use a struct for ktime_t, which requires the conversion function ktime_to_ns to be used on some places. With this patch it will compile now also for older Kernel versions. Signed-off-by: Jasmin Jessich <jasmin@anw.at> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/usb/uvc/uvc_video.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index 2ddb1367e195..aa0082fe5833 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1009,7 +1009,7 @@ static int uvc_video_decode_start(struct uvc_streaming *stream,
buf->buf.field = V4L2_FIELD_NONE;
buf->buf.sequence = stream->sequence;
- buf->buf.vb2_buf.timestamp = uvc_video_get_time();
+ buf->buf.vb2_buf.timestamp = ktime_to_ns(uvc_video_get_time());
/* TODO: Handle PTS and SCR. */
buf->state = UVC_BUF_STATE_ACTIVE;
@@ -1191,7 +1191,8 @@ static void uvc_video_decode_meta(struct uvc_streaming *stream,
uvc_trace(UVC_TRACE_FRAME,
"%s(): t-sys %lluns, SOF %u, len %u, flags 0x%x, PTS %u, STC %u frame SOF %u\n",
- __func__, time, meta->sof, meta->length, meta->flags,
+ __func__, ktime_to_ns(time), meta->sof, meta->length,
+ meta->flags,
has_pts ? *(u32 *)meta->buf : 0,
has_scr ? *(u32 *)scr : 0,
has_scr ? *(u32 *)(scr + 4) & 0x7ff : 0);