]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
media: v4l2-mem2mem: always consider OUTPUT queue during poll
authorAlexandre Courbot <gnurou@gmail.com>
Thu, 27 Aug 2020 12:49:45 +0000 (14:49 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 24 Sep 2021 10:27:18 +0000 (12:27 +0200)
commite48425d3ada9a11f3fed73dd3927cc8ff50df67d
tree06fb04b57548f3f703bfd41b1e8131ec0c83310c
parent083d65617f7d3178edc0a4fe46610aeb48df2a80
media: v4l2-mem2mem: always consider OUTPUT queue during poll

BugLink: https://bugs.launchpad.net/bugs/1943484
commit 566463afdbc43c7744c5a1b89250fc808df03833 upstream.

If poll() is called on a m2m device with the EPOLLOUT event after the
last buffer of the CAPTURE queue is dequeued, any buffer available on
OUTPUT queue will never be signaled because v4l2_m2m_poll_for_data()
starts by checking whether dst_q->last_buffer_dequeued is set and
returns EPOLLIN in this case, without looking at the state of the OUTPUT
queue.

Fix this by not early returning so we keep checking the state of the
OUTPUT queue afterwards.

Signed-off-by: Alexandre Courbot <gnurou@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Lecopzer Chen <lecopzer.chen@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com>
drivers/media/v4l2-core/v4l2-mem2mem.c