diff options
author | Michael Tretter <m.tretter@pengutronix.de> | 2019-06-27 08:44:33 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-07-23 08:46:12 -0400 |
commit | 7708065f5d51a9ae80df29d1257d91fc6a6e50a0 (patch) | |
tree | 060191cd2bf07819f102709bdc589771aec773d4 /drivers/media/usb/au0828/au0828-video.c | |
parent | 8d86a15649957c182e90fa2b1267c16699bc12f1 (diff) |
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/usb/au0828/au0828-video.c')
0 files changed, 0 insertions, 0 deletions