[v11,19/19] libcamera: v4l2_videodevice: Log buffer count on error
diff mbox series

Message ID 20250428090413.38234-20-s.pueschel@pengutronix.de
State Superseded
Headers show
Series
  • lc-compliance: Add test to queue more requests than hardware depth
Related show

Commit Message

Sven Püschel April 28, 2025, 9:02 a.m. UTC
Log the actual and requested buffer count in the v4l2 error,
when not the requested buffer count could was allocated by V4L2.

Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>

---
Changes in v11:
- Added
---
 src/libcamera/v4l2_videodevice.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Barnabás Pőcze May 9, 2025, 10:21 a.m. UTC | #1
Hi

2025. 04. 28. 11:02 keltezéssel, Sven Püschel írta:
> Log the actual and requested buffer count in the v4l2 error,
> when not the requested buffer count could was allocated by V4L2.
> 
> Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>

I think this is useful on its own, independent of the rest of the patch series.

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

> 
> ---
> Changes in v11:
> - Added
> ---
>   src/libcamera/v4l2_videodevice.cpp | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
> index f5b3fa09..d6f8c3cd 100644
> --- a/src/libcamera/v4l2_videodevice.cpp
> +++ b/src/libcamera/v4l2_videodevice.cpp
> @@ -1326,7 +1326,8 @@ int V4L2VideoDevice::requestBuffers(unsigned int count,
>   
>   	if (rb.count < count) {
>   		LOG(V4L2, Error)
> -			<< "Not enough buffers provided by V4L2VideoDevice";
> +			<< "Not enough buffers provided by V4L2VideoDevice. Wanted: "
> +			<< count << ", got: " << rb.count;
>   		requestBuffers(0, memoryType);
>   		return -ENOMEM;
>   	}

Patch
diff mbox series

diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index f5b3fa09..d6f8c3cd 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1326,7 +1326,8 @@  int V4L2VideoDevice::requestBuffers(unsigned int count,
 
 	if (rb.count < count) {
 		LOG(V4L2, Error)
-			<< "Not enough buffers provided by V4L2VideoDevice";
+			<< "Not enough buffers provided by V4L2VideoDevice. Wanted: "
+			<< count << ", got: " << rb.count;
 		requestBuffers(0, memoryType);
 		return -ENOMEM;
 	}