summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2019-06-27 08:44:32 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-07-23 08:44:45 -0400
commit8d86a15649957c182e90fa2b1267c16699bc12f1 (patch)
tree9297dbf656fd997caf5251b57326bdb3ba2e4eb4 /drivers/media/v4l2-core
parent43266ad2b47db87b91f3198afa5ad61a4206c253 (diff)
downloadblackbird-op-linux-8d86a15649957c182e90fa2b1267c16699bc12f1.tar.gz
blackbird-op-linux-8d86a15649957c182e90fa2b1267c16699bc12f1.zip
media: vb2: reorder checks in vb2_poll()
When reaching the end of stream, V4L2 clients may expect the V4L2_EOS_EVENT before being able to dequeue the last buffer, which has the V4L2_BUF_FLAG_LAST flag set. If the vb2_poll() function first checks for events and afterwards if buffers are available, a driver can queue the V4L2_EOS_EVENT event and return the buffer after the check for events but before the check for buffers. This causes vb2_poll() to signal that the buffer with V4L2_BUF_FLAG_LAST can be read without the V4L2_EOS_EVENT being available. First, check for available buffers and afterwards for events to ensure that if vb2_poll() signals POLLIN | POLLRDNORM for the V4L2_BUF_FLAG_LAST buffer, it also signals POLLPRI for the V4L2_EOS_EVENT. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/v4l2-core')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud