]> git.ipfire.org Git - thirdparty/linux.git/commit
media: videobuf2-core: update vb2_thread if wait_finish/prepare are NULL
authorHans Verkuil <hverkuil@xs4all.nl>
Thu, 17 Oct 2024 15:09:23 +0000 (17:09 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Mon, 28 Oct 2024 08:19:47 +0000 (09:19 +0100)
commit1d8aaa86a32a76021f6c37fff9f7c3a26f48dae7
treea96fed3b3b6b3a5ebbe29cb676f83d9881324654
parentc9ec6f1736363b2b2bb4e266997389740f628441
media: videobuf2-core: update vb2_thread if wait_finish/prepare are NULL

The vb2_thread is used for DVB support. This will queue and dequeue buffers
automatically.

It calls wait_finish/prepare around vb2_core_dqbuf() and vb2_core_qbuf(),
but that assumes all drivers have these ops set. But that will change
due to commit 88785982a19d ("media: vb2: use lock if wait_prepare/finish
are NULL").

So instead just check if the callback is available, and if not, use
q->lock, just as __vb2_wait_for_done_vb() does.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/common/videobuf2/videobuf2-core.c