From 33389588226be77d0ccbb6579c5f1a63bb63de81 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 2 Oct 2022 02:29:50 +0300 Subject: pipeline: ipu3: Set bytesused before queuing parameters buffer The bytesused value for the parameters buffer is initialized to 0 and never set. The V4L2 API specification indicates that, for an output video device, the driver will set the bytesused value to the size of the plane in that case. The videobuf2 framework does so, but considers this as deprecated and prints a warning: [ 54.375534] use of bytesused == 0 is deprecated and will be removed in the future, [ 54.388026] use the actual size instead. Fix it by setting bytesused to the correct value before queuing the parameters buffer. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Umang Jain Tested-by: Naushir Patuck --- src/libcamera/pipeline/ipu3/ipu3.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 93219a6c..3b892d96 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -11,6 +11,8 @@ #include #include +#include + #include #include @@ -1298,6 +1300,8 @@ void IPU3CameraData::paramsBufferReady(unsigned int id) imgu_->viewfinder_->queueBuffer(outbuffer); } + info->paramBuffer->_d()->metadata().planes()[0].bytesused = + sizeof(struct ipu3_uapi_params); imgu_->param_->queueBuffer(info->paramBuffer); imgu_->stat_->queueBuffer(info->statBuffer); imgu_->input_->queueBuffer(info->rawBuffer); -- cgit v1.2.1