{"id":17933,"url":"https://patchwork.libcamera.org/api/patches/17933/?format=json","web_url":"https://patchwork.libcamera.org/patch/17933/","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":"<20221201145133.479794-5-umang.jain@ideasonboard.com>","date":"2022-12-01T14:51:32","name":"[libcamera-devel,4/5] ipa: raspberrypi: Send the AF status back","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":false,"hash":"f25038f6b6dd743236d6f9573b25492b65b396f5","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/?format=json","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17933/mbox/","series":[{"id":3653,"url":"https://patchwork.libcamera.org/api/series/3653/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3653","date":"2022-12-01T14:51:28","name":"ipa: rapsberrypi: Introduce auto-focus (auto-mode)","version":1,"mbox":"https://patchwork.libcamera.org/series/3653/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17933/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17933/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 82CB5BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  1 Dec 2022 14:52:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 50F9063348;\n\tThu,  1 Dec 2022 15:52:49 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DD5D863335\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  1 Dec 2022 15:52:47 +0100 (CET)","from umang.jainideasonboard.com (unknown [210.186.188.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A41306D0;\n\tThu,  1 Dec 2022 15:52:46 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669906369;\n\tbh=aU2q0UOwCJY4ufftiSrikse4mSAYAiaPIuAJdUjOF4M=;\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=jE9V/tkTOf4HF+o7XTrK2cmwMP02vnydymkUVNFXH52lLy2V8IAZ06TQwy1+QzyRF\n\tu+WBmxTylSE8GHye/75D4WO+2nZ0XkugGhDPn88orUvAC4t+vwimkcoDV6MP1dGP5H\n\tvNs/7ppGpEYt+lnovrMgJ8KJT3U/L+v2oimUlqI/nBfKt28BE1W0/+4yE63jNVU1nu\n\tUsBpsAfr34DHENOi5zL1lsojjJqiK/PiXEgjndRcR6GUVRc2Tq3WzU6rxzR34bMUmt\n\t5VKsZmOPmkwb0IhuM53gt0fjYUzBrmRky24DK1jZQZcJKhw8QMZKwSClr4cUMETG2w\n\tta5uuZKRjHoPg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669906367;\n\tbh=aU2q0UOwCJY4ufftiSrikse4mSAYAiaPIuAJdUjOF4M=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=cNAFj9TIAOCBlblwlMMOETBIWLfxBTLdr6qmodkY8ZYml+RbHIvkMRYAzZrGc1P4T\n\tOfQft+ZyqVyQoe1zoPEWCFLDQ6e2ltkzeVi7rzAjmyCqLZHoGEvwi1PGVi+Tuq7BH5\n\tbT4v0xrDzcQ2XGk4HjENw+WJwl9ewW5PSkpLhkpA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"cNAFj9TI\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Thu,  1 Dec 2022 22:51:32 +0800","Message-Id":"<20221201145133.479794-5-umang.jain@ideasonboard.com>","X-Mailer":"git-send-email 2.38.1","In-Reply-To":"<20221201145133.479794-1-umang.jain@ideasonboard.com>","References":"<20221201145133.479794-1-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 4/5] ipa: raspberrypi: Send the AF status\n\tback","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":"From: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n\nThe user can read the status for each frame with the AfState control\nvalue. Populate the AF status into the metadata when it is available.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/ipa/raspberrypi/raspberrypi.cpp | 15 ++++++++++++++-\n 1 file changed, 14 insertions(+), 1 deletion(-)","diff":"diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 3d1ac8fc..19669600 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -91,7 +91,8 @@ static const ControlInfoMap::Map ipaControls{\n \t{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },\n \t{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },\n \t{ &controls::FrameDurationLimits, ControlInfo(INT64_C(33333), INT64_C(120000)) },\n-\t{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }\n+\t{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) },\n+\t{ &controls::AfState, ControlInfo(controls::AfStateValues) },\n };\n \n LOG_DEFINE_CATEGORY(IPARPI)\n@@ -611,6 +612,10 @@ void IPARPi::reportMetadata()\n \t\t\tm[i] = ccmStatus->matrix[i];\n \t\tlibcameraMetadata_.set(controls::ColourCorrectionMatrix, m);\n \t}\n+\n+\tAfStatus *afStatus = rpiMetadata_.getLocked<AfStatus>(\"af.status\");\n+\tif (afStatus)\n+\t\tlibcameraMetadata_.set(controls::AfState, afStatus->state);\n }\n \n bool IPARPi::validateSensorControls()\n@@ -1170,6 +1175,14 @@ void IPARPi::processStats(unsigned int bufferId)\n \n \t\tsetDelayedControls.emit(ctrls);\n \t}\n+\n+\tstruct AfStatus afStatus;\n+\tif (rpiMetadata_.get(\"af.status\", afStatus) == 0) {\n+\t\tControlList lensCtrls(lensCtrls_);\n+\t\tlensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE,\n+\t\t\t      static_cast<int32_t>(afStatus.lensPosition));\n+\t\tsetLensControls.emit(lensCtrls);\n+\t}\n }\n \n void IPARPi::applyAWB(const struct AwbStatus *awbStatus, ControlList &ctrls)\n","prefixes":["libcamera-devel","4/5"]}