From patchwork Tue Mar 15 13:34:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15448 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 456F8BDE17 for ; Tue, 15 Mar 2022 13:34:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6FF1B604E9; Tue, 15 Mar 2022 14:34:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647351273; bh=t/JbdkFTXorpiSOFz/PXU2UFTUTB9SNVA0hz53+Smro=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Xhsg1DxH4u50xGnjJiwFEuhKCWMeXlVEJkz/H26OGNMMwxr5TEvW6LOG1zwxM02oV JQjr4AOXJor/f+koWQw0xuI/TRj4zfAtELx/1m5q84lQ/mpgw7Ad7A25/wvcmnVyTo LZYn4qtr32xIEN/HMYQ1EZ8FnuwIiaRxdnvyW2pVbPN8ezi5lVuk6MZjgkdVyv/r/Q I39ZvvtVm8wXx0VaZx1Jv1rDxpJEPnLke3Lfx2pi3pbepvLO9+ScTC4cAZs/GPbF/Z KvIQNeX8mDS3xtaVTndHyc4tDSRqyL3mX50yjFc6/QS9PM3Hl7C0R49vXLKdeAyAx/ u0eLJoBdRUzmw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1EF15604DA for ; Tue, 15 Mar 2022 14:34:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="BpH36zLJ"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A06FF1BBB for ; Tue, 15 Mar 2022 14:34:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1647351271; bh=t/JbdkFTXorpiSOFz/PXU2UFTUTB9SNVA0hz53+Smro=; h=From:To:Subject:Date:From; b=BpH36zLJa7owqxx61vk7TAdDOfPQpM/e2/+5z0lza76na/C0Qo63xj/3thiceNv+R CpKq7gX8YfOKw3BMp/iIkIb+3N7qBaTY0hrPaHEFsCm+7NQ70mj/XGI5udnv33vdPT Ca14+5fyHceraBZFlXn7ofOu3brGuypkmLI8gUqA= To: libcamera-devel@lists.libcamera.org Date: Tue, 15 Mar 2022 15:34:06 +0200 Message-Id: <20220315133407.32348-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] ipa: ipu3: agc: Reset frame count when configuring AGC 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The frame count is used to skip the gain and exposure filtering when starting. It thus needs to be reset when configuring the algorithm, to avoid slower convergence when stopping and restarting. Signed-off-by: Laurent Pinchart Reviewed-by: Jean-Michel Hautbois Reviewed-by: Umang Jain --- src/ipa/ipu3/algorithms/agc.cpp | 1 + 1 file changed, 1 insertion(+) base-commit: e41854a4e6fde2dd9e2a2a7290670943235776cd diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index 1eb1bcef2f02..70cff3fed43c 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -102,6 +102,7 @@ int Agc::configure(IPAContext &context, frameContext.agc.gain = std::max(minAnalogueGain_, kMinAnalogueGain); frameContext.agc.exposure = 10ms / configuration.sensor.lineDuration; + frameCount_ = 0; return 0; } From patchwork Tue Mar 15 13:34:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15449 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 06B78C3262 for ; Tue, 15 Mar 2022 13:34:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E202E632E2; Tue, 15 Mar 2022 14:34:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647351273; bh=4oomBjcbeo/wtZoXxzrhAeBeEQFaLJJu2+DhxocT0oI=; 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=V1gHFoVmLW80mzLCzpGtRD3ho4okGU+yjf2aXyhOcVTasvpj7G3LSzg+c+DQTyrL5 +CqpVcUBzsaltm4HvT5NTAGngt/fbnah8eDy5pJBYJRegln0RNxrxa264AJnFfH5OQ r+BrU25+5Mdd7GKUsKDVDqWX9pmUjnIKjLFkOT8Xuf+MD6KPn4LlZTh6fWnaMm0fcP RBl8ng/sWRbDPhmA1mijxAzGDwqWoW2NN7dvrA0PqbUnfx/wWmLnjPn/V1/NNuwiNC GyTrw/rflkKZfc+xTKY39lTJj8SFSuTaqV75AqnYdHNbTmcoyqTt6C56oRgB9ZkVbB 0b5sr094KC+Tg== 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 8850E604DA for ; Tue, 15 Mar 2022 14:34:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="XcAd71Xp"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2C8161C34 for ; Tue, 15 Mar 2022 14:34:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1647351272; bh=4oomBjcbeo/wtZoXxzrhAeBeEQFaLJJu2+DhxocT0oI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XcAd71Xpt3thkwQabH2z2hPagBwXZLVukYGkyYC4La0KYC0r7Cccm82InShMlFC9t ffdL3lko9vHFDPFOKLN93IMwRDSi7tPu827RNmYNaYUQ/7JH2TwjSwTR71O/M30jVz z+bTJzhN2P1ZEFPlEpP/+iT8K77tUPyxAkPEt/zU= To: libcamera-devel@lists.libcamera.org Date: Tue, 15 Mar 2022 15:34:07 +0200 Message-Id: <20220315133407.32348-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220315133407.32348-1-laurent.pinchart@ideasonboard.com> References: <20220315133407.32348-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] ipa: ipu3: agc: Use existing local short-hand variable in configure() 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The configure() function has a local configuration variable referencing context.configuration for the purpose of shortening lines. Use it instead of context.configuration in the remaining locations, and constify it while at it as the configuration isn't meant to be modified. Signed-off-by: Laurent Pinchart Reviewed-by: Jean-Michel Hautbois Reviewed-by: Umang Jain --- src/ipa/ipu3/algorithms/agc.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index 70cff3fed43c..7d4b3503f390 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -86,17 +86,17 @@ Agc::Agc() int Agc::configure(IPAContext &context, [[maybe_unused]] const IPAConfigInfo &configInfo) { - IPASessionConfiguration &configuration = context.configuration; + const IPASessionConfiguration &configuration = context.configuration; IPAFrameContext &frameContext = context.frameContext; stride_ = configuration.grid.stride; - minShutterSpeed_ = context.configuration.agc.minShutterSpeed; - maxShutterSpeed_ = std::min(context.configuration.agc.maxShutterSpeed, + minShutterSpeed_ = configuration.agc.minShutterSpeed; + maxShutterSpeed_ = std::min(configuration.agc.maxShutterSpeed, kMaxShutterSpeed); - minAnalogueGain_ = std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain); - maxAnalogueGain_ = std::min(context.configuration.agc.maxAnalogueGain, kMaxAnalogueGain); + minAnalogueGain_ = std::max(configuration.agc.minAnalogueGain, kMinAnalogueGain); + maxAnalogueGain_ = std::min(configuration.agc.maxAnalogueGain, kMaxAnalogueGain); /* Configure the default exposure and gain. */ frameContext.agc.gain = std::max(minAnalogueGain_, kMinAnalogueGain);