]> git.ipfire.org Git - thirdparty/linux.git/commit
media: raspberrypi: cfe: Fix min_reqbufs_allocation
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tue, 29 Oct 2024 12:47:05 +0000 (14:47 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Tue, 17 Jun 2025 08:51:35 +0000 (10:51 +0200)
commit57b5a302b5d529db96ddc52fbccec005092ebb3d
treecc6686092a8e6959675d33acc394ca615e92d593
parent5211354f2cc081c236dc0c21d04d09c1ccb48b88
media: raspberrypi: cfe: Fix min_reqbufs_allocation

The driver checks if "vq->max_num_buffers + *nbuffers < 3", but
vq->max_num_buffers is (by default) 32, so the check is never true. Nor
does the check make sense.

The original code in the BSP kernel was "vq->num_buffers + *nbuffers <
3", but got mangled along the way to upstream. The intention was to make
sure that at least 3 buffers are allocated.

Fix this by removing the bad lines and setting q->min_reqbufs_allocation
to three.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/raspberrypi/rp1-cfe/cfe.c