From patchwork Mon Mar 29 19:18:24 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: 11778 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 A1099C32F0 for ; Mon, 29 Mar 2021 19:18:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 55F3C6878D; Mon, 29 Mar 2021 21:18:41 +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="NJ0jCwGc"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 64B1A6877D for ; Mon, 29 Mar 2021 21:18:36 +0200 (CEST) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:169:7140:9714:da21:50fd:f63f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F261AA49; Mon, 29 Mar 2021 21:18:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1617045516; bh=qc9pD4A5hjZO2xSNHx4vTYsDKsqv2di52PIgpw102DM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NJ0jCwGcgfPiqmZ7gguILvyedtCwym3EoNRoqVaFQpSIx/chL8DeeobMGRcpKTSHx 6v21xe9Wghhhts2PgyI8FNdLoGpApU+4086sM9T/sSInAMwT1QZOSYKx5Ax3azeRRb x/E3foAYzSrraFy1ie9DuxgYr3xmdM1E7qMgx4wI= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Mon, 29 Mar 2021 21:18:24 +0200 Message-Id: <20210329191826.77817-4-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210329191826.77817-1-jeanmichel.hautbois@ideasonboard.com> References: <20210329191826.77817-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 3/5] ipa: ipu3: Use a local parameter object and prepare for 3A algorithms 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" The IPA will locally modify the parameters before they are passed down to the imgU. Use a local parameter object to give a reference to those algorithms. AGC algorithm calculates a brightness level at min and max exposure/gains. Starting at the minimum value for both of them shortens the time to converge (as the first frames will already have the correct level). Signed-off-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart --- src/ipa/ipu3/ipu3.cpp | 11 +++++++++-- src/ipa/ipu3/meson.build | 6 +++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 34a907f2..07dbc24a 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -61,6 +61,9 @@ private: uint32_t gain_; uint32_t minGain_; uint32_t maxGain_; + + /* Local parameter storage */ + ipu3_uapi_params params_; }; int IPAIPU3::start() @@ -92,11 +95,15 @@ void IPAIPU3::configure(const std::map &entityControls minExposure_ = std::max(itExp->second.min().get(), 1); maxExposure_ = itExp->second.max().get(); - exposure_ = maxExposure_; + exposure_ = minExposure_; minGain_ = std::max(itGain->second.min().get(), 1); maxGain_ = itGain->second.max().get(); - gain_ = maxGain_; + gain_ = minGain_; + + params_ = {}; + + setControls(0); } void IPAIPU3::mapBuffers(const std::vector &buffers) diff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build index a241f617..52d98c8e 100644 --- a/src/ipa/ipu3/meson.build +++ b/src/ipa/ipu3/meson.build @@ -2,8 +2,12 @@ ipa_name = 'ipa_ipu3' +ipu3_ipa_sources = files([ + 'ipu3.cpp', +]) + mod = shared_module(ipa_name, - ['ipu3.cpp', libcamera_generated_ipa_headers], + [ipu3_ipa_sources, libcamera_generated_ipa_headers], name_prefix : '', include_directories : [ipa_includes, libipa_includes], dependencies : libcamera_dep,