[{"id":21301,"web_url":"https://patchwork.libcamera.org/comment/21301/","msgid":"<YaQBSzIbGmIvnIZD@pendragon.ideasonboard.com>","date":"2021-11-28T22:23:07","subject":"Re: [libcamera-devel] [PATCH 4/5] ipa: ipu3: Send lens controls to\n\tpipeline handler","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Daniel,\n\nThank you for the patch.\n\nOn Fri, Nov 26, 2021 at 12:31:17AM +0000, Daniel Scally wrote:\n> Pick up the focus value from the AF algorithm and send lens controls\n> along in the frame context.\n> \n> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n> ---\n>  src/ipa/ipu3/ipu3.cpp | 4 ++++\n>  1 file changed, 4 insertions(+)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 6c76193a..abdcd69d 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -173,6 +173,7 @@ private:\n>  \tuint32_t gain_;\n>  \tuint32_t minGain_;\n>  \tuint32_t maxGain_;\n> +\tuint32_t focus_;\n\nDo we need this ?\n\n>  \n>  \tutils::Duration lineDuration_;\n>  \n> @@ -671,6 +672,9 @@ void IPAIPU3::setControls(unsigned int frame)\n>  \tctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));\n>  \top.sensorControls = ctrls;\n>  \n> +\tfocus_ = context_.frameContext.af.focus;\n> +\top.lensControls.set(V4L2_CID_FOCUS_ABSOLUTE, static_cast<int32_t>(focus_));\n\nI think you need to create a ControlList first, like for the sensor\ncontrols.\n\n> +\n>  \tqueueFrameAction.emit(frame, op);\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 AC022BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Nov 2021 22:23:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E12356058C;\n\tSun, 28 Nov 2021 23:23:33 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C622604FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Nov 2021 23:23:32 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 96BF8F1;\n\tSun, 28 Nov 2021 23:23:31 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"H13JvA//\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638138211;\n\tbh=EdHl/ZMdLeShDFNLw2iu6YtFsfdHHgYwQw39fwxKOSQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=H13JvA//K/D+E9s8s8RfsFAC18fnIFQDTrx5FE0dM45fK0TGpUpO0bR0NP/iRQxgS\n\t5OPRWYeJTyyYhwGxvUoP6AGq/6GmnlngdlspT67+1a3UORtdCO97ozQQu+LffINBBa\n\tvuCFm+Y/GU8ubZf1kCPJja479Mg3XUQ3KG/1g92Q=","Date":"Mon, 29 Nov 2021 00:23:07 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<YaQBSzIbGmIvnIZD@pendragon.ideasonboard.com>","References":"<20211126003118.42356-1-djrscally@gmail.com>\n\t<20211126003118.42356-5-djrscally@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211126003118.42356-5-djrscally@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 4/5] ipa: ipu3: Send lens controls to\n\tpipeline handler","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21574,"web_url":"https://patchwork.libcamera.org/comment/21574/","msgid":"<2bb1dcd5-24b4-3c3d-7f8f-c16b73b0238d@gmail.com>","date":"2021-12-03T12:16:04","subject":"Re: [libcamera-devel] [PATCH 4/5] ipa: ipu3: Send lens controls to\n\tpipeline handler","submitter":{"id":90,"url":"https://patchwork.libcamera.org/api/people/90/","name":"Daniel Scally","email":"djrscally@gmail.com"},"content":"Hi Laurent\n\nOn 28/11/2021 22:23, Laurent Pinchart wrote:\n> Hi Daniel,\n>\n> Thank you for the patch.\n>\n> On Fri, Nov 26, 2021 at 12:31:17AM +0000, Daniel Scally wrote:\n>> Pick up the focus value from the AF algorithm and send lens controls\n>> along in the frame context.\n>>\n>> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n>> ---\n>>  src/ipa/ipu3/ipu3.cpp | 4 ++++\n>>  1 file changed, 4 insertions(+)\n>>\n>> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n>> index 6c76193a..abdcd69d 100644\n>> --- a/src/ipa/ipu3/ipu3.cpp\n>> +++ b/src/ipa/ipu3/ipu3.cpp\n>> @@ -173,6 +173,7 @@ private:\n>>  \tuint32_t gain_;\n>>  \tuint32_t minGain_;\n>>  \tuint32_t maxGain_;\n>> +\tuint32_t focus_;\n> Do we need this ?\n\n\nNo more than exposure_ or gain_...I included it mostly for consistency.\nIt could become a variable in setControls() (it's useful to have there\nto shorten the lines), but I think exposure_ and gain_ could too in that\ncase.\n\n\n>>  \n>>  \tutils::Duration lineDuration_;\n>>  \n>> @@ -671,6 +672,9 @@ void IPAIPU3::setControls(unsigned int frame)\n>>  \tctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));\n>>  \top.sensorControls = ctrls;\n>>  \n>> +\tfocus_ = context_.frameContext.af.focus;\n>> +\top.lensControls.set(V4L2_CID_FOCUS_ABSOLUTE, static_cast<int32_t>(focus_));\n> I think you need to create a ControlList first, like for the sensor\n> controls.\n\n\nAck; done now.\n\n>\n>> +\n>>  \tqueueFrameAction.emit(frame, op);\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 9FB12BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Dec 2021 12:16:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0E4BF607DE;\n\tFri,  3 Dec 2021 13:16:08 +0100 (CET)","from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com\n\t[IPv6:2a00:1450:4864:20::42b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EDFB860725\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Dec 2021 13:16:05 +0100 (CET)","by mail-wr1-x42b.google.com with SMTP id a18so5318753wrn.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Dec 2021 04:16:05 -0800 (PST)","from [192.168.0.14]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161])\n\tby smtp.gmail.com with ESMTPSA id\n\tg16sm3111769wmq.20.2021.12.03.04.16.04\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tFri, 03 Dec 2021 04:16:05 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"SJgEtpQR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-transfer-encoding:content-language; \n\tbh=URh7/Xxvk5nTTHaR63OXZ+lbC2AYPYWSFep3emTGOb0=;\n\tb=SJgEtpQRZ7JnUjewbyeGNwP4MOjb8xm1NmbSeW9eLLAKVUO1nIliN0pN06UD9nZDsD\n\tMy7ouNt9u/6rCkv3SnDvHSAqOlVK4wrTYOa7NzAyIMDtPHEodONiy7aKkLW8M2nkJnCe\n\tt+ejUlEqWji4+NEtmXU96Or3Dq3b6ItO9EtoqxqyxXDQl5Nipc1WCTa3DxPdmUPTvC4p\n\tb9P9wGicGiIn6MVcwmpB33I+heBKBQqajLcLdcM9FM4aIPHlcSEkJUjCPnxO8L5s7Olm\n\tggQ+lCjnoFWX1lZ3EfBXKzLAfKI1DKWVUPUPJt3PPzFlHImV+mrbgoyk7Ssx8YAZZXqH\n\tAveg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-transfer-encoding\n\t:content-language;\n\tbh=URh7/Xxvk5nTTHaR63OXZ+lbC2AYPYWSFep3emTGOb0=;\n\tb=yHX8eSTBzqHP07AdC9bcAhBIKKREjCp3fxj1nonItnONf0UecjXuBxRihw1YF+jN7x\n\tKFBycIfEyfr+kAAz4KUNzhrnPLTLy8ugr98srxmUAPcoLhDpkC/S/fXNrCLAjxqr7dxV\n\t8z/P9Uj1A14W4s6sSnPCXK8fXOFPF442NExvfiWWGyyzdJXbI7b8LVwO79ioSCmlWXvW\n\tnTrNOQ1NwGfIhYqdjAqwUsnb1tuPIXtZ1xShtaKmv8jANVaxrf3wMiaKdxLbgzVtveRd\n\tDJv2RUO9Ywv2YbEjY2bu6SN8dPN+z6Qm71j+FcP7nCqtxcUGGiNniFY/TLxzZyF1OLKe\n\tSr9A==","X-Gm-Message-State":"AOAM531DZpJMUQ+PYumUQ3y05It7OlzLK1Wo+FCEndQLdhgY4qMIlRnw\n\tOJ5e99ApnodeLGI4jgYd/JdGH8LcRU4=","X-Google-Smtp-Source":"ABdhPJwSPeDDhCi/abHt0Dx5noHsHBaqhCfhtqz/1ym1vd8yzblnxBvvCi8WItjjgXiD5aelC4QIwA==","X-Received":"by 2002:a5d:460d:: with SMTP id\n\tt13mr21039596wrq.44.1638533765699; \n\tFri, 03 Dec 2021 04:16:05 -0800 (PST)","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20211126003118.42356-1-djrscally@gmail.com>\n\t<20211126003118.42356-5-djrscally@gmail.com>\n\t<YaQBSzIbGmIvnIZD@pendragon.ideasonboard.com>","From":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<2bb1dcd5-24b4-3c3d-7f8f-c16b73b0238d@gmail.com>","Date":"Fri, 3 Dec 2021 12:16:04 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.14.0","MIME-Version":"1.0","In-Reply-To":"<YaQBSzIbGmIvnIZD@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 4/5] ipa: ipu3: Send lens controls to\n\tpipeline handler","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]