{"id":15557,"url":"https://patchwork.libcamera.org/api/patches/15557/?format=json","web_url":"https://patchwork.libcamera.org/patch/15557/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20220325103410.38580-2-umang.jain@ideasonboard.com>","date":"2022-03-25T10:34:08","name":"[libcamera-devel,v4,1/3] ipa: ipu3: Consolidate querying of exposure and gain limits","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"86dccda865935b81e35ce129581843efab569566","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/?format=json","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"delegate":{"id":12,"url":"https://patchwork.libcamera.org/api/users/12/?format=json","username":"uajain","first_name":"Umang","last_name":"Jain","email":"umang.jain@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/15557/mbox/","series":[{"id":3001,"url":"https://patchwork.libcamera.org/api/series/3001/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3001","date":"2022-03-25T10:34:07","name":"ipa: ipu3: Consolidate querying of exposure and gain limits","version":4,"mbox":"https://patchwork.libcamera.org/series/3001/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15557/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15557/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 08C9BC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Mar 2022 10:34:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B9172604DA;\n\tFri, 25 Mar 2022 11:34:26 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C874E604C4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Mar 2022 11:34:24 +0100 (CET)","from perceval.ideasonboard.com (unknown [103.86.18.118])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4F6986F3;\n\tFri, 25 Mar 2022 11:34:21 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648204466;\n\tbh=CWCgDwq3yshEtyjzPFYlN0WK59H01hX8UnTa8DWZ010=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=CW5Fz4cPC/YyJHW0qixsQjnV3YjRQWWNm8QOxZJ9FgFqJuzRdlAdQJWyZafs6R1JE\n\tX7uQ+eRG0RIc56/ioF9BQFh092rqIeQnVoLvJcnAGK8++REB+OPV5FqJ1c8yPRkt+9\n\tdyqIMnhbhVRO9i1Iv7v7gciK02WlB9RthPjWE+IUume/6OReEz1hOEVIjwF/dx80t1\n\tarQlNCNIP3SXnJ6fda+wfZVUAGUEsLhC/hD9NDOIjyFtyNpfJ4YWL2tslUohc6wpuA\n\tsTw4OZMoafwP7RiApTjiIrnnHnpNN5uxEwfg0+7lAicraOMxriN/Auq0mX8hPac5c8\n\tlcezqWJQ3DyVw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1648204464;\n\tbh=CWCgDwq3yshEtyjzPFYlN0WK59H01hX8UnTa8DWZ010=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=jVg4vWKEN9+5gzGfXtUQqFK0t9z1kwh62sAJRbBnk8GwJhYLAlG7FKxNCCRwhMvsP\n\ts1MtydqAOkl+whdTfyA8T4rHSb6MlMEXe3MwczTShTQL0FLhH3W7R1bb6lplGDJQZx\n\tbqllCP8Lse0CW7JTFXTW7SESBYMkmcTzYIy20wT8="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"jVg4vWKE\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 25 Mar 2022 16:04:08 +0530","Message-Id":"<20220325103410.38580-2-umang.jain@ideasonboard.com>","X-Mailer":"git-send-email 2.31.1","In-Reply-To":"<20220325103410.38580-1-umang.jain@ideasonboard.com>","References":"<20220325103410.38580-1-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 1/3] ipa: ipu3: Consolidate querying of\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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The exposure and gain limits are required for AGC configuration\nhandled in IPAIPU3::updateSessionConfiguration(), which is happening\nalready. Therefore the max/min private members in IPAIPU3 class for\nexposure/gain serve no use except setting initial values of exposure_\nand gain_ members.\n\nDrop the max/min private members from IPAIPU3 class and set initial\ngain_ and exposure_ in  IPAIPU3::updateSessionConfiguration().\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/ipu3/ipu3.cpp | 26 ++------------------------\n 1 file changed, 2 insertions(+), 24 deletions(-)","diff":"diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 1ea2c898..a8cc2f6c 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -169,11 +169,7 @@ private:\n \t/* Camera sensor controls. */\n \tuint32_t defVBlank_;\n \tuint32_t exposure_;\n-\tuint32_t minExposure_;\n-\tuint32_t maxExposure_;\n \tuint32_t gain_;\n-\tuint32_t minGain_;\n-\tuint32_t maxGain_;\n \n \t/* Interface to the Camera Helper */\n \tstd::unique_ptr<CameraSensorHelper> camHelper_;\n@@ -194,10 +190,12 @@ void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\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+\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+\tgain_ = minGain;\n \n \t/*\n \t * When the AGC computes the new exposure values for a frame, it needs\n@@ -434,32 +432,12 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n \t */\n \tsensorCtrls_ = configInfo.sensorControls;\n \n-\tconst auto itExp = sensorCtrls_.find(V4L2_CID_EXPOSURE);\n-\tif (itExp == sensorCtrls_.end()) {\n-\t\tLOG(IPAIPU3, Error) << \"Can't find exposure control\";\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tconst auto itGain = sensorCtrls_.find(V4L2_CID_ANALOGUE_GAIN);\n-\tif (itGain == sensorCtrls_.end()) {\n-\t\tLOG(IPAIPU3, Error) << \"Can't find gain control\";\n-\t\treturn -EINVAL;\n-\t}\n-\n \tconst auto itVBlank = sensorCtrls_.find(V4L2_CID_VBLANK);\n \tif (itVBlank == sensorCtrls_.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 \tcalculateBdsGrid(configInfo.bdsOutputSize);\n","prefixes":["libcamera-devel","v4","1/3"]}