From patchwork Sat Mar 18 23:40:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 18414 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 83261C329E for ; Sat, 18 Mar 2023 23:40:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C5D89626FC; Sun, 19 Mar 2023 00:40:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679182838; bh=ou8m4oAvy23Fg+JQdD6YTRdMNnldKcSO4Jo/9JkQvJw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gMZkxFYLIXq7c3mE3mcHI/X7oWDTcQ2BfQyHPKNStGsMvUH8MYn+hvqRYJ/9GDg1K 2G1DWEGJZ3cMJEcgQNh9ax5tUfDei6D2aloVhQw9BAxW71vvXA10jh7ARnzQ8HEY4B xxt3Bj2UGmd33caDJQTqo2qZ1yb9ak1qM+5qtHhQLiYYQ1Au7OGwh/0gjj9Bw6JBP8 f2a0d0BdpTVzq6+YjGsGq08WfG7++RIRct7P5wReCwK9VUWLdhrCZDvnpyv5U5V2s3 lDCASLaAd5Szqy/V5TyQd9xcctKwOKVKkotv+ba4w4cT0v6aaqqrwuPXPxRvWOAsG2 jreZah79KCEgg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 68E69626EC for ; Sun, 19 Mar 2023 00:40:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kRl3g7s8"; dkim-atps=neutral Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 04F28B6C; Sun, 19 Mar 2023 00:40:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679182833; bh=ou8m4oAvy23Fg+JQdD6YTRdMNnldKcSO4Jo/9JkQvJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kRl3g7s8c8cORarYmGPiTIa68Ntd+VtUWgVu3CCDYuQp4Wvr41R/EIUzjXiA4Zogn jWzev7w8sizGTh1KlMWc4+Gh2TOazKROAUgV2mkKsY7U5ncoz2aWu2kD5vzlZDFAsH /xDY3AgF/oQMES/mn8vuzbQtMLK9o385VgrLTGTk= To: libcamera-devel@lists.libcamera.org Date: Sat, 18 Mar 2023 23:40:08 +0000 Message-Id: <20230318234014.29506-6-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230318234014.29506-1-dan.scally@ideasonboard.com> References: <20230318234014.29506-1-dan.scally@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 05/11] pipeline: ipu3: Add needsImgu flag to IPU3Frames 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: , X-Patchwork-Original-From: Daniel Scally via libcamera-devel From: Dan Scally Reply-To: Daniel Scally Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Some sensors using the IPU3 pipeline do not transfer data to the Imgu, so we need the ability to disable the related processing from this class. Add a boolean flag denoting whether or not to run the Imgu related processing. For now, hard code this to true in IPU3CameraData::queuePendingRequests(). Signed-off-by: Daniel Scally --- src/libcamera/pipeline/ipu3/frames.cpp | 45 +++++++++++++++----------- src/libcamera/pipeline/ipu3/frames.h | 3 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/frames.cpp b/src/libcamera/pipeline/ipu3/frames.cpp index a4c3477c..55b90e9d 100644 --- a/src/libcamera/pipeline/ipu3/frames.cpp +++ b/src/libcamera/pipeline/ipu3/frames.cpp @@ -40,28 +40,32 @@ void IPU3Frames::clear() availableStatBuffers_ = {}; } -IPU3Frames::Info *IPU3Frames::create(Request *request) +IPU3Frames::Info *IPU3Frames::create(Request *request, bool needsImgu) { unsigned int id = request->sequence(); + FrameBuffer *paramBuffer = nullptr; + FrameBuffer *statBuffer = nullptr; - if (availableParamBuffers_.empty()) { - LOG(IPU3, Debug) << "Parameters buffer underrun"; - return nullptr; - } + if (needsImgu) { + if (availableParamBuffers_.empty()) { + LOG(IPU3, Debug) << "Parameters buffer underrun"; + return nullptr; + } - if (availableStatBuffers_.empty()) { - LOG(IPU3, Debug) << "Statistics buffer underrun"; - return nullptr; - } + if (availableStatBuffers_.empty()) { + LOG(IPU3, Debug) << "Statistics buffer underrun"; + return nullptr; + } - FrameBuffer *paramBuffer = availableParamBuffers_.front(); - FrameBuffer *statBuffer = availableStatBuffers_.front(); + paramBuffer = availableParamBuffers_.front(); + statBuffer = availableStatBuffers_.front(); - paramBuffer->_d()->setRequest(request); - statBuffer->_d()->setRequest(request); + paramBuffer->_d()->setRequest(request); + statBuffer->_d()->setRequest(request); - availableParamBuffers_.pop(); - availableStatBuffers_.pop(); + availableParamBuffers_.pop(); + availableStatBuffers_.pop(); + } /* \todo Remove the dynamic allocation of Info */ std::unique_ptr info = std::make_unique(); @@ -73,6 +77,7 @@ IPU3Frames::Info *IPU3Frames::create(Request *request) info->statBuffer = statBuffer; info->paramDequeued = false; info->metadataProcessed = false; + info->needsImgu = needsImgu; frameInfo_[id] = std::move(info); @@ -96,11 +101,13 @@ bool IPU3Frames::tryComplete(IPU3Frames::Info *info) if (request->hasPendingBuffers()) return false; - if (!info->metadataProcessed) - return false; + if (info->needsImgu) { + if (!info->metadataProcessed) + return false; - if (!info->paramDequeued) - return false; + if (!info->paramDequeued) + return false; + } remove(info); diff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h index 6e3cb915..d58fd998 100644 --- a/src/libcamera/pipeline/ipu3/frames.h +++ b/src/libcamera/pipeline/ipu3/frames.h @@ -40,6 +40,7 @@ public: bool paramDequeued; bool metadataProcessed; + bool needsImgu; }; IPU3Frames(); @@ -48,7 +49,7 @@ public: const std::vector> &statBuffers); void clear(); - Info *create(Request *request); + Info *create(Request *request, bool needsImgu); void remove(Info *info); bool tryComplete(Info *info); diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index d0d55651..3077c6bb 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -806,7 +806,7 @@ void IPU3CameraData::queuePendingRequests() while (!pendingRequests_.empty()) { Request *request = pendingRequests_.front(); - IPU3Frames::Info *info = frameInfos_.create(request); + IPU3Frames::Info *info = frameInfos_.create(request, true); if (!info) break;