[libcamera-devel] [PATCH 3/3] libcamera: pipeline: rkisp1: Allow requests to be cancelled

Niklas Söderlund niklas.soderlund at ragnatech.se
Wed Apr 14 16:08:49 CEST 2021


Hi Nícolas,

Thanks for your work.

On 2021-04-06 15:23:35 -0300, Nícolas F. R. A. Prado wrote:
> Previously when a frame got cancelled, the frameInfo flags
> metadataProcessed and paramDequeued wouldn't get set, meaning that the
> request wasn't able to be completed and cancelled.
> 
> Make sure that these flags are set when the frame gets cancelled so that
> the request can be cancelled.
> 
> This issue happened while running lc-compliance.
> 
> Suggested-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado at collabora.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

> ---
>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index 3c8d9dfe6f87..549f4a4e61a8 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -1073,9 +1073,6 @@ void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer)
>  
>  void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer)
>  {
> -	if (buffer->metadata().status == FrameMetadata::FrameCancelled)
> -		return;
> -
>  	ASSERT(activeCamera_);
>  	RkISP1CameraData *data = cameraData(activeCamera_);
>  
> @@ -1087,9 +1084,6 @@ void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer)
>  
>  void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)
>  {
> -	if (buffer->metadata().status == FrameMetadata::FrameCancelled)
> -		return;
> -
>  	ASSERT(activeCamera_);
>  	RkISP1CameraData *data = cameraData(activeCamera_);
>  
> @@ -1097,6 +1091,12 @@ void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)
>  	if (!info)
>  		return;
>  
> +	if (buffer->metadata().status == FrameMetadata::FrameCancelled) {
> +		info->metadataProcessed = true;
> +		tryCompleteRequest(info->request);
> +		return;
> +	}
> +
>  	if (data->frame_ <= buffer->metadata().sequence)
>  		data->frame_ = buffer->metadata().sequence + 1;
>  
> -- 
> 2.31.1
> 

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list