summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorHans Verkuil2019-02-04 11:11:33 +0100
committerMauro Carvalho Chehab2019-02-18 20:44:20 +0100
commit7e4e71624491d8a8befe62b43138beb0ab696006 (patch)
tree9783e7926080cdfdad2b53d7c582eea07f0d7c56 /drivers/media/v4l2-core
parentmedia: vb2: replace bool by bitfield in vb2_buffer (diff)
downloadkernel-qcow2-linux-7e4e71624491d8a8befe62b43138beb0ab696006.tar.gz
kernel-qcow2-linux-7e4e71624491d8a8befe62b43138beb0ab696006.tar.xz
kernel-qcow2-linux-7e4e71624491d8a8befe62b43138beb0ab696006.zip
media: vb2: keep track of timestamp status
If a stream is stopped, or if a USERPTR/DMABUF buffer is queued backed by a different user address or dmabuf fd, then the timestamp should be skipped by vb2_find_timestamp since the memory it refers to is no longer valid. So keep track of a 'copied_timestamp' state: it is set when the timestamp is copied from an output to a capture buffer, and is cleared when it is no longer valid. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/v4l2-mem2mem.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
index 1494d0d5951a..add228c98a9a 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -992,6 +992,7 @@ void v4l2_m2m_buf_copy_metadata(const struct vb2_v4l2_buffer *out_vb,
cap_vb->field = out_vb->field;
cap_vb->flags &= ~mask;
cap_vb->flags |= out_vb->flags & mask;
+ cap_vb->vb2_buf.copied_timestamp = 1;
}
EXPORT_SYMBOL_GPL(v4l2_m2m_buf_copy_metadata);