{"id":15418,"url":"https://patchwork.libcamera.org/api/patches/15418/?format=json","web_url":"https://patchwork.libcamera.org/patch/15418/","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":"<20220305172849.1022923-2-umang.jain@ideasonboard.com>","date":"2022-03-05T17:28:47","name":"[libcamera-devel,v2,1/3] ipa: ipu3: Consolidate querying of exposure and gain limits","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"df594484da6a0112a72fe0bdec9dc224e7fae6b9","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/15418/mbox/","series":[{"id":2951,"url":"https://patchwork.libcamera.org/api/series/2951/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2951","date":"2022-03-05T17:28:46","name":"ipa: ipu3: Consolidate control limits into IPAContext","version":2,"mbox":"https://patchwork.libcamera.org/series/2951/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15418/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15418/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\r\n\t[92.243.16.209])\r\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4A4EBBE08A\r\n\tfor <parsemail@patchwork.libcamera.org>;\r\n\tSat,  5 Mar 2022 17:29:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\r\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 145B9604EC;\r\n\tSat,  5 Mar 2022 18:29:02 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\r\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\r\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 28DC0604EC\r\n\tfor <libcamera-devel@lists.libcamera.org>;\r\n\tSat,  5 Mar 2022 18:29:00 +0100 (CET)","from perceval.ideasonboard.com (unknown [103.251.226.47])\r\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 97E30486;\r\n\tSat,  5 Mar 2022 18:28:58 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\r\n\ts=mail; t=1646501342;\r\n\tbh=cmk4/aGKEaCsrPPNDH155tU13FFBaGemNq5J2Iro72Q=;\r\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\r\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\r\n\tFrom;\r\n\tb=mqlS0j0TDN8C/MUmERJ57CtLfjEzKZFIAGV5PGaZZApi3jyykT5Ykf60E9jBtaEYu\r\n\tViaFB+GojdgRfbWVDDGOGByYKIDh6fTdyxCx5jSr0kZ4uxydwv7qrNQGkc4vnTPtI7\r\n\tyjCxTfjB6lqCzfsDNsx93jiLQHRxKA6SKmsA5nkYqI0sHRnSXamwB+2aO948KTKbvZ\r\n\t/A19uSOO74JPS1FuDD1Gbnh/GRjXL7kSwxNpYl+fVzpbO7J4bisfV3QKjl57CqtiLp\r\n\tIQIcNIxhzrBmVxByg8ceU34+XtmdfGu4P32zWgp3WW0ADXUVsKC/G758xL9GgU5pTG\r\n\tbMvh8D76T6pjQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\r\n\ts=mail; t=1646501339;\r\n\tbh=cmk4/aGKEaCsrPPNDH155tU13FFBaGemNq5J2Iro72Q=;\r\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\r\n\tb=IN29b5aY5Ma6NabEu2HgUPX8fmSFWmGDZsduli1X4F6qP4qEl7Sgge7nzK8fuWEZD\r\n\tjap5AUxlpfkqDsCLq591+gjOhCX/F6u39ZJcm76I0/eTfwckA2tP1JLkDWCGgQjtP2\r\n\t6fAmzVA4ZjTVRDyGeVSaYjSvN38KTHGK1hlql8Uc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \r\n\tunprotected) header.d=ideasonboard.com\r\n\theader.i=@ideasonboard.com\r\n\theader.b=\"IN29b5aY\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Sat,  5 Mar 2022 22:58:47 +0530","Message-Id":"<20220305172849.1022923-2-umang.jain@ideasonboard.com>","X-Mailer":"git-send-email 2.31.1","In-Reply-To":"<20220305172849.1022923-1-umang.jain@ideasonboard.com>","References":"<20220305172849.1022923-1-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 1/3] ipa: ipu3: Consolidate querying of\r\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>,\r\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>,\r\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>\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\r\nindex 17324616..4b6852a7 100644\r\n--- a/src/ipa/ipu3/ipu3.cpp\r\n+++ b/src/ipa/ipu3/ipu3.cpp\r\n@@ -167,11 +167,7 @@ private:\r\n \t/* Camera sensor controls. */\r\n \tuint32_t defVBlank_;\r\n \tuint32_t exposure_;\r\n-\tuint32_t minExposure_;\r\n-\tuint32_t maxExposure_;\r\n \tuint32_t gain_;\r\n-\tuint32_t minGain_;\r\n-\tuint32_t maxGain_;\r\n \r\n \t/* Interface to the Camera Helper */\r\n \tstd::unique_ptr<CameraSensorHelper> camHelper_;\r\n@@ -192,10 +188,12 @@ void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\r\n \tconst ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;\r\n \tint32_t minExposure = v4l2Exposure.min().get<int32_t>();\r\n \tint32_t maxExposure = v4l2Exposure.max().get<int32_t>();\r\n+\texposure_ = minExposure;\r\n \r\n \tconst ControlInfo &v4l2Gain = sensorControls.find(V4L2_CID_ANALOGUE_GAIN)->second;\r\n \tint32_t minGain = v4l2Gain.min().get<int32_t>();\r\n \tint32_t maxGain = v4l2Gain.max().get<int32_t>();\r\n+\tgain_ = minGain;\r\n \r\n \t/*\r\n \t * When the AGC computes the new exposure values for a frame, it needs\r\n@@ -429,32 +427,12 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\r\n \t */\r\n \tctrls_ = configInfo.sensorControls;\r\n \r\n-\tconst auto itExp = ctrls_.find(V4L2_CID_EXPOSURE);\r\n-\tif (itExp == ctrls_.end()) {\r\n-\t\tLOG(IPAIPU3, Error) << \"Can't find exposure control\";\r\n-\t\treturn -EINVAL;\r\n-\t}\r\n-\r\n-\tconst auto itGain = ctrls_.find(V4L2_CID_ANALOGUE_GAIN);\r\n-\tif (itGain == ctrls_.end()) {\r\n-\t\tLOG(IPAIPU3, Error) << \"Can't find gain control\";\r\n-\t\treturn -EINVAL;\r\n-\t}\r\n-\r\n \tconst auto itVBlank = ctrls_.find(V4L2_CID_VBLANK);\r\n \tif (itVBlank == ctrls_.end()) {\r\n \t\tLOG(IPAIPU3, Error) << \"Can't find VBLANK control\";\r\n \t\treturn -EINVAL;\r\n \t}\r\n \r\n-\tminExposure_ = itExp->second.min().get<int32_t>();\r\n-\tmaxExposure_ = itExp->second.max().get<int32_t>();\r\n-\texposure_ = minExposure_;\r\n-\r\n-\tminGain_ = itGain->second.min().get<int32_t>();\r\n-\tmaxGain_ = itGain->second.max().get<int32_t>();\r\n-\tgain_ = minGain_;\r\n-\r\n \tdefVBlank_ = itVBlank->second.def().get<int32_t>();\r\n \r\n \tcalculateBdsGrid(configInfo.bdsOutputSize);","prefixes":["libcamera-devel","v2","1/3"]}