From 883334135bb2e84b9ba9daec5a4b844b92ead897 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Wed, 24 Mar 2021 16:21:46 +0000 Subject: libcamera: pipeline: ipu3: Cancel unused buffers When the CIO2 returns a cancelled buffer, we will not queue buffers to the IMGU. These buffers should be explicitly marked as cancelled to ensure the application knows there is no valid metadata or frame data provided in the buffer. Provide a cancel() method on the FrameBuffer to allow explicitly cancelling a buffer. Reviewed-by: Jean-Michel Hautbois Reviewed-by: Hirokazu Honda Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/ipu3/ipu3.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/libcamera/pipeline') diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 51446fcf..73306cea 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1257,8 +1257,11 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer) /* If the buffer is cancelled force a complete of the whole request. */ if (buffer->metadata().status == FrameMetadata::FrameCancelled) { - for (auto it : request->buffers()) - pipe_->completeBuffer(request, it.second); + for (auto it : request->buffers()) { + FrameBuffer *b = it.second; + b->cancel(); + pipe_->completeBuffer(request, b); + } frameInfos_.remove(info); pipe_->completeRequest(request); -- cgit v1.2.1