summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/media/common/videobuf2/videobuf2-v4l2.c11
-rw-r--r--include/media/videobuf2-v4l2.h3
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
index 75ea90e795d8..2f3b3ca5bde6 100644
--- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
+++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
@@ -567,7 +567,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, struct vb2_plane *planes)
struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
unsigned int plane;
- if (!vb->vb2_queue->is_output || !vb->vb2_queue->copy_timestamp)
+ if (!vb->vb2_queue->copy_timestamp)
vb->timestamp = 0;
for (plane = 0; plane < vb->num_planes; ++plane) {
@@ -594,14 +594,9 @@ int vb2_find_timestamp(const struct vb2_queue *q, u64 timestamp,
{
unsigned int i;
- for (i = start_idx; i < q->num_buffers; i++) {
- struct vb2_buffer *vb = q->bufs[i];
-
- if ((vb->state == VB2_BUF_STATE_DEQUEUED ||
- vb->state == VB2_BUF_STATE_DONE) &&
- vb->timestamp == timestamp)
+ for (i = start_idx; i < q->num_buffers; i++)
+ if (q->bufs[i]->timestamp == timestamp)
return i;
- }
return -1;
}
EXPORT_SYMBOL_GPL(vb2_find_timestamp);
diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h
index a9961bc776dc..8a10889dc2fd 100644
--- a/include/media/videobuf2-v4l2.h
+++ b/include/media/videobuf2-v4l2.h
@@ -59,8 +59,7 @@ struct vb2_v4l2_buffer {
* vb2_find_timestamp() - Find buffer with given timestamp in the queue
*
* @q: pointer to &struct vb2_queue with videobuf2 queue.
- * @timestamp: the timestamp to find. Only buffers in state DEQUEUED or DONE
- * are considered.
+ * @timestamp: the timestamp to find.
* @start_idx: the start index (usually 0) in the buffer array to start
* searching from. Note that there may be multiple buffers
* with the same timestamp value, so you can restart the search