[{"id":27284,"web_url":"https://patchwork.libcamera.org/comment/27284/","msgid":"<20230606152215.GB20136@pendragon.ideasonboard.com>","date":"2023-06-06T15:22:15","subject":"Re: [libcamera-devel] [PATCH v3 3/3] ipa: rpi: Set lens position to\n\thyperfocal on startup","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Mon, Jun 05, 2023 at 10:14:06AM +0100, Naushir Patuck via libcamera-devel wrote:\n> On the first ipa->configure() call, set the lens position (if a lens is\n> present) to the default position. Typically this would be the hyperfocal\n> position based on the tuning data.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/ipa/rpi/common/ipa_base.cpp | 17 +++++++++++++++++\n>  1 file changed, 17 insertions(+)\n> \n> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> index 599ad146a863..dbb95311ba51 100644\n> --- a/src/ipa/rpi/common/ipa_base.cpp\n> +++ b/src/ipa/rpi/common/ipa_base.cpp\n> @@ -199,6 +199,23 @@ int32_t IpaBase::configure(const IPACameraSensorInfo &sensorInfo, const ConfigPa\n>  \t\tagcStatus.shutterTime = defaultExposureTime;\n>  \t\tagcStatus.analogueGain = defaultAnalogueGain;\n>  \t\tapplyAGC(&agcStatus, ctrls);\n> +\n> +\t\t/* Set the lens to the default (typically hyperfocal) position on first start. */\n\nI'll reflow the commit message.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\t\tif (lensPresent_) {\n> +\t\t\tRPiController::AfAlgorithm *af =\n> +\t\t\t\tdynamic_cast<RPiController::AfAlgorithm *>(controller_.getAlgorithm(\"af\"));\n> +\n> +\t\t\tif (af) {\n> +\t\t\t\tfloat defaultPos =\n> +\t\t\t\t\tipaAfControls.at(&controls::LensPosition).def().get<float>();\n> +\t\t\t\tControlList lensCtrl(lensCtrls_);\n> +\t\t\t\tint32_t hwpos;\n> +\n> +\t\t\t\taf->setLensPosition(defaultPos, &hwpos);\n> +\t\t\t\tlensCtrl.set(V4L2_CID_FOCUS_ABSOLUTE, hwpos);\n> +\t\t\t\tresult->lensControls = std::move(lensCtrl);\n> +\t\t\t}\n> +\t\t}\n>  \t}\n>  \n>  \tresult->sensorControls = std::move(ctrls);","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 D0475C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  6 Jun 2023 15:22:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 566526287E;\n\tTue,  6 Jun 2023 17:22:19 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 48ECC62709\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  6 Jun 2023 17:22:18 +0200 (CEST)","from pendragon.ideasonboard.com (om126253223039.31.openmobile.ne.jp\n\t[126.253.223.39])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 05B6EAB;\n\tTue,  6 Jun 2023 17:21:51 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1686064939;\n\tbh=CcvSdNFN0F+9Njcei6ME6BWM2l2sJ3Wa+AMA0Vney8k=;\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=0ZWJVBcWRTHVr6RCUd94ZJYhkHAIZjmcb5kApKzSv4QjMf6u8ABDz57UskGQaG5Lf\n\tgI06zcXjNrG1kpXBWvME9UsgnaF05VDDasqP0Q/gIDbRWQYEDviDUs4DPvFr54/gqD\n\tXflzMQebo2+Tyc970O+fHEKIGWuyPkogvlgu80Zs8LJMGLzfdMZ8fRb6N+h6jn/Ete\n\ts6cQIxSy0DQKqcARIEOezPT/AHMpP8OwACJGhX7i3d4Ypo/UzY2+2iXpHYNMqDLZSe\n\tt0ub93oo4vsh+ne1RUEvDigZnQVXY//SHr/C0dGoy8bI5dez8K79PaFG0nGk/EkMrA\n\tvLCdJMLjDbPTQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1686064912;\n\tbh=CcvSdNFN0F+9Njcei6ME6BWM2l2sJ3Wa+AMA0Vney8k=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LQ4FV+e2ey458noF8vN488CWsWkN2UoCiulSlFRxwF9+QjHmw0m+BwhTZ3OOt6tt0\n\tJehQ6sOX0KkClriUSxWLB7WluhRaB/9bVsut8MR0X2C494Ki1nmrSfOaanyUCa7nXi\n\t6NW67F0AKCaIuM/zlbXFY36Z1cBSzCKUQQsrNMQc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"LQ4FV+e2\"; dkim-atps=neutral","Date":"Tue, 6 Jun 2023 18:22:15 +0300","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20230606152215.GB20136@pendragon.ideasonboard.com>","References":"<20230605091406.31757-1-naush@raspberrypi.com>\n\t<20230605091406.31757-4-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230605091406.31757-4-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v3 3/3] ipa: rpi: Set lens position to\n\thyperfocal on startup","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>"}}]