From patchwork Fri Aug 5 13:53:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16982 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 09F42C3275 for ; Fri, 5 Aug 2022 13:53:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BFDCA63328; Fri, 5 Aug 2022 15:53:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1659707611; bh=hfVnOqc4Ky8GVl5lTaiHHhaKOlAtj47IyJhUdOAB1OM=; 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=pWGz52yAoXjThLl6RDK7gt6yylIZOL3XOHXBstJIY2SXATHVFoASZEgG7+lKm+etq F5J48xVyXOdA4oHRKUK4sgtAZ13ZAwkCW/G4I0WFfvvLUerGD2+P7MsHyZg0hT3p1A N0KkETLQXl4QfuCUUu8dU9j3FFafVVueiqrhMAe3NI0L1aGUTpTXp+s00Uwc2KyrrF iuQTKR6W64oRdfoqBiIEpxT1qRrO3opy+S5nU3A5kpqPr+1NXdf/4FzCTFKlpv+AGB 0KMkAMLKTl0pZvH7pvbgiNVFsxrfc1ZlfuFJ1LHYycawIKvh6qEnz6nA0vz5/647HM kTsTD9tijId4w== Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 637D463328 for ; Fri, 5 Aug 2022 15:53:30 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 8A1FF1C0006; Fri, 5 Aug 2022 13:53:29 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Fri, 5 Aug 2022 15:53:09 +0200 Message-Id: <20220805135312.47497-8-jacopo@jmondi.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220805135312.47497-1-jacopo@jmondi.org> References: <20220805135312.47497-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 07/10] 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: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Kieran Bingham via 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 Signed-off-by: Jacopo Mondi Reviewed-by: Umang Jain --- src/ipa/rkisp1/ipa_context.h | 2 ++ src/ipa/rkisp1/rkisp1.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index c42bcd73b314..dd756f4025d1 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -86,6 +86,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 a2483f27cf52..2c7fdde55f49 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -192,6 +192,7 @@ int IPARkISP1::start() void IPARkISP1::stop() { /* Clean the IPA context at the end of the streaming session. */ + context_.frameContexts.clear(); context_ = {}; } @@ -318,6 +319,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()); @@ -329,9 +332,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);