[{"id":22286,"web_url":"https://patchwork.libcamera.org/comment/22286/","msgid":"<164742549014.11309.6874768269642866604@Monstersaurus>","date":"2022-03-16T10:11:30","subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: raspberrypi: Control\n\tthe lens from pipeline","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"Quoting Jean-Michel Hautbois via libcamera-devel (2022-03-16 09:39:50)\n> The lens focus is controled by a VCM, which is linked to the sensor\n> using the ancillary links.\n> Pass the control to the config info structure and make it possible to\n> update by the IPA.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  include/libcamera/ipa/raspberrypi.mojom           |  1 +\n>  .../pipeline/raspberrypi/raspberrypi.cpp          | 15 +++++++++++++++\n>  2 files changed, 16 insertions(+)\n> \n> diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\n> index acd3cafe..0c3922b0 100644\n> --- a/include/libcamera/ipa/raspberrypi.mojom\n> +++ b/include/libcamera/ipa/raspberrypi.mojom\n> @@ -125,4 +125,5 @@ interface IPARPiEventInterface {\n>         embeddedComplete(uint32 bufferId);\n>         setIspControls(libcamera.ControlList controls);\n>         setDelayedControls(libcamera.ControlList controls);\n> +       setLensControls(libcamera.ControlList controls);\n>  };\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index c2230199..67a98daa 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -33,6 +33,7 @@\n>  \n>  #include \"libcamera/internal/bayer_format.h\"\n>  #include \"libcamera/internal/camera.h\"\n> +#include \"libcamera/internal/camera_lens.h\"\n>  #include \"libcamera/internal/camera_sensor.h\"\n>  #include \"libcamera/internal/delayed_controls.h\"\n>  #include \"libcamera/internal/device_enumerator.h\"\n> @@ -202,6 +203,7 @@ public:\n>         void setIspControls(const ControlList &controls);\n>         void setDelayedControls(const ControlList &controls);\n>         void setSensorControls(ControlList &controls);\n> +       void setLensControls(const ControlList &controls);\n>  \n>         /* bufferComplete signal handlers. */\n>         void unicamBufferDequeue(FrameBuffer *buffer);\n> @@ -1483,6 +1485,7 @@ int RPiCameraData::loadIPA(ipa::RPi::SensorConfig *sensorConfig)\n>         ipa_->embeddedComplete.connect(this, &RPiCameraData::embeddedComplete);\n>         ipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);\n>         ipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);\n> +       ipa_->setLensControls.connect(this, &RPiCameraData::setLensControls);\n>  \n>         /*\n>          * The configuration (tuning file) is made from the sensor name unless\n> @@ -1519,6 +1522,10 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n>         entityControls.emplace(0, sensor_->controls());\n>         entityControls.emplace(1, isp_[Isp::Input].dev()->controls());\n>  \n> +       CameraLens *lens = sensor_->focusLens();\n> +       if (lens)\n> +               entityControls.emplace(2, lens->controls());\n\nWhat's 2 here, I suspect it's maybe something related to context that\nisn't shown in the diff - but it's not clear here.\n\n\n> +\n>         /* Always send the user transform to the IPA. */\n>         ipaConfig.transform = static_cast<unsigned int>(config->transform);\n>  \n> @@ -1735,6 +1742,14 @@ void RPiCameraData::setDelayedControls(const ControlList &controls)\n>         handleState();\n>  }\n>  \n> +void RPiCameraData::setLensControls(const ControlList &controls)\n> +{\n> +       ControlList ctrls = controls;\n> +\n> +       sensor_->focusLens()->setFocusPosition(ctrls.get(V4L2_CID_FOCUS_ABSOLUTE).get<int32_t>());\n\nDoesn't this need to be guarded by an if (lens)?\n\n> +       handleState();\n> +}\n> +\n>  void RPiCameraData::setSensorControls(ControlList &controls)\n>  {\n>         /*\n> -- \n> 2.32.0\n>","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 EB59FBDE17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 16 Mar 2022 10:11:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4CCA6604E9;\n\tWed, 16 Mar 2022 11:11:34 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CBC08601F5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 16 Mar 2022 11:11:32 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 533D8A67;\n\tWed, 16 Mar 2022 11:11:32 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1647425494;\n\tbh=WWUj2vhVsCu4jzFi000PTfmJClgEfLjUKgm5g/kg9nY=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=tX7J5FLVW8EMP6lcA8V9pdq/oo9Zk1LY+w8yWm/KvNMUZK41MFDfWc6anpxw/XFch\n\tS3DrymteaevcTPcjEpyyaaRWVM6Lf/JX2Lzikm3A1ROCaKKJpmni/qoV1m2Ywt2wFa\n\tokU2zpqcqvz9JP/h96QRvO+/zfU0vBIB8+j45KqFJvQhHhPrm7Mq6DWTc+TkDcLmib\n\tfT7lZnkWUWkY0i+eOcquNQXYFryJqLNVAsn2Fr8mkxeQDET/DiYQCr1zJnwTJK+ukD\n\tW710w5tz2Qp0bcF9VvgnoZYwN0GiR9ZoSfSJ6dGfuuREJW//a2A+ZmQMyb0fX+SitU\n\tgbY7EFiGYRcJg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1647425492;\n\tbh=WWUj2vhVsCu4jzFi000PTfmJClgEfLjUKgm5g/kg9nY=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=wHPeusFO9KKkLrwD8cZ+i5YIDj6Jwy/LoRbwMIgpr8k57BP/hQCktaUeoYEr1JrKw\n\tH2V7VbuKquIQCZ4LIyN5AWfuMoA5JwAlyd5OZmhWOkCKVrwIeKK17lLqhs9Bf1XXeI\n\tg9WJxp6mpAAt53N4aVq8K9AlWOL3XVbtAwStKPtk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"wHPeusFO\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220316093951.33779-1-jeanmichel.hautbois@ideasonboard.com>","References":"<20220316093951.33779-1-jeanmichel.hautbois@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 16 Mar 2022 10:11:30 +0000","Message-ID":"<164742549014.11309.6874768269642866604@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: raspberrypi: Control\n\tthe lens from pipeline","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22287,"web_url":"https://patchwork.libcamera.org/comment/22287/","msgid":"<aafe57de-7e62-9353-84a2-4083ff35570d@ideasonboard.com>","date":"2022-03-16T10:14:04","subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: raspberrypi: Control\n\tthe lens from pipeline","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"On 16/03/2022 11:11, Kieran Bingham wrote:\n> Quoting Jean-Michel Hautbois via libcamera-devel (2022-03-16 09:39:50)\n>> The lens focus is controled by a VCM, which is linked to the sensor\n>> using the ancillary links.\n>> Pass the control to the config info structure and make it possible to\n>> update by the IPA.\n>>\n>> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n>> ---\n>>   include/libcamera/ipa/raspberrypi.mojom           |  1 +\n>>   .../pipeline/raspberrypi/raspberrypi.cpp          | 15 +++++++++++++++\n>>   2 files changed, 16 insertions(+)\n>>\n>> diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\n>> index acd3cafe..0c3922b0 100644\n>> --- a/include/libcamera/ipa/raspberrypi.mojom\n>> +++ b/include/libcamera/ipa/raspberrypi.mojom\n>> @@ -125,4 +125,5 @@ interface IPARPiEventInterface {\n>>          embeddedComplete(uint32 bufferId);\n>>          setIspControls(libcamera.ControlList controls);\n>>          setDelayedControls(libcamera.ControlList controls);\n>> +       setLensControls(libcamera.ControlList controls);\n>>   };\n>> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n>> index c2230199..67a98daa 100644\n>> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n>> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n>> @@ -33,6 +33,7 @@\n>>   \n>>   #include \"libcamera/internal/bayer_format.h\"\n>>   #include \"libcamera/internal/camera.h\"\n>> +#include \"libcamera/internal/camera_lens.h\"\n>>   #include \"libcamera/internal/camera_sensor.h\"\n>>   #include \"libcamera/internal/delayed_controls.h\"\n>>   #include \"libcamera/internal/device_enumerator.h\"\n>> @@ -202,6 +203,7 @@ public:\n>>          void setIspControls(const ControlList &controls);\n>>          void setDelayedControls(const ControlList &controls);\n>>          void setSensorControls(ControlList &controls);\n>> +       void setLensControls(const ControlList &controls);\n>>   \n>>          /* bufferComplete signal handlers. */\n>>          void unicamBufferDequeue(FrameBuffer *buffer);\n>> @@ -1483,6 +1485,7 @@ int RPiCameraData::loadIPA(ipa::RPi::SensorConfig *sensorConfig)\n>>          ipa_->embeddedComplete.connect(this, &RPiCameraData::embeddedComplete);\n>>          ipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);\n>>          ipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);\n>> +       ipa_->setLensControls.connect(this, &RPiCameraData::setLensControls);\n>>   \n>>          /*\n>>           * The configuration (tuning file) is made from the sensor name unless\n>> @@ -1519,6 +1522,10 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n>>          entityControls.emplace(0, sensor_->controls());\n>>          entityControls.emplace(1, isp_[Isp::Input].dev()->controls());\n>>   \n>> +       CameraLens *lens = sensor_->focusLens();\n>> +       if (lens)\n>> +               entityControls.emplace(2, lens->controls());\n> \n> What's 2 here, I suspect it's maybe something related to context that\n> isn't shown in the diff - but it's not clear here.\n\nIt is after 1 :-) ?\nMore seriously, the first controls are emplaced into entityControls at 0 \nand 1. So, we add another one.\n\n> \n> \n>> +\n>>          /* Always send the user transform to the IPA. */\n>>          ipaConfig.transform = static_cast<unsigned int>(config->transform);\n>>   \n>> @@ -1735,6 +1742,14 @@ void RPiCameraData::setDelayedControls(const ControlList &controls)\n>>          handleState();\n>>   }\n>>   \n>> +void RPiCameraData::setLensControls(const ControlList &controls)\n>> +{\n>> +       ControlList ctrls = controls;\n>> +\n>> +       sensor_->focusLens()->setFocusPosition(ctrls.get(V4L2_CID_FOCUS_ABSOLUTE).get<int32_t>());\n> \n> Doesn't this need to be guarded by an if (lens)?\n\nMmmh, probably yes, will do the change, thanks !\n\n> \n>> +       handleState();\n>> +}\n>> +\n>>   void RPiCameraData::setSensorControls(ControlList &controls)\n>>   {\n>>          /*\n>> -- \n>> 2.32.0\n>>","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 E3611BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 16 Mar 2022 10:14:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3315F604E9;\n\tWed, 16 Mar 2022 11:14:08 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DBEA6601F5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 16 Mar 2022 11:14:06 +0100 (CET)","from [IPV6:2a01:e0a:169:7140:3036:4976:879c:5c94] (unknown\n\t[IPv6:2a01:e0a:169:7140:3036:4976:879c:5c94])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6B74CA67;\n\tWed, 16 Mar 2022 11:14:06 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1647425648;\n\tbh=O8NW95Rw4t/KCqaqiB8Y+3SnhGlQV4zGzt120dPKXa8=;\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:\n\tFrom;\n\tb=pwoRfi0csQ4R0on6Hk4sF//PpZGpO4ZVeG59jwcdtBz5qQy0HRl8XcDLu+3tFuumO\n\tWZ+VBDJdmR6q0sxM5hYqNVg6eVwM8L8n8/Fmy4KG+MVQ0vCI80q+zuxTloNzsWXN7q\n\tURunNUsrl4MeuhH2niZyn3CSQjef4oP2/RyBINpgRfiZpdgxFHu76IO9ZAWQnYX1UK\n\tD5uac3XwvXB4SNrfug2ss4uSJqaej1ZzFKfnMDHhr3VzGhqV3XPJM2U41k/HWLpeON\n\t7/jPUkAT3h51ucIRskJka72SYdPGLl3NU78OvUdN63f56ZV2VAADj8jTgajNslOD0S\n\tFRhuagiVcnUCw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1647425646;\n\tbh=O8NW95Rw4t/KCqaqiB8Y+3SnhGlQV4zGzt120dPKXa8=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=Tvhr9e3urxkNcJUKw/cSvLNMtuHYZqdz5BL2+/YQ60AR+P8xiClnx83MtpqDH0aoZ\n\tnGoz75tCNJ4u4jAy37eGPJlSX/vNscy/GluP4obgHWddaEPIkAcpBVJsrSTShZeKk5\n\ts0aE2cNh+gQA/Sv+yifOifVxIsDAoRsRxqhbLHCo="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Tvhr9e3u\"; dkim-atps=neutral","Message-ID":"<aafe57de-7e62-9353-84a2-4083ff35570d@ideasonboard.com>","Date":"Wed, 16 Mar 2022 11:14:04 +0100","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.5.0","Content-Language":"en-US","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220316093951.33779-1-jeanmichel.hautbois@ideasonboard.com>\n\t<164742549014.11309.6874768269642866604@Monstersaurus>","In-Reply-To":"<164742549014.11309.6874768269642866604@Monstersaurus>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: raspberrypi: Control\n\tthe lens from pipeline","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":"Jean-Michel Hautbois via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22306,"web_url":"https://patchwork.libcamera.org/comment/22306/","msgid":"<CAEmqJPpE3L6uPqWYQWQoCxXBPPbHqyq6+fpY2LAAeB5tzAFLmA@mail.gmail.com>","date":"2022-03-17T10:19:45","subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: raspberrypi: Control\n\tthe lens from pipeline","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"Hi Jean-Michel,\n\nThank you for your patch.\n\nOn Wed, 16 Mar 2022 at 09:39, Jean-Michel Hautbois via libcamera-devel <\nlibcamera-devel@lists.libcamera.org> wrote:\n\n> The lens focus is controled by a VCM, which is linked to the sensor\n> using the ancillary links.\n> Pass the control to the config info structure and make it possible to\n> update by the IPA.\n>\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  include/libcamera/ipa/raspberrypi.mojom           |  1 +\n>  .../pipeline/raspberrypi/raspberrypi.cpp          | 15 +++++++++++++++\n>  2 files changed, 16 insertions(+)\n>\n> diff --git a/include/libcamera/ipa/raspberrypi.mojom\n> b/include/libcamera/ipa/raspberrypi.mojom\n> index acd3cafe..0c3922b0 100644\n> --- a/include/libcamera/ipa/raspberrypi.mojom\n> +++ b/include/libcamera/ipa/raspberrypi.mojom\n> @@ -125,4 +125,5 @@ interface IPARPiEventInterface {\n>         embeddedComplete(uint32 bufferId);\n>         setIspControls(libcamera.ControlList controls);\n>         setDelayedControls(libcamera.ControlList controls);\n> +       setLensControls(libcamera.ControlList controls);\n>  };\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index c2230199..67a98daa 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -33,6 +33,7 @@\n>\n>  #include \"libcamera/internal/bayer_format.h\"\n>  #include \"libcamera/internal/camera.h\"\n> +#include \"libcamera/internal/camera_lens.h\"\n>  #include \"libcamera/internal/camera_sensor.h\"\n>  #include \"libcamera/internal/delayed_controls.h\"\n>  #include \"libcamera/internal/device_enumerator.h\"\n> @@ -202,6 +203,7 @@ public:\n>         void setIspControls(const ControlList &controls);\n>         void setDelayedControls(const ControlList &controls);\n>         void setSensorControls(ControlList &controls);\n> +       void setLensControls(const ControlList &controls);\n>\n>         /* bufferComplete signal handlers. */\n>         void unicamBufferDequeue(FrameBuffer *buffer);\n> @@ -1483,6 +1485,7 @@ int RPiCameraData::loadIPA(ipa::RPi::SensorConfig\n> *sensorConfig)\n>         ipa_->embeddedComplete.connect(this,\n> &RPiCameraData::embeddedComplete);\n>         ipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);\n>         ipa_->setDelayedControls.connect(this,\n> &RPiCameraData::setDelayedControls);\n> +       ipa_->setLensControls.connect(this,\n> &RPiCameraData::setLensControls);\n>\n>         /*\n>          * The configuration (tuning file) is made from the sensor name\n> unless\n> @@ -1519,6 +1522,10 @@ int RPiCameraData::configureIPA(const\n> CameraConfiguration *config)\n>         entityControls.emplace(0, sensor_->controls());\n>         entityControls.emplace(1, isp_[Isp::Input].dev()->controls());\n>\n> +       CameraLens *lens = sensor_->focusLens();\n> +       if (lens)\n> +               entityControls.emplace(2, lens->controls());\n> +\n>         /* Always send the user transform to the IPA. */\n>         ipaConfig.transform = static_cast<unsigned int>(config->transform);\n>\n> @@ -1735,6 +1742,14 @@ void RPiCameraData::setDelayedControls(const\n> ControlList &controls)\n>         handleState();\n>  }\n>\n> +void RPiCameraData::setLensControls(const ControlList &controls)\n> +{\n> +       ControlList ctrls = controls;\n> +\n> +\n>  sensor_->focusLens()->setFocusPosition(ctrls.get(V4L2_CID_FOCUS_ABSOLUTE).get<int32_t>());\n> +       handleState();\n> +}\n>\n\nDo you need an if (lens_) test before the setFocusPosition()?\nThe call to handleState() is not necessary here, I would remove it.\n\nRegards,\nNaush\n\n\n\n> +\n>  void RPiCameraData::setSensorControls(ControlList &controls)\n>  {\n>         /*\n> --\n> 2.32.0\n>\n>","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 CB607BDE17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 17 Mar 2022 10:20:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 22FD7604DB;\n\tThu, 17 Mar 2022 11:20:04 +0100 (CET)","from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com\n\t[IPv6:2a00:1450:4864:20::22f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 98592604DB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 17 Mar 2022 11:20:02 +0100 (CET)","by mail-lj1-x22f.google.com with SMTP id bx44so68225ljb.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 17 Mar 2022 03:20:02 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1647512404;\n\tbh=CEoPalfvGG4mqaGTjaKqBCAqbzLlIHyNea3slbH3Gmw=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=uZC66p4LkXLRRq0wAFZi53Bn0Az6wRaNW7OXf5IjIBhz6NcbPI+n37B1RFz+wEz0C\n\trS+iqgurgIq6YWWEDbw0Xa2qREzU+BD/Yjt46XFPihT9gw935bjiKFSX7g5FztC785\n\tfxEKdph4PRjqlX9mJ4zC2NELL2LFcF7pUvm3otUJ+Qo1xx3pUR/PaKdsUdL8kKnwvA\n\tPnvzUhkOBaia2Ty6Fyg+h71pPM9MWDY4yFLlbP49oAmI1+nhgWU2R/1BX4qqskzNoU\n\tI8LQ7SxXD9J/EVyQcWEgTX8gTRTKA6KpaARJXFM0o3J6gsP7TjF/mxAg0hsprmJHzK\n\t6YgvsduAOeiqA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=DV0luJ8Nfs3NO2HHb/VRNnCxMbDZ2KTexaTntFsdGHI=;\n\tb=laPgdfjO94JNxq1SanKRRtr4jd6TfnVYX8GF9IrtLhU2156nJ2aODUyQos5sxOkHbM\n\t03NB7fUdWN9aOcG3xaV/Vu+wwf1uxBfZcr7EgjntSGCgN8k6nU1xXJn0m8mYcx97Nny1\n\thQ+dHkNKKoQX56qno3PXXr6OBnjBfWbSOBvIp8kshA7CnJeqQkyd1ZzMfb1UcaSN4G6e\n\tfn3d2Vrp8XXXIqtohDQ5plo+GST57yNN6EWDLRnIiY4bCFx4ry3JBLWupB+uEw2nikeH\n\tkfxE55intfP+e060D8579pvqn6sBrXpnY6DD0Hup0hpEEYkPtGiNa/1KK80WX+e0Ijz9\n\tvaSA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"laPgdfjO\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=DV0luJ8Nfs3NO2HHb/VRNnCxMbDZ2KTexaTntFsdGHI=;\n\tb=uaJz+JCjY1uOoToag32SIU4fKMlA2VtyJ87+bXZdY5H/eJlnv/V3gP2jhXrRFCWtlK\n\tx48HbxXYQrisPFcJi9bTicwWfkfjJJG1F4y5kFhQ9G7G7YhNqFTMCGcuvkekFhnJfkp7\n\tblNcuPGeYhdtVbIHh3rU52TBanf+U49BLMCfz5w5qOQNfi/bqenllyQCY8FMOZbvyR6O\n\tXbwP3kH0aEAiZnlE/oNmVW81yOXfWwN8RxMd5RC7MJFmAKjLPHyN4h4+N4k/c82bnmQB\n\tV6t3u5G23nNsgRDPjWUAF8RoKXq7ODcjmDpGInI05N7ueLR0y562CuVVjhTA1M8drrnL\n\tIi6g==","X-Gm-Message-State":"AOAM530tQnb1oNbD+xpn0JMNeOsEIvPS2LODAvz8b2uYSybESNpVCzMs\n\tefXylMAaPRV4c2E+KVIVUZ/xzGVGO2y2NEzDHuDPVz4oweTkvA==","X-Google-Smtp-Source":"ABdhPJxMuMgv71d1byRc+PtLz615awMs2pjf34cf6w7akP18lxsYdvp6c8lytHxgmuqMWD2LECqcx0HO90ZUl3dO7v0=","X-Received":"by 2002:a2e:8255:0:b0:247:dff4:1f with SMTP id\n\tj21-20020a2e8255000000b00247dff4001fmr2492792ljh.16.1647512401782; \n\tThu, 17 Mar 2022 03:20:01 -0700 (PDT)","MIME-Version":"1.0","References":"<20220316093951.33779-1-jeanmichel.hautbois@ideasonboard.com>","In-Reply-To":"<20220316093951.33779-1-jeanmichel.hautbois@ideasonboard.com>","Date":"Thu, 17 Mar 2022 10:19:45 +0000","Message-ID":"<CAEmqJPpE3L6uPqWYQWQoCxXBPPbHqyq6+fpY2LAAeB5tzAFLmA@mail.gmail.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"00000000000078c1bc05da675f53\"","Subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: raspberrypi: Control\n\tthe lens from pipeline","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":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]