linux_dsm_epyc7002/drivers/media
Michael Tretter 7708065f5d 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>
2019-07-23 08:46:12 -04:00
..
cec media: cec-notifier: add new notifier functions 2019-06-27 07:19:43 -04:00
common media: vb2: reorder checks in vb2_poll() 2019-07-23 08:44:45 -04:00
dvb-core media: dvb_frontend: split dvb_frontend_handle_ioctl function 2019-06-27 07:24:12 -04:00
dvb-frontends media: si2168: add support for Mygica T230C v2 2019-07-22 15:30:28 -04:00
firewire treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
i2c media updates for v5.3-rc1 2019-07-09 09:47:22 -07:00
mc Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
mmc treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pci media: media/pci: don't set description for ENUM_FMT 2019-07-22 14:40:32 -04:00
platform media: tegra-cec: use cec_notifier_cec_adap_(un)register 2019-07-23 08:40:57 -04:00
radio media: radio-raremono: change devm_k*alloc to k*alloc 2019-06-27 07:35:24 -04:00
rc media: mceusb: USB reset device following USB clear halt error 2019-07-22 15:29:53 -04:00
spi Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
tuners media updates for v5.3-rc1 2019-07-09 09:47:22 -07:00
usb media: dvbsky: add support for Mygica T230C v2 2019-07-22 15:33:30 -04:00
v4l2-core media: v4l2-mem2mem: reorder checks in v4l2_m2m_poll() 2019-07-23 08:46:12 -04:00
Kconfig media: move drivers/media/media-* to drivers/media/mc/mc-* 2019-05-28 12:15:46 -04:00
Makefile media: move drivers/media/media-* to drivers/media/mc/mc-* 2019-05-28 12:15:46 -04:00