{"id":18180,"url":"https://patchwork.libcamera.org/api/patches/18180/?format=json","web_url":"https://patchwork.libcamera.org/patch/18180/","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":"<20230123154934.27803-6-naush@raspberrypi.com>","date":"2023-01-23T15:49:25","name":"[libcamera-devel,v2,05/14] ipa: mojom: raspberrypi: Add setLensControls() function","commit_ref":"6290deea027936f13c4424efb27a8615ac38c97b","pull_url":null,"state":"accepted","archived":false,"hash":"d4c3978af07987605a05d2ffa2bf98c544e2b7c4","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/18180/mbox/","series":[{"id":3719,"url":"https://patchwork.libcamera.org/api/series/3719/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3719","date":"2023-01-23T15:49:20","name":"Raspberry Pi: Camera Module 3 support","version":2,"mbox":"https://patchwork.libcamera.org/series/3719/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18180/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18180/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 28FDABEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 23 Jan 2023 15:49:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BE556625F1;\n\tMon, 23 Jan 2023 16:49:54 +0100 (CET)","from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com\n\t[IPv6:2a00:1450:4864:20::32c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F115625D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Jan 2023 16:49:51 +0100 (CET)","by mail-wm1-x32c.google.com with SMTP id\n\tfl11-20020a05600c0b8b00b003daf72fc844so10952987wmb.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Jan 2023 07:49:51 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tn16-20020a05600c181000b003d1de805de5sm10339689wmp.16.2023.01.23.07.49.50\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 23 Jan 2023 07:49:50 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674488994;\n\tbh=nrqFYopn5EitpyaiZsHGEphiMjIcZmS2iJQTy0OrNjo=;\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=RvU65ru4SHvivYkpLQRpiY4d36IdNT0bz5tFKELEmzrNBHWrzX8HBwjXrxB1xgkIu\n\te0zi/XjVujPjSgYbpi4TlttleubOtblaMNjdY4Mr5HgUdJ6T/L0K5TfWAOkttYVgAF\n\tlGUVSKUfu7OGn03zM7JZq7+wizTQaMVOmrI0XnkvCItnbVrOMOdxrInNTnejM3ug10\n\tbA6i1NXMaA+JJFNADTb+Psw64T6N/oKFZ39+TtlO1eS0E5aYmNH5DLFcoCjVrbcWxC\n\tAh2PBvXK53OR/0DRaZIFAqnlARspui+IfCt3f31bMgroB2qsFyGQdCK5QwiHLgsP++\n\t+tSCN9E5PN3eQ==","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=FdgUpNeuXRgy7Jb4386K7B9G95evIDYxvmfu/ug4LlQ=;\n\tb=FwikU4amUmCwyROGIqpb1hzzBF1SYv/HX9J/1JmsbhPzKOEyJ6jEzaw36GEB6qtEfH\n\tv15M+WCV9OhSkhh0ZPOZAasIU9XNke8W4B0+ffJIdgmzXxEZKGrCnX5lx/DUvz7SVxOI\n\tSf2tb0ZCWkNMUzFoN6y7rdvscAaPSMESiGll2dKe8/TwHiUZTwbRTJO4NQH3628EjjBh\n\ti4/PkO0jZzp6+E2WOBTvoskfXaqFIZH/izWvDfErmz7Q5bhi6/91p8GLNA1Q2sdlxv9O\n\tQ9w8ugaUo0V2nKMnFkJkp/zoQZSjJgEx8oVQOTvwROcIEw/+liuO9LLVwDK9yxHVEQ1O\n\txkQA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"FwikU4am\"; 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=FdgUpNeuXRgy7Jb4386K7B9G95evIDYxvmfu/ug4LlQ=;\n\tb=UuCJS7LDgidbVYnUCI5lRa7jgG3pOV/UD+VTgaDdDu0Ov4CppD2RELgjZXk3N9ybhA\n\ttpS/to+YUta8qUKs2lsswiUDCTv4tGbB5YUdndDcrz5jObEgmrNJduj3wF3VwkVjDjT7\n\tw+pIIXceKnZZmG/H+oKaza2zdwrt6Ppvzm/Pb9LK+OY1T08UAzBLIqrgBj7WvfVF2Ehm\n\t5bfWu6tVYBgYtWOsfpn3JTDLD9xAU+SVxRWFSZU2AjgBtHKRI3XPJndtiHEgP+jUX212\n\tSc/XqvFUPHSTp4iBasbAL5ofKU7FKe3SLwsMujiUxmSkz8vG2EQe1m9nL4wra6odjZUL\n\tlqdQ==","X-Gm-Message-State":"AFqh2kopab6WqmHtvSvl96C9cLdNOi2adc6mb1eVFigept7/G/WkdNSv\n\tbxwK+KcazmczUNA1rOzz/ClFLP4BEGTRpH3d3mM=","X-Google-Smtp-Source":"AMrXdXu4mNluacxYqVC0XfGICKEs0RfeLsMlKKpupAGq6lCat+0ZppVw5eFKoWAMNR8L00EnEXadoQ==","X-Received":"by 2002:a05:600c:1613:b0:3d0:2485:c046 with SMTP id\n\tm19-20020a05600c161300b003d02485c046mr24168597wmn.27.1674488990630; \n\tMon, 23 Jan 2023 07:49:50 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 23 Jan 2023 15:49:25 +0000","Message-Id":"<20230123154934.27803-6-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20230123154934.27803-1-naush@raspberrypi.com>","References":"<20230123154934.27803-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 05/14] ipa: mojom: raspberrypi: Add\n\tsetLensControls() function","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":"From: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>\n\nAdd a setLensControls() function to the IPA/pipeline handler interface. This\nwill be used in a future commit to control the lens actuator position from an\nautofocus algorithm.\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 include/libcamera/ipa/raspberrypi.mojom            |  1 +\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 12 ++++++++++++\n 2 files changed, 13 insertions(+)","diff":"diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nindex bfacd1275bfb..8e78f167f179 100644\n--- a/include/libcamera/ipa/raspberrypi.mojom\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -131,4 +131,5 @@ interface IPARPiEventInterface {\n \tembeddedComplete(uint32 bufferId);\n \tsetIspControls(libcamera.ControlList controls);\n \tsetDelayedControls(libcamera.ControlList controls, uint32 delayContext);\n+\tsetLensControls(libcamera.ControlList controls);\n };\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex b0f4930c6f1b..d1fd93292652 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -208,6 +208,7 @@ public:\n \tvoid embeddedComplete(uint32_t bufferId);\n \tvoid setIspControls(const ControlList &controls);\n \tvoid setDelayedControls(const ControlList &controls, uint32_t delayContext);\n+\tvoid setLensControls(const ControlList &controls);\n \tvoid setSensorControls(ControlList &controls);\n \tvoid unicamTimeout();\n \n@@ -1589,6 +1590,7 @@ int RPiCameraData::loadIPA(ipa::RPi::IPAInitResult *result)\n \tipa_->embeddedComplete.connect(this, &RPiCameraData::embeddedComplete);\n \tipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);\n \tipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);\n+\tipa_->setLensControls.connect(this, &RPiCameraData::setLensControls);\n \n \t/*\n \t * The configuration (tuning file) is made from the sensor name unless\n@@ -1836,6 +1838,16 @@ void RPiCameraData::setDelayedControls(const ControlList &controls, uint32_t del\n \thandleState();\n }\n \n+void RPiCameraData::setLensControls(const ControlList &controls)\n+{\n+\tCameraLens *lens = sensor_->focusLens();\n+\n+\tif (lens && controls.contains(V4L2_CID_FOCUS_ABSOLUTE)) {\n+\t\tControlValue const &focusValue = controls.get(V4L2_CID_FOCUS_ABSOLUTE);\n+\t\tlens->setFocusPosition(focusValue.get<int32_t>());\n+\t}\n+}\n+\n void RPiCameraData::setSensorControls(ControlList &controls)\n {\n \t/*\n","prefixes":["libcamera-devel","v2","05/14"]}