[libcamera-devel] [PATCH 3/8] libcamera: pipeline: ipu3: Reset sequence counts to zero on stop

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Mar 14 02:43:18 CET 2021


Hi Kieran,

Thank you for the patch.

On Fri, Mar 12, 2021 at 06:11:26AM +0000, Kieran Bingham wrote:
> Reset the request sequence counter back to zero when a camera has
> stopped, giving each camera run an independent sequence stream.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> 
> ---
> RFC: This again would be perhaps better handled by the base class to
> ensure all pipeline handlers handle this in a consistent manner.

Yes, if we want to do this, I think it should go in the base class. I'm
not sure we should reset the sequence number though, as not doing so may
help identifying requests from a previous capture session that leak to a
new capture session.

>  src/libcamera/pipeline/ipu3/ipu3.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index a61e2b51ef9e..3d3bd4a43c23 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -780,6 +780,8 @@ void PipelineHandlerIPU3::stop(Camera *camera)
>  		LOG(IPU3, Fatal) << "There are still requests to complete.";
>  
>  	freeBuffers(camera);
> +
> +	data->requestSequence_ = 0;
>  }
>  
>  int PipelineHandlerIPU3::queueRequestDevice(Camera *camera, Request *request)

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list