From patchwork Fri Aug 5 13:53:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16985 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 8A13CC3272 for ; Fri, 5 Aug 2022 13:53:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3C53C63344; Fri, 5 Aug 2022 15:53:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1659707616; bh=KTMNfasVWVEpTkCFVyvywoM3njx3IKXpEVyZ8juVNzE=; 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=0lfvlWtkNDQB5hutuMEeU5HZ/gGtZbLwD/82yP9o0GPH9mzAHQRG+gZN3DQclVs1G o1xLurOkjOtG8Gl4lRfByOBNN9xHg8Og3h/pLbFvNsZr/BFtu07EGjL9KTeptKbzqj OiUkgbhuKo9IOaplixIZ3VcQIydveYDMuUB7zsBe3Oichfqb4sU4VnOAkVnHhTt3wW QRjswoJ601Jz9lpDb/IU/jhJAdXw0RtgkJzWEiozHF/v8Bgjjd7IEEupqj8Ev9MsPI jmrvwrK6P9c6Dywtue/MpoZBxMjeI7zHdlB31xaNZ+z7LB19Xh4wYfUWe5cRZ/qfOr KCI8zOZPjNg5g== Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 675E763340 for ; Fri, 5 Aug 2022 15:53:34 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 9546E1C0003; Fri, 5 Aug 2022 13:53:33 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Fri, 5 Aug 2022 15:53:12 +0200 Message-Id: <20220805135312.47497-11-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 10/10] ipa: libipa: algorithm: queueRequest(): Pass frame context 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 Pass the current FrameContext for calls to queueRequest(). Now that both the IPU3 and RkISP1 IPA modules comply with the same interface, propagate the queueRequest() call to algorithms in the IPU3 IPA module. Signed-off-by: Kieran Bingham Signed-off-by: Jacopo Mondi Reviewed-by: Umang Jain --- src/ipa/ipu3/ipu3.cpp | 5 ++--- src/ipa/libipa/algorithm.cpp | 1 + src/ipa/libipa/algorithm.h | 1 + src/ipa/rkisp1/algorithms/cproc.cpp | 1 + src/ipa/rkisp1/algorithms/cproc.h | 1 + src/ipa/rkisp1/algorithms/filter.cpp | 1 + src/ipa/rkisp1/algorithms/filter.h | 1 + src/ipa/rkisp1/rkisp1.cpp | 4 +++- 8 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index da4d416b6aef..e033891a9341 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -622,9 +622,8 @@ void IPAIPU3::queueRequest(const uint32_t frame, const ControlList &controls) /* \todo Start processing for 'frame' based on 'controls'. */ IPU3FrameContext &frameContext = context_.frameContexts.initialise(frame); - /* \todo Implement queueRequest to each algorithm. */ - (void)frameContext; - (void)controls; + for (auto const &algo : algorithms_) + algo->queueRequest(context_, frame, frameContext, controls); } /** diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp index 30eab67f71fc..c152b885aee1 100644 --- a/src/ipa/libipa/algorithm.cpp +++ b/src/ipa/libipa/algorithm.cpp @@ -88,6 +88,7 @@ namespace ipa { * \brief Provide control values to the algorithm * \param[in] context The shared IPA context * \param[in] frame The frame number to apply the control values + * \param[in] frameContext The current frame's context * \param[in] controls The list of user controls * * This function is called for each request queued to the camera. It provides diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h index c2d990707b25..f92829ad7ac6 100644 --- a/src/ipa/libipa/algorithm.h +++ b/src/ipa/libipa/algorithm.h @@ -46,6 +46,7 @@ public: virtual void queueRequest([[maybe_unused]] typename Module::Context &context, [[maybe_unused]] const uint32_t frame, + [[maybe_unused]] typename Module::FrameContext &frameContext, [[maybe_unused]] const ControlList &controls) { } diff --git a/src/ipa/rkisp1/algorithms/cproc.cpp b/src/ipa/rkisp1/algorithms/cproc.cpp index edaf2d10e850..c0792926f9eb 100644 --- a/src/ipa/rkisp1/algorithms/cproc.cpp +++ b/src/ipa/rkisp1/algorithms/cproc.cpp @@ -38,6 +38,7 @@ LOG_DEFINE_CATEGORY(RkISP1CProc) */ void ColorProcessing::queueRequest(IPAContext &context, [[maybe_unused]] const uint32_t frame, + [[maybe_unused]] RKISP1FrameContext &frameContext, const ControlList &controls) { auto &cproc = context.activeState.cproc; diff --git a/src/ipa/rkisp1/algorithms/cproc.h b/src/ipa/rkisp1/algorithms/cproc.h index fde83f3c965c..13f8967e70a8 100644 --- a/src/ipa/rkisp1/algorithms/cproc.h +++ b/src/ipa/rkisp1/algorithms/cproc.h @@ -22,6 +22,7 @@ public: ~ColorProcessing() = default; void queueRequest(IPAContext &context, const uint32_t frame, + RKISP1FrameContext &frameContext, const ControlList &controls) override; void prepare(IPAContext &context, unsigned int frame, RKISP1FrameContext &frameContext, diff --git a/src/ipa/rkisp1/algorithms/filter.cpp b/src/ipa/rkisp1/algorithms/filter.cpp index f6577046442a..8c5af213d6d0 100644 --- a/src/ipa/rkisp1/algorithms/filter.cpp +++ b/src/ipa/rkisp1/algorithms/filter.cpp @@ -44,6 +44,7 @@ static constexpr uint32_t kFiltModeDefault = 0x000004f2; */ void Filter::queueRequest(IPAContext &context, [[maybe_unused]] const uint32_t frame, + [[maybe_unused]] RKISP1FrameContext &frameContext, const ControlList &controls) { auto &filter = context.activeState.filter; diff --git a/src/ipa/rkisp1/algorithms/filter.h b/src/ipa/rkisp1/algorithms/filter.h index 1fbe785a3cab..b10efa208a48 100644 --- a/src/ipa/rkisp1/algorithms/filter.h +++ b/src/ipa/rkisp1/algorithms/filter.h @@ -22,6 +22,7 @@ public: ~Filter() = default; void queueRequest(IPAContext &context, const uint32_t frame, + RKISP1FrameContext &frameContext, const ControlList &controls) override; void prepare(IPAContext &context, unsigned int frame, RKISP1FrameContext &frameContext, diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 9af8217c3b8a..548bbd202cfb 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -296,8 +296,10 @@ void IPARkISP1::unmapBuffers(const std::vector &ids) void IPARkISP1::queueRequest(const uint32_t frame, const ControlList &controls) { + RKISP1FrameContext &frameContext = context_.frameContexts.initialise(frame); + for (auto const &algo : algorithms()) - algo->queueRequest(context_, frame, controls); + algo->queueRequest(context_, frame, frameContext, controls); } void IPARkISP1::fillParamsBuffer(const uint32_t frame, const uint32_t bufferId)