{"id":15395,"url":"https://patchwork.libcamera.org/api/1.1/patches/15395/?format=json","web_url":"https://patchwork.libcamera.org/patch/15395/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220228132250.116211-3-umang.jain@ideasonboard.com>","date":"2022-02-28T13:22:50","name":"[libcamera-devel,2/2] ipa: ipu3: Consolidate querying exposure and gain limits","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"0540e965f5fd634225d7d8c845831c810c9f759f","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/1.1/people/86/?format=json","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"delegate":{"id":12,"url":"https://patchwork.libcamera.org/api/1.1/users/12/?format=json","username":"uajain","first_name":"Umang","last_name":"Jain","email":"umang.jain@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/15395/mbox/","series":[{"id":2944,"url":"https://patchwork.libcamera.org/api/1.1/series/2944/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2944","date":"2022-02-28T13:22:48","name":"ipu3: Replace event-based ops with dedicated functions","version":1,"mbox":"https://patchwork.libcamera.org/series/2944/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15395/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15395/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CE17FBE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Feb 2022 13:23:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8D6836116E;\n\tMon, 28 Feb 2022 14:23:05 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B76D61160\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Feb 2022 14:23:03 +0100 (CET)","from perceval.ideasonboard.com (unknown [103.251.226.77])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0053E486;\n\tMon, 28 Feb 2022 14:23:01 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"CVogriZ2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1646054582;\n\tbh=0C9PSKJ5Z4uWhTEiG/4JaQgkVdK4q+o2Fo+2YOIDUWE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=CVogriZ2EebZwUZgLWUbNLak6BYCP9gqCqABu0Xz8DLA9Sx9a6PCl6L9IGqvan03V\n\tYEvtzAjas442XOaeDco79micP17thNulWsD8C6WdxuL4bAcOn0dadtr3ZV2ioreIW+\n\t5LcpSnkGBFg3dHUH/46PoLtmEKwZZbuO8X8DCP4M=","From":"Umang Jain <umang.jain@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 28 Feb 2022 18:52:50 +0530","Message-Id":"<20220228132250.116211-3-umang.jain@ideasonboard.com>","X-Mailer":"git-send-email 2.31.1","In-Reply-To":"<20220228132250.116211-1-umang.jain@ideasonboard.com>","References":"<20220228132250.116211-1-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 2/2] ipa: ipu3: Consolidate querying\n\texposure and gain limits","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The exposure and gain limits are queried as part of\nIPAIPU3::configure(). Consolidate it.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/ipa/ipu3/ipu3.cpp | 44 +++++++++++++------------------------------\n 1 file changed, 13 insertions(+), 31 deletions(-)","diff":"diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 2fab4ee0..33fcf59b 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -196,12 +196,14 @@ private:\n void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\n {\n \tconst ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;\n-\tint32_t minExposure = v4l2Exposure.min().get<int32_t>();\n-\tint32_t maxExposure = v4l2Exposure.max().get<int32_t>();\n+\tminExposure_ = v4l2Exposure.min().get<int32_t>();\n+\tmaxExposure_ = v4l2Exposure.max().get<int32_t>();\n+\texposure_ = minExposure_;\n \n \tconst ControlInfo &v4l2Gain = sensorControls.find(V4L2_CID_ANALOGUE_GAIN)->second;\n-\tint32_t minGain = v4l2Gain.min().get<int32_t>();\n-\tint32_t maxGain = v4l2Gain.max().get<int32_t>();\n+\tminGain_ = v4l2Gain.min().get<int32_t>();\n+\tmaxGain_ = v4l2Gain.max().get<int32_t>();\n+\tgain_ = minGain_;\n \n \t/*\n \t * When the AGC computes the new exposure values for a frame, it needs\n@@ -210,10 +212,10 @@ void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\n \t *\n \t * \\todo take VBLANK into account for maximum shutter speed\n \t */\n-\tcontext_.configuration.agc.minShutterSpeed = minExposure * lineDuration_;\n-\tcontext_.configuration.agc.maxShutterSpeed = maxExposure * lineDuration_;\n-\tcontext_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain);\n-\tcontext_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain);\n+\tcontext_.configuration.agc.minShutterSpeed = minExposure_ * lineDuration_;\n+\tcontext_.configuration.agc.maxShutterSpeed = maxExposure_ * lineDuration_;\n+\tcontext_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain_);\n+\tcontext_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain_);\n }\n \n /**\n@@ -430,32 +432,12 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n \t */\n \tctrls_ = configInfo.sensorControls;\n \n-\tconst auto itExp = ctrls_.find(V4L2_CID_EXPOSURE);\n-\tif (itExp == ctrls_.end()) {\n-\t\tLOG(IPAIPU3, Error) << \"Can't find exposure control\";\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tconst auto itGain = ctrls_.find(V4L2_CID_ANALOGUE_GAIN);\n-\tif (itGain == ctrls_.end()) {\n-\t\tLOG(IPAIPU3, Error) << \"Can't find gain control\";\n-\t\treturn -EINVAL;\n-\t}\n-\n \tconst auto itVBlank = ctrls_.find(V4L2_CID_VBLANK);\n \tif (itVBlank == ctrls_.end()) {\n \t\tLOG(IPAIPU3, Error) << \"Can't find VBLANK control\";\n \t\treturn -EINVAL;\n \t}\n \n-\tminExposure_ = itExp->second.min().get<int32_t>();\n-\tmaxExposure_ = itExp->second.max().get<int32_t>();\n-\texposure_ = minExposure_;\n-\n-\tminGain_ = itGain->second.min().get<int32_t>();\n-\tmaxGain_ = itGain->second.max().get<int32_t>();\n-\tgain_ = minGain_;\n-\n \tdefVBlank_ = itVBlank->second.def().get<int32_t>();\n \n \t/* Clean context at configuration */\n@@ -465,12 +447,12 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n \n \tlineDuration_ = sensorInfo_.lineLength * 1.0s / sensorInfo_.pixelRate;\n \n-\t/* Update the camera controls using the new sensor settings. */\n-\tupdateControls(sensorInfo_, ctrls_, ipaControls);\n-\n \t/* Update the IPASessionConfiguration using the sensor settings. */\n \tupdateSessionConfiguration(ctrls_);\n \n+\t/* Update the camera controls using the new sensor settings. */\n+\tupdateControls(sensorInfo_, ctrls_, ipaControls);\n+\n \tfor (auto const &algo : algorithms_) {\n \t\tint ret = algo->configure(context_, configInfo);\n \t\tif (ret)\n","prefixes":["libcamera-devel","2/2"]}