From patchwork Thu Aug 12 16:52:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 13335 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 12D46C3242 for ; Thu, 12 Aug 2021 16:52:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9E9CD68886; Thu, 12 Aug 2021 18:52:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="GfW/FEHi"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1E20768893 for ; Thu, 12 Aug 2021 18:52:48 +0200 (CEST) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:3d6d:7284:3c48:5edc]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D09A3F49; Thu, 12 Aug 2021 18:52:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1628787167; bh=tkuhE9jzm9r7eXnQj67EBvKN4thsCmh0T0knUSicSQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GfW/FEHiB83KPdqddOKr8TRYnKibKsgChDxnxwPqPca5JWYmbHC2a4EXCiQ5s4UQm K5QpHD4QWMnJMZ2VSAx2gJgPqfraX1nxsKO3iCLO3ZlhYhxxkSfVA8pF9Ufyo+R+gQ MrjtER/GKXp5MN/MNwC1DVXcMpGXJtjU4o5/+dNY= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Thu, 12 Aug 2021 18:52:40 +0200 Message-Id: <20210812165243.276977-8-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210812165243.276977-1-jeanmichel.hautbois@ideasonboard.com> References: <20210812165243.276977-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 07/10] ipa: ipu3: convert AGC to the new algorithm interface 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Signed-off-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham --- src/ipa/ipu3/ipu3.cpp | 2 +- src/ipa/ipu3/ipu3_agc.cpp | 8 +++++--- src/ipa/ipu3/ipu3_agc.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index dba5554d..2a8225a0 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -232,7 +232,7 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo) awbAlgo_ = std::make_unique(); agcAlgo_ = std::make_unique(); - agcAlgo_->initialise(context_.configuration.grid.bdsGrid, sensorInfo_); + agcAlgo_->configure(context_, configInfo); return 0; } diff --git a/src/ipa/ipu3/ipu3_agc.cpp b/src/ipa/ipu3/ipu3_agc.cpp index c6782ff4..0cc35b9f 100644 --- a/src/ipa/ipu3/ipu3_agc.cpp +++ b/src/ipa/ipu3/ipu3_agc.cpp @@ -59,12 +59,14 @@ IPU3Agc::IPU3Agc() { } -void IPU3Agc::initialise(struct ipu3_uapi_grid_config &bdsGrid, const IPACameraSensorInfo &sensorInfo) +int IPU3Agc::configure(IPAContext &context, const IPAConfigInfo &configInfo) { - aeGrid_ = bdsGrid; + aeGrid_ = context.configuration.grid.bdsGrid; - lineDuration_ = sensorInfo.lineLength * 1.0s / sensorInfo.pixelRate; + lineDuration_ = configInfo.sensorInfo.lineLength * 1.0s / configInfo.sensorInfo.pixelRate; maxExposureTime_ = kMaxExposure * lineDuration_; + + return 0; } void IPU3Agc::processBrightness(const ipu3_uapi_stats_3a *stats) diff --git a/src/ipa/ipu3/ipu3_agc.h b/src/ipa/ipu3/ipu3_agc.h index 8b32e52f..e096648b 100644 --- a/src/ipa/ipu3/ipu3_agc.h +++ b/src/ipa/ipu3/ipu3_agc.h @@ -29,7 +29,7 @@ public: IPU3Agc(); ~IPU3Agc() = default; - void initialise(struct ipu3_uapi_grid_config &bdsGrid, const IPACameraSensorInfo &sensorInfo); + int configure(IPAContext &context, const IPAConfigInfo &configInfo) override; void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override; bool converged() { return converged_; } bool updateControls() { return updateControls_; }