From patchwork Fri Feb 5 20:43:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 11179 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 17099BD162 for ; Fri, 5 Feb 2021 20:43:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9A5B3614BC; Fri, 5 Feb 2021 21:43:54 +0100 (CET) Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0EE45614B0 for ; Fri, 5 Feb 2021 21:43:52 +0100 (CET) X-Halon-ID: d8990e4f-67f2-11eb-b73f-0050569116f7 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de [79.202.36.88]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id d8990e4f-67f2-11eb-b73f-0050569116f7; Fri, 05 Feb 2021 21:43:51 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Fri, 5 Feb 2021 21:43:03 +0100 Message-Id: <20210205204303.394105-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: ipu3: Get request from information structure instead of buffer X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 | 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; }