]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: videobuf2: Drop minimum allocation requirement of 2 buffers
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 25 Aug 2024 23:24:49 +0000 (02:24 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:04:01 +0000 (12:04 +0200)
commitea0202fe5a3b7074a42f299b66abc0e42dc7a15c
tree2873da782f2fb77118ad66307d238f81bb1b94b1
parenta5336035728d77efd76306940d742a6f23debe68
media: videobuf2: Drop minimum allocation requirement of 2 buffers

commit e5700c9037727d5a69a677d6dba25010b485d65b upstream.

When introducing the ability for drivers to indicate the minimum number
of buffers they require an application to allocate, commit 6662edcd32cc
("media: videobuf2: Add min_reqbufs_allocation field to vb2_queue
structure") also introduced a global minimum of 2 buffers. It turns out
this breaks the Renesas R-Car VSP test suite, where a test that
allocates a single buffer fails when two buffers are used.

One may consider debatable whether test suite failures without failures
in production use cases should be considered as a regression, but
operation with a single buffer is a valid use case. While full frame
rate can't be maintained, memory-to-memory devices can still be used
with a decent efficiency, and requiring applications to allocate
multiple buffers for single-shot use cases with capture devices would
just waste memory.

For those reasons, fix the regression by dropping the global minimum of
buffers. Individual drivers can still set their own minimum.

Fixes: 6662edcd32cc ("media: videobuf2: Add min_reqbufs_allocation field to vb2_queue structure")
Cc: stable@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Link: https://lore.kernel.org/r/20240825232449.25905-1-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/common/videobuf2/videobuf2-core.c