From 03def6e9479b6a7385dfc68965a3e2782c319b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Fri, 5 Feb 2021 16:27:06 +0100 Subject: libcamera: ipu3: Get request from information structure instead of buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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") Signed-off-by: Niklas Söderlund Tested-by: Kieran Bingham Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/ipu3.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libcamera/pipeline') diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 9bc3df33..61f7bf43 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1121,14 +1121,14 @@ void IPU3CameraData::queueFrameAction(unsigned int id, */ void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer) { - Request *request = buffer->request(); - - pipe_->completeBuffer(request, buffer); - IPU3Frames::Info *info = frameInfos_.find(buffer); if (!info) return; + Request *request = info->request; + + pipe_->completeBuffer(request, buffer); + request->metadata().set(controls::draft::PipelineDepth, 3); /* \todo Move the ExposureTime control to the IPA. */ request->metadata().set(controls::ExposureTime, exposureTime_); @@ -1157,7 +1157,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) { @@ -1186,7 +1186,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) @@ -1198,7 +1198,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; } -- cgit v1.2.1