From patchwork Thu Jul 21 12:13:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 16722 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 0A7EDC3274 for ; Thu, 21 Jul 2022 12:13:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B234863317; Thu, 21 Jul 2022 14:13:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1658405606; bh=Qyt/OUdZg+2y+xNvn48MTOqODy1zqpfhIIuhwHcTC60=; 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=th3Unazmo73kOsp6oyehcPti4RL4PLzuZtjS170F8Sp7upBLGJzsZYahwmcYOsDRY T7kxCncdOND4TV09wE+YidLiz0wvpYHRBfL+I31UmkkwBpnW+q5nnO9HN/vdyWx4fZ qbbsckcJwNkejetHrwIAHr+JozPg8rznP4BSBGwJXvFUIEneSbrqB0FIh5eVoERPZN G1/Zl+u7bwXvVQTYeC+9sjGH93EhV9AJNgIanEmO5zfOdlhqWIrS8xx2rYf3Q3O1st +1QLKgeZVxrY+q9E2cbYl1t3YyQZS832Ss8WRp+Ib4Qx1dxjNNttqIWWVfVH1jHomG +nWcYXaLFqwdg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 413376331D for ; Thu, 21 Jul 2022 14:13:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="khQQI69S"; 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 DC1AD9B1; 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=1658405596; bh=Qyt/OUdZg+2y+xNvn48MTOqODy1zqpfhIIuhwHcTC60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=khQQI69S10Qirrtntq0n81HM2LSw2yiL9ERvzNu0nzQ7zDcaCMijBc0RisRuUukZH 2TLEyK7mKjGXcce7nbUCPqT6rz65R7UzRpwd56hmd5WwRpiBTfFCcQWUvDxIX3ZKH+ qhfg006bl5vBmO6BRdysb/1P1jXplPL9gOUkEXyY= To: libcamera devel Date: Thu, 21 Jul 2022 13:13:08 +0100 Message-Id: <20220721121310.1286862-11-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 10/12] ipa: libipa: algorithm: Add queueRequest() to the Algorithm class 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" From: Florian Sylvestre Add queueRequest() function to the Algorithm class. The queueRequest() function provides controls values coming from the application to each algorithm. Each algorithm is responsible for retrieving the controls associated to them. Signed-off-by: Florian Sylvestre Signed-off-by: Kieran Bingham --- v2: (Kieran) - Adjust function ordering - Add FrameContext to queueRequest - Removed Module::ControlList and using libcamera::ControlList directly Signed-off-by: Kieran Bingham --- src/ipa/libipa/algorithm.cpp | 17 +++++++++++++++++ src/ipa/libipa/algorithm.h | 9 +++++++++ 2 files changed, 26 insertions(+) diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp index 65e9e8a56fc4..020b0b57b632 100644 --- a/src/ipa/libipa/algorithm.cpp +++ b/src/ipa/libipa/algorithm.cpp @@ -83,6 +83,23 @@ namespace ipa { * includes setting fields and flags that enable those processing blocks. */ +/** + * \fn Algorithm::queueRequest() + * \brief Provide control values to the algorithm + * \param[in] context The shared IPA context + * \param[in] frame The frame context sequence number + * \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 + * the controls stored in the request to the algorithm. The \a frame number + * is the Request sequence number and identifies the desired corresponding + * frame to target for the controls to take effect. + * + * Algorithms shall read the applicable controls and store their value for later + * use during frame processing. + */ + /** * \fn Algorithm::process() * \brief Process ISP statistics, and run algorithm operations diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h index 1d2544a767eb..5ccc640955c4 100644 --- a/src/ipa/libipa/algorithm.h +++ b/src/ipa/libipa/algorithm.h @@ -11,6 +11,7 @@ namespace libcamera { +class ControlList; class YamlObject; namespace ipa { @@ -35,6 +36,14 @@ public: return 0; } + + 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) + { + } + virtual void prepare([[maybe_unused]] typename Module::Context &context, [[maybe_unused]] unsigned int frame, [[maybe_unused]] typename Module::FrameContext &frameContext,