[0/4] v4l2: Fix v4l2-compliance errors
mbox series

Message ID 20261027212447.2551591-1-laurent.pinchart@ideasonboard.com
Headers show
Series
  • v4l2: Fix v4l2-compliance errors
Related show

Message

Laurent Pinchart Oct. 27, 2026, 9:24 p.m. UTC
Hello,

This short series fixes v4l2-compliance errors that get triggered by
libcamera returning buffers in the FrameMetadata::FrameError state.

This is an untested code path in CI, hence the previously unnoticed
errors. My UVC webcam marks the first buffer as erroneous, which allowed
me to easily reproduce and fix the problems. It would be useful to add
error injection in the virtual pipeline handler to test this in CI.

Patches 1/4 and 2/4 fix two v4l2-compliance errors. Patch 3/4 and 4/4
fix additional errors I noticed during testing, not caught by
v4l2-compliance.

There are other issues reported by v4l2-compliance that I believe are
bugs in v4l2-compliance. I have sent an RFC patch ([1]) to relax some of
the checks. Based on the feedback, additional changes in v4l2-compat may
still be required, but that shouldn't invalidate the patches in this
series.

[1] https://lore.kernel.org/linux-media/20261027191929.2528156-1-laurent.pinchart@ideasonboard.com/

Laurent Pinchart (4):
  v4l2: v4l2_camera_proxy: Clear PREPARED flag when queuing buffer
  v4l2: v4l2_camera_proxy: Set buffer field unconditionally
  v4l2: v4l2_camera_proxy: Clear ERROR flag when dequeuing or stopping
    streaming
  v4l2: v4l2_camera_proxy: Set DONE flag on error buffers

 src/v4l2/v4l2_camera_proxy.cpp | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)


base-commit: efb7bed9b23568c9ff047b497a8b6e92e72d40e8

Comments

Jacopo Mondi Oct. 28, 2026, 7:37 a.m. UTC | #1
Hi Laurent

On Tue, Oct 27, 2026 at 11:24:43PM +0200, Laurent Pinchart wrote:
> Hello,
>
> This short series fixes v4l2-compliance errors that get triggered by
> libcamera returning buffers in the FrameMetadata::FrameError state.
>
> This is an untested code path in CI, hence the previously unnoticed
> errors. My UVC webcam marks the first buffer as erroneous, which allowed
> me to easily reproduce and fix the problems. It would be useful to add
> error injection in the virtual pipeline handler to test this in CI.
>
> Patches 1/4 and 2/4 fix two v4l2-compliance errors. Patch 3/4 and 4/4
> fix additional errors I noticed during testing, not caught by
> v4l2-compliance.
>
> There are other issues reported by v4l2-compliance that I believe are
> bugs in v4l2-compliance. I have sent an RFC patch ([1]) to relax some of
> the checks. Based on the feedback, additional changes in v4l2-compat may
> still be required, but that shouldn't invalidate the patches in this
> series.
>
> [1] https://lore.kernel.org/linux-media/20261027191929.2528156-1-laurent.pinchart@ideasonboard.com/

The series fixes the v4l2-compat tests for me

$ ./test/v4l2_compat/v4l2_compat_test.py -a .//build/src/v4l2/v4l2-compat.so
Testing /dev/video2 with uvcvideo driver... success
Testing /dev/video0 with uvcvideo driver... success

Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

>
> Laurent Pinchart (4):
>   v4l2: v4l2_camera_proxy: Clear PREPARED flag when queuing buffer
>   v4l2: v4l2_camera_proxy: Set buffer field unconditionally
>   v4l2: v4l2_camera_proxy: Clear ERROR flag when dequeuing or stopping
>     streaming
>   v4l2: v4l2_camera_proxy: Set DONE flag on error buffers
>
>  src/v4l2/v4l2_camera_proxy.cpp | 20 +++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)
>
>
> base-commit: efb7bed9b23568c9ff047b497a8b6e92e72d40e8
> --
> Regards,
>
> Laurent Pinchart
>