summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAntonio Ospite <ao2@ao2.it>2016-03-09 17:03:19 +0100
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-08 19:58:46 +0200
commitc21f0cb400fc4aa864138863f97c194f7737c219 (patch)
treedc9583b66060727c9690d73af086199f01e2d6ed /drivers/media
parent[media] gspca: fix a v4l2-compliance failure about VIDIOC_ENUM_FRAMEINTERVALS (diff)
downloadlinux-c21f0cb400fc4aa864138863f97c194f7737c219.tar.xz
linux-c21f0cb400fc4aa864138863f97c194f7737c219.zip
[media] gspca: fix a v4l2-compliance failure about buffer timestamp
v4l2-compliance fails with this message: fail: v4l2-test-buffers.cpp(250): \ timestamp != V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC && \ timestamp != V4L2_BUF_FLAG_TIMESTAMP_COPY ... test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL When setting the frame time, gspca uses v4l2_get_timestamp() which uses ktime_get_ts() which uses ktime_get_ts64() which returns a monotonic timestamp, so it's safe to initialize the buffer flags to V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC to fix the failure. Signed-off-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/gspca/gspca.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c
index 61cb16d6c988..84b0d6a87ec2 100644
--- a/drivers/media/usb/gspca/gspca.c
+++ b/drivers/media/usb/gspca/gspca.c
@@ -522,7 +522,7 @@ static int frame_alloc(struct gspca_dev *gspca_dev, struct file *file,
frame = &gspca_dev->frame[i];
frame->v4l2_buf.index = i;
frame->v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- frame->v4l2_buf.flags = 0;
+ frame->v4l2_buf.flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
frame->v4l2_buf.field = V4L2_FIELD_NONE;
frame->v4l2_buf.length = frsz;
frame->v4l2_buf.memory = memory;