diff options
author | Michael Tretter <m.tretter@pengutronix.de> | 2019-06-27 14:44:33 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-07-23 14:46:12 +0200 |
commit | 7708065f5d51a9ae80df29d1257d91fc6a6e50a0 (patch) | |
tree | 060191cd2bf07819f102709bdc589771aec773d4 /drivers/media/pci/cobalt | |
parent | media: vb2: reorder checks in vb2_poll() (diff) | |
download | linux-7708065f5d51a9ae80df29d1257d91fc6a6e50a0.tar.xz linux-7708065f5d51a9ae80df29d1257d91fc6a6e50a0.zip |
media: v4l2-mem2mem: reorder checks in v4l2_m2m_poll()
When reaching the end of stream, V4L2 m2m clients may expect the
V4L2_EOS_EVENT. Although the V4L2_EOS_EVENT is deprecated behavior,
drivers must signal that event before dequeuing the buffer that has the
V4L2_BUF_FLAG_LAST flag set.
If a driver queues the V4L2_EOS_EVENT event and returns the buffer after
the check for events but before the check for buffers, vb2_m2m_poll()
will signal that the buffer with V4L2_BUF_FLAG_LAST can be read but not
that the V4L2_EOS_EVENT is available.
Split the check for buffers into a separate function and check for
available buffers before checking for events. This ensures that if
vb2_m2m_poll() signals POLLIN | POLLRDNORM for the V4L2_BUF_FLAG_LAST
buffer, it signals POLLPRI for the V4L2_EOS_EVENT, too.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: fix checkpatch alignment warning]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/pci/cobalt')
0 files changed, 0 insertions, 0 deletions