Hi Mauro, This pull request introduces the new VIDIOC_REMOVE_BUFS ioctl, the counterpart of VIDIOC_CREATE_BUFS. This makes it possible to remove buffers, and so make it much easier to support dynamic resolution changes for m2m devices and codecs in particular. This PR contains v21 of the patch series: https://patchwork.linuxtv.org/project/linux-media/list/?series=12431 With an updated patch 3/9: https://patchwork.linuxtv.org/project/linux-media/patch/20240318134856.110687-1-benjamin.gaignard@xxxxxxxxxxxxx/ The patch adding the v4l2-compliance tests for this feature is here: https://patchwork.linuxtv.org/project/linux-media/patch/20240314153415.197534-3-benjamin.gaignard@xxxxxxxxxxxxx/ Besides adding support for this to the media test drivers, this also adds this feature to the verisilicon hantro driver. Many thanks to Benjamin Gaignard for working on this. It's a long desired feature, so it is nice to see this finally land. Regards, Hans The following changes since commit b14257abe7057def6127f6fb2f14f9adc8acabdb: media: rcar-isp: Disallow unbind of devices (2024-03-07 16:35:13 +0100) are available in the Git repository at: git://linuxtv.org/hverkuil/media_tree.git tags/br-rmbufs for you to fetch changes up to 763bcbde2b37d5aba799b7da45f4f2231b302a04: media: verisilicon: Support removing buffers on capture queue (2024-03-18 15:32:51 +0100) ---------------------------------------------------------------- Tag branch ---------------------------------------------------------------- Benjamin Gaignard (9): media: videobuf2: Update vb2_is_busy() logic media: videobuf2: Add min_reqbufs_allocation field to vb2_queue structure media: test-drivers: Set REQBUFS minimum number of buffers media: core: Rework how create_buf index returned value is computed media: core: Add bitmap manage bufs array entries media: core: Free range of buffers media: v4l2: Add REMOVE_BUFS ioctl media: v4l2: Add mem2mem helpers for REMOVE_BUFS ioctl media: verisilicon: Support removing buffers on capture queue Documentation/userspace-api/media/v4l/user-func.rst | 1 + Documentation/userspace-api/media/v4l/vidioc-remove-bufs.rst | 85 ++++++++++++++++++++ Documentation/userspace-api/media/v4l/vidioc-reqbufs.rst | 1 + drivers/media/common/videobuf2/videobuf2-core.c | 223 +++++++++++++++++++++++++++++++++++++---------------- drivers/media/common/videobuf2/videobuf2-v4l2.c | 34 ++++++-- drivers/media/platform/verisilicon/hantro_v4l2.c | 1 + drivers/media/test-drivers/vicodec/vicodec-core.c | 1 + drivers/media/test-drivers/vimc/vimc-capture.c | 3 +- drivers/media/test-drivers/visl/visl-video.c | 1 + drivers/media/test-drivers/vivid/vivid-core.c | 9 ++- drivers/media/test-drivers/vivid/vivid-meta-out.c | 4 - drivers/media/test-drivers/vivid/vivid-touch-cap.c | 4 - drivers/media/v4l2-core/v4l2-dev.c | 3 + drivers/media/v4l2-core/v4l2-ioctl.c | 30 +++++++ drivers/media/v4l2-core/v4l2-mem2mem.c | 15 ++++ include/media/v4l2-ioctl.h | 4 + include/media/v4l2-mem2mem.h | 2 + include/media/videobuf2-core.h | 52 ++++++++++--- include/media/videobuf2-v4l2.h | 2 + include/uapi/linux/videodev2.h | 17 ++++ 20 files changed, 396 insertions(+), 96 deletions(-) create mode 100644 Documentation/userspace-api/media/v4l/vidioc-remove-bufs.rst