From patchwork Thu Jul 21 12:13:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 16719 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 0C2AABD1F1 for ; Thu, 21 Jul 2022 12:13:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 54B8C63325; Thu, 21 Jul 2022 14:13:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1658405603; bh=lr+PMgSDOkvy+qcyZCzh0vL1OSik8zfEOPD0JrMS8CE=; 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=NsAuP3ODMS4lCRXEszFjEfD9+22wQnKrpkgutmuvx+h5UZDemHJOoqYsupuwISPRT LEZZhy63F+G7rOkDJC4p/Om8Ao4Xyxj93JiSqs1nmhWAjOlC6ltSkNoLdkau8ZlRDI RWki075AgraGP3Vkm016t8dcmPbCWPqcX4DEXU6GDnvf4V9NMMvcSGpCNOhg576ubN Y+v4w3GeJ1qM9NLgbYUpnWSWAsZGkOrgLyIbdOFEnvEtSKfvQCAWQJxfJXUSGfMpEJ 7SmnCqgXjoo3ZtxdRYMJa8Xv/hDqKTO0B6nqxoniF9XIO6BzXrYT6tqJipJ98h171A ck7SqSeUaGWug== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7267E63318 for ; Thu, 21 Jul 2022 14:13:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="BbNUUIPT"; dkim-atps=neutral Received: from Monstersaurus.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 210F3496; Thu, 21 Jul 2022 14:13:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1658405595; bh=lr+PMgSDOkvy+qcyZCzh0vL1OSik8zfEOPD0JrMS8CE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BbNUUIPTROxOy75C25IROrRQWoH1IzclzTo7QD2kc52GVdrP8Jmq2q/ywdL5X6vRV XMmpHYsQjHcav4oWLV935vMEXmfcpEle33ocqaIzHIf2a9vrH+4o9qDUe0iFSri5r5 0GQInZE/HdDX9VoTmcTRWKOP2a/18rCozuFE8758= To: libcamera devel Date: Thu, 21 Jul 2022 13:13:05 +0100 Message-Id: <20220721121310.1286862-8-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220721121310.1286862-1-kieran.bingham@ideasonboard.com> References: <20220721121310.1286862-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 07/12] ipa: rkisp1: Convert to use the FCQueue 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: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Establish a queue of FrameContexts using the new FCQueue and use it to supply the FrameContext to the algorithms. The algorithms on the RKISP1 do not use this yet themselves, but are able to do so after the introduction of this patch. Signed-off-by: Kieran Bingham --- src/ipa/rkisp1/ipa_context.h | 2 ++ src/ipa/rkisp1/rkisp1.cpp | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index a64dbc75fdd2..dc4fa5d1ddba 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -72,6 +72,8 @@ struct RKISP1FrameContext : public IPAFrameContext { struct IPAContext { IPASessionConfiguration configuration; IPAActiveState activeState; + + FCQueue frameContexts; }; } /* namespace ipa::rkisp1 */ diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 7481e67e70f6..a2b7b25a53e5 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -205,7 +205,9 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info, << " Gain: " << minGain << "-" << maxGain; /* Clean context at configuration */ - context_ = {}; + context_.configuration = {}; + context_.activeState = {}; + context_.frameContexts.clear(); /* Set the hardware revision for the algorithms. */ context_.configuration.hw.revision = hwRevision_; @@ -290,6 +292,8 @@ void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId) void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId, const ControlList &sensorControls) { + RKISP1FrameContext &frameContext = context_.frameContexts.get(frame); + const rkisp1_stat_buffer *stats = reinterpret_cast( mappedBuffers_.at(bufferId).planes()[0].data()); @@ -301,9 +305,6 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId unsigned int aeState = 0; - /* \todo Obtain the frame context to pass to process from the FCQueue */ - RKISP1FrameContext frameContext; - for (auto const &algo : algorithms()) algo->process(context_, frameContext, stats);