[{"id":21659,"web_url":"https://patchwork.libcamera.org/comment/21659/","msgid":"<YbBvUrRFY4fMMZJl@pendragon.ideasonboard.com>","date":"2021-12-08T08:39:46","subject":"Re: [libcamera-devel] [PATCH v3 9/9] ipa: ipu3: Send lens controls\n\tto pipeline handler","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Dan,\n\nThank you for the patch.\n\nOn Tue, Dec 07, 2021 at 10:45:12PM +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> Changes in v3:\n> \n> \t- Replaced the new focus_ member with a local variable.\n> \n>  src/ipa/ipu3/ipu3.cpp | 7 +++++++\n>  1 file changed, 7 insertions(+)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index fe2bc3af..9303b33a 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -663,6 +663,7 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n>   */\n>  void IPAIPU3::setControls(unsigned int frame)\n>  {\n> +\tuint32_t focus;\n>  \tIPU3Action op;\n>  \top.op = ActionSetSensorControls;\n>  \n> @@ -674,6 +675,12 @@ 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\n\tuint32_t focus = context_.frameContext.af.focus;\n\nNo need to declare all variables at the beginning of the function in\nC++.\n\n> +\n> +\tControlList lensCtrls(lensCtrls_);\n> +\tlensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE, static_cast<int32_t>(focus));\n> +\top.lensControls = lensCtrls;\n\nOr possibly even\n\n\tControlList lensCtrls(lensCtrls_);\n\tlensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE,\n\t\t      static_cast<int32_t>(context_.frameContext.af.focus));\n\top.lensControls = lensCtrls;\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\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 01965BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Dec 2021 08:40:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4F89460868;\n\tWed,  8 Dec 2021 09:40:18 +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 D763D60225\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Dec 2021 09:40:16 +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 4E6C68BB;\n\tWed,  8 Dec 2021 09:40:16 +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=\"YDaOenY+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638952816;\n\tbh=WCmHSnkOBZu5Bc5Q+xMN+HCFZm9LcZ1ssHgZqzEr1Ls=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=YDaOenY+m+mxyGvD/hClR9eSl2ZDUTRAU/bPOSwlVqXhOr2m7p093GXrgB7e/K64m\n\tFGh0tlJp6CzhY6LXPprvLLxYGvkleLvUFuy3Losk7yK+XO5l91aeOMQrKmoYKgbUXS\n\tI/IjFYnWJ/xuRIYenD231OyIiMYdAO35B9Rlvw2A=","Date":"Wed, 8 Dec 2021 10:39:46 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<YbBvUrRFY4fMMZJl@pendragon.ideasonboard.com>","References":"<20211207224512.753979-1-djrscally@gmail.com>\n\t<20211207224512.753979-10-djrscally@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211207224512.753979-10-djrscally@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v3 9/9] ipa: ipu3: Send lens controls\n\tto pipeline 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>"}}]