From: Sakari Ailus Date: Sat, 1 Mar 2014 13:28:02 +0000 (-0300) Subject: upstream: [media] v4l: Timestamp flags will soon contain timestamp source, not just... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfa7fae75579f7fe5571da07280c31dca52a66a3;p=platform%2Fkernel%2Flinux-3.10.git upstream: [media] v4l: Timestamp flags will soon contain timestamp source, not just type Mask out other bits when comparing timestamp types. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 82db407..1c26c3d 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -1767,7 +1767,8 @@ static int vb2_internal_qbuf(struct vb2_queue *q, struct v4l2_buffer *b) * For output buffers copy the timestamp if needed, * and the timecode field and flag if needed. */ - if (q->timestamp_flags == V4L2_BUF_FLAG_TIMESTAMP_COPY) + if ((q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) == + V4L2_BUF_FLAG_TIMESTAMP_COPY) vb->v4l2_buf.timestamp = b->timestamp; vb->v4l2_buf.flags |= b->flags & V4L2_BUF_FLAG_TIMECODE; if (b->flags & V4L2_BUF_FLAG_TIMECODE) @@ -2560,7 +2561,8 @@ int vb2_queue_init(struct vb2_queue *q) return -EINVAL; /* Warn that the driver should choose an appropriate timestamp type */ - WARN_ON(q->timestamp_flags == V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN); + WARN_ON((q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) == + V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN); INIT_LIST_HEAD(&q->queued_list); INIT_LIST_HEAD(&q->done_list);