{"id":18156,"url":"https://patchwork.libcamera.org/api/patches/18156/?format=json","web_url":"https://patchwork.libcamera.org/patch/18156/","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":"<20230119104544.9456-9-naush@raspberrypi.com>","date":"2023-01-19T10:45:38","name":"[libcamera-devel,v1,08/14] ipa: raspberrypi: Include autofocus controls in the IPA ControlInfoMap","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"b51c3d13854282a288412033b47c30ed7733bf62","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18156/mbox/","series":[{"id":3715,"url":"https://patchwork.libcamera.org/api/series/3715/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3715","date":"2023-01-19T10:45:30","name":"Raspberry Pi: Camera Module 3 support","version":1,"mbox":"https://patchwork.libcamera.org/series/3715/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18156/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18156/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 06662C3296\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Jan 2023 10:46:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7684E625EE;\n\tThu, 19 Jan 2023 11:46:05 +0100 (CET)","from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com\n\t[IPv6:2a00:1450:4864:20::32b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B3FE625EF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Jan 2023 11:45:58 +0100 (CET)","by mail-wm1-x32b.google.com with SMTP id\n\tf25-20020a1c6a19000000b003da221fbf48so930970wmc.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Jan 2023 02:45:58 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tbe12-20020a05600c1e8c00b003db06224953sm5332029wmb.41.2023.01.19.02.45.56\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 19 Jan 2023 02:45:57 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674125165;\n\tbh=PcJOx2ozPgn+/h3v+0I2TaOSD5ltLOc0B5wmR8i/Xn8=;\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:Cc:\n\tFrom;\n\tb=ilxntvHUO5cM1NsXZTbgjQzjEiAiipOFT6nHdUsijzjdXwE0TMquhQzbEB3fkQaZF\n\tUB+w8MorTCbaLx7X5wecI+bF3B7M0f9xfuxxmTE0PXossMBEAiMb+8Lz8ABs2wWTzh\n\tTiaORhCwvYCRcn/Ymkso5Is/2YYPSDX1ln8+7bXWuFsrs/srsLvipAHKH1usA/GJfa\n\t4BW012DAGDHHI+8GSdeCTvzv6eTonZQQ/T2DLyRyn63PJAcoEjjpCvs9KCi9kDXBxq\n\t3j6oYF5/lwqPQaYySuIcvYss+lxokfyY5Jijuz2xj7hgSWLtX4R/NcCCiz7K6mx3Cb\n\t6AKwYJU0bARWg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=fcT0+/4kJR0MUVvFlrqUk7hrKyJnbDdSh57uN7PeygU=;\n\tb=H/zzEHaYwqm+peG4T6US9BXHmP8qdBPEJVKw6p2QyJLuUZmrqOLG7innUsne8KAJHU\n\tfFTNLw5D1wUyHdy1lx9eJBU5/iCnOT1WI2Dy7NVp+gYkSI8qAsWhL0GzaZhsDqoIioL3\n\ttj5B2xyy8pQWLoWezefWJEqdRckbgw51FTzA9Wq1UezFhjhSqMuaPge9dLfkCh6sEg8T\n\t3F4fbiRBRyX/FOaDFYW6SslVSQgibSRww4Tpipt+OUWI05t5JjoTRqrwb1y48FPtQTa0\n\tXiuW8EZ+zp8gxOswAgAL7SG2NYzAOTxRc327QyQDgxAvOp6ntl5uU8XC1jRyOGkrtzIg\n\tbnaA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"H/zzEHaY\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=fcT0+/4kJR0MUVvFlrqUk7hrKyJnbDdSh57uN7PeygU=;\n\tb=VjlwI24lVpqg9QRllJ+47xq6/lppZIeddpR4mxGIq5KEZUAb1ya/tUP/yfT2ZjLLs/\n\tELH1RzKOp/7CE5yv9F9d17++Zkk7EzWjqlEEUBfJWlq/Tp1g6oU4hIIYlRSYWvpVnI2r\n\tThbXC1ZoloPiqMIdMhn7a5NBUcEQIv8RqaiI57BKLlkSZLNG0aoreDTVijVQcmIb/KMu\n\t+pBuKuzJhkepivSEIQSvU1wawxWXj4Ues0b9RDeonlLYGPSGUEiwabbWGHcBRh+7Vytr\n\tJj4zt9734Mvnsw3X368fxZo3DgrJGj3cw1HceLSK2D6DOZId/qEUF6Iiz5xKljHTSnZo\n\tl/AA==","X-Gm-Message-State":"AFqh2kq5NBhtgv3Yam4FJwb04M2LAPlvGum3M4eZ6G+iJhicpPRXuo3s\n\tG6FDG22ZAIglfpJhPLot5uci/ZgX/ev1u29uP2U=","X-Google-Smtp-Source":"AMrXdXtic4aifSALl+aHsUN+8Bb3pCoHp745bh2BdTcz6wcDtyavpOyEdwn81XoQLDxyZPuE3YzzUQ==","X-Received":"by 2002:a05:600c:4d08:b0:3da:fef0:226b with SMTP id\n\tu8-20020a05600c4d0800b003dafef0226bmr9911553wmp.32.1674125157569; \n\tThu, 19 Jan 2023 02:45:57 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 19 Jan 2023 10:45:38 +0000","Message-Id":"<20230119104544.9456-9-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20230119104544.9456-1-naush@raspberrypi.com>","References":"<20230119104544.9456-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v1 08/14] ipa: raspberrypi: Include\n\tautofocus controls in the IPA ControlInfoMap","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add all the autofocus controls handled by the IPA into the ControlInfoMap if\na controllable lens actuator is present.\n\nSigned-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/raspberrypi.cpp | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)","diff":"diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 18549420445b..745c16f354ce 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -97,6 +97,18 @@ static const ControlInfoMap::Map ipaControls{\n \t{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }\n };\n \n+/* IPA controls handled conditionally, if the lens has a focus control */\n+static const ControlInfoMap::Map ipaAfControls{\n+\t{ &controls::AfMode, ControlInfo(controls::AfModeValues) },\n+\t{ &controls::AfRange, ControlInfo(controls::AfRangeValues) },\n+\t{ &controls::AfSpeed, ControlInfo(controls::AfSpeedValues) },\n+\t{ &controls::AfMetering, ControlInfo(controls::AfMeteringValues) },\n+\t{ &controls::AfWindows, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },\n+\t{ &controls::AfTrigger, ControlInfo(controls::AfTriggerValues) },\n+\t{ &controls::AfPause, ControlInfo(controls::AfPauseValues) },\n+\t{ &controls::LensPosition, ControlInfo(0.0f, 32.0f, 1.0f) }\n+};\n+\n LOG_DEFINE_CATEGORY(IPARPI)\n \n namespace ipa::RPi {\n@@ -248,6 +260,8 @@ int IPARPi::init(const IPASettings &settings, bool lensPresent, IPAInitResult *r\n \n \t/* Return the controls handled by the IPA */\n \tControlInfoMap::Map ctrlMap = ipaControls;\n+\tif (lensPresent_)\n+\t\tctrlMap.merge(ControlInfoMap::Map(ipaAfControls));\n \tresult->controlInfo = ControlInfoMap(std::move(ctrlMap), controls::controls);\n \n \treturn 0;\n@@ -489,6 +503,10 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo, const IPAConfig &ip\n \t\tControlInfo(static_cast<int32_t>(helper_->exposure(exposureMin, mode_.minLineLength).get<std::micro>()),\n \t\t\t    static_cast<int32_t>(maxShutter.get<std::micro>()));\n \n+\t/* Declare Autofocus controls, only if we have a controllable lens */\n+\tif (lensPresent_)\n+\t\tctrlMap.merge(ControlInfoMap::Map(ipaAfControls));\n+\n \tresult->controlInfo = ControlInfoMap(std::move(ctrlMap), controls::controls);\n \treturn 0;\n }\n","prefixes":["libcamera-devel","v1","08/14"]}