[{"id":22437,"web_url":"https://patchwork.libcamera.org/comment/22437/","msgid":"<YjyRYkezfvyuR9vm@pendragon.ideasonboard.com>","date":"2022-03-24T15:42:26","subject":"Re: [libcamera-devel] [PATCH v3 1/3] ipa: ipu3: Consolidate\n\tquerying of exposure and gain limits","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Umang,\n\nThank you for the patch.\n\nOn Thu, Mar 24, 2022 at 07:50:33PM +0530, Umang Jain via libcamera-devel wrote:\n> The exposure and gain limits are required for AGC configuration\n> handled in IPAIPU3::updateSessionConfiguration(), which is happening\n> already. Therefore the max/min private members in IPAIPU3 class for\n> exposure/gain serve no use except setting initial values of exposure_\n> and gain_ members.\n> \n> Drop the max/min private members from IPAIPU3 class and set initial\n> gain_ and exposure_ in  IPAIPU3::updateSessionConfiguration().\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/ipa/ipu3/ipu3.cpp | 26 ++------------------------\n>  1 file changed, 2 insertions(+), 24 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 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);","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 D1D28C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Mar 2022 15:42:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA6D1604D5;\n\tThu, 24 Mar 2022 16:42:29 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D97F60397\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Mar 2022 16:42:28 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 01BF51844;\n\tThu, 24 Mar 2022 16:42:27 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648136549;\n\tbh=b0Iwr56TSLbZJgT2PsroJ03KEWIwHdAD2NteBBMWmXQ=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=SKGnK6iIq65942tJTgL1dzHs1bth29q3PVbwyjrA3E+Pb1VUps3ALPHwPHwS67Pkh\n\tUpmtSrUNhJuxm4P96EEZJONG2Z9/yHY2UNRdiEckAFHbt2dqneN+mbVkybpH5ZzWlE\n\t1qefX2lKTFzdCTVqWsPKEgXvXhn+DKTn42QO7jplZ0zEQay7hHs5unI4I6DLX++d+T\n\tyk8edHr9MH4RVwgILixzkTema+S4F4S/UALsDB1izBIs71dEVseH9apZNSjpbCuH26\n\tOYPHBnlR7K3f1Db/qqgyKa1aZGnSlnWDACqN/rBzBBxJ7UuC7TcGkIxOmQjp1eTkPK\n\t93/+ySEqBdHyQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1648136548;\n\tbh=b0Iwr56TSLbZJgT2PsroJ03KEWIwHdAD2NteBBMWmXQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=N+Oi+i44Efz9/ttJSMnoJRBFNZKr4XRQM30fD6/b4SayzFmcM0CdydxN6VqC5ghLX\n\tj2vV/dD0GZDyo+tDp+H5Xq3zcTj7bD2CcZtKOe8qELnd0Fct49GKjK0pKw8aImGrWF\n\t+Hl1MRXwPhymfoAZLxgw7Y9g7ISS4FdD9BEPEREo="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"N+Oi+i44\"; dkim-atps=neutral","Date":"Thu, 24 Mar 2022 17:42:26 +0200","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<YjyRYkezfvyuR9vm@pendragon.ideasonboard.com>","References":"<20220324142035.47338-1-umang.jain@ideasonboard.com>\n\t<20220324142035.47338-2-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220324142035.47338-2-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 1/3] ipa: ipu3: Consolidate\n\tquerying of exposure 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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]