[libcamera-devel] [PATCH] libcamera: ipu3: Get request from information structure instead of buffer

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Feb 8 14:43:56 CET 2021


Hi Niklas,

On 05/02/2021 20:43, Niklas Söderlund wrote:
> Buffers dequeued from the ImgU may not be associated with a Request as
> they are internal (statistics, parameters and some RAW buffers). Fetch
> the request they are used for from the frame information instead.
> 
> Fixes: 9708f49fecf2f9ee ("libcamera: ipu3: Share parameter and statistic buffers with IPA")

So far I've done quite a few start/stops with this patch and no failures*

*except for one, very early on which I therefore currently attribute to
probably not testing the updated code.

So at least for now a tentative:

Tested-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

And the change seems to make sense so:

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>



> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index c3763507c40a5d53..48f0a81f0634d424 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -1109,14 +1109,14 @@ void IPU3CameraData::queueFrameAction(unsigned int id,
>   */
>  void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer)
>  {
> -	Request *request = buffer->request();
> +	IPU3Frames::Info *info = frameInfos_.find(buffer);
> +	if (!info)
> +		return;
> +
> +	Request *request = info->request;
>  
>  	pipe_->completeBuffer(request, buffer);
>  
> -	IPU3Frames::Info *info = frameInfos_.find(buffer);
> -	if (!info)
> -		return;
> -
>  	request->metadata().set(controls::draft::PipelineDepth, 3);
>  	/* \todo Move the ExposureTime control to the IPA. */
>  	request->metadata().set(controls::ExposureTime, exposureTime_);
> @@ -1146,7 +1146,7 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)
>  	if (!info)
>  		return;
>  
> -	Request *request = buffer->request();
> +	Request *request = info->request;
>  
>  	/* If the buffer is cancelled force a complete of the whole request. */
>  	if (buffer->metadata().status == FrameMetadata::FrameCancelled) {
> @@ -1175,7 +1175,7 @@ void IPU3CameraData::paramBufferReady(FrameBuffer *buffer)
>  
>  	info->paramDequeued = true;
>  	if (frameInfos_.tryComplete(info))
> -		pipe_->completeRequest(buffer->request());
> +		pipe_->completeRequest(info->request);
>  }
>  
>  void IPU3CameraData::statBufferReady(FrameBuffer *buffer)
> @@ -1187,7 +1187,7 @@ void IPU3CameraData::statBufferReady(FrameBuffer *buffer)
>  	if (buffer->metadata().status == FrameMetadata::FrameCancelled) {
>  		info->metadataProcessed = true;
>  		if (frameInfos_.tryComplete(info))
> -			pipe_->completeRequest(buffer->request());
> +			pipe_->completeRequest(info->request);
>  		return;
>  	}
>  
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list