[{"id":21593,"web_url":"https://patchwork.libcamera.org/comment/21593/","msgid":"<Yaq2AUn0V9HR/9T1@pendragon.ideasonboard.com>","date":"2021-12-04T00:27:45","subject":"Re: [libcamera-devel] [PATCH v2 7/7] 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 Daniel,\n\nThank you for the patch.\n\nOn Fri, Dec 03, 2021 at 10:42:30PM +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 v2:\n> \n> \t- Created a ControlList to hold the lensCtrls (Laurent)\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 3828650d..5c57797d 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -174,6 +174,7 @@ private:\n>  \tuint32_t gain_;\n>  \tuint32_t minGain_;\n>  \tuint32_t maxGain_;\n> +\tuint32_t focus_;\n\nI don't think you need to store focus_ here, as it's only used locally\nin setControls().\n\n>  \n>  \tutils::Duration lineDuration_;\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> +\tControlList lensCtrls(lensCtrls_);\n> +\tlensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE, static_cast<int32_t>(focus_));\n> +\top.lensControls = lensCtrls;\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 870F3BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  4 Dec 2021 00:28:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5122F6011A;\n\tSat,  4 Dec 2021 01:28:14 +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 85B5060117\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  4 Dec 2021 01:28:12 +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 2205330C;\n\tSat,  4 Dec 2021 01:28:12 +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=\"Z3E586an\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638577692;\n\tbh=GscFCAPDWqESBzZegYkL/S/urpmIwCtGzve8iFPtk38=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Z3E586anPqgaOzf9X8S/sQ9sxrktmXXyyFkPiCYl9ipE8MATE4JBn7Q/XaWEDuIHI\n\tkwSpY/S9YPQuLHPrv8fpQfSmGuE0fcX8d5iTjuzYzJ4OnwR709yf+n6h7ySTYv53l3\n\tJtP6wgU+GEWqngiOsuB7LIvqJubayfrk5UAO6Qv0=","Date":"Sat, 4 Dec 2021 02:27:45 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<Yaq2AUn0V9HR/9T1@pendragon.ideasonboard.com>","References":"<20211203224230.38700-1-djrscally@gmail.com>\n\t<20211203224230.38700-8-djrscally@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211203224230.38700-8-djrscally@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v2 7/7] 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>"}},{"id":21598,"web_url":"https://patchwork.libcamera.org/comment/21598/","msgid":"<f907e470-342f-1e25-cc22-f7c8c265fc9c@gmail.com>","date":"2021-12-04T21:41:11","subject":"Re: [libcamera-devel] [PATCH v2 7/7] ipa: ipu3: Send lens controls\n\tto pipeline handler","submitter":{"id":90,"url":"https://patchwork.libcamera.org/api/people/90/","name":"Daniel Scally","email":"djrscally@gmail.com"},"content":"Hi Laurent\n\nOn 04/12/2021 00:27, Laurent Pinchart wrote:\n> Hi Daniel,\n> \n> Thank you for the patch.\n> \n> On Fri, Dec 03, 2021 at 10:42:30PM +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 v2:\n>>\n>> \t- Created a ControlList to hold the lensCtrls (Laurent)\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 3828650d..5c57797d 100644\n>> --- a/src/ipa/ipu3/ipu3.cpp\n>> +++ b/src/ipa/ipu3/ipu3.cpp\n>> @@ -174,6 +174,7 @@ private:\n>>  \tuint32_t gain_;\n>>  \tuint32_t minGain_;\n>>  \tuint32_t maxGain_;\n>> +\tuint32_t focus_;\n> \n> I don't think you need to store focus_ here, as it's only used locally\n> in setControls().\n\nRighto - will do it in the v3\n> \n>>  \n>>  \tutils::Duration lineDuration_;\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>> +\tControlList lensCtrls(lensCtrls_);\n>> +\tlensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE, static_cast<int32_t>(focus_));\n>> +\top.lensControls = lensCtrls;\n>> +\n>>  \tqueueFrameAction.emit(frame, op);\n>>  }\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 81E71BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  4 Dec 2021 21:41:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3B4F060866;\n\tSat,  4 Dec 2021 22:41:14 +0100 (CET)","from mail-wr1-x434.google.com (mail-wr1-x434.google.com\n\t[IPv6:2a00:1450:4864:20::434])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AB7E0605C4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  4 Dec 2021 22:41:12 +0100 (CET)","by mail-wr1-x434.google.com with SMTP id j3so13698549wrp.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 04 Dec 2021 13:41:12 -0800 (PST)","from [192.168.0.16]\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\tn2sm9033640wmi.36.2021.12.04.13.41.11\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tSat, 04 Dec 2021 13:41:12 -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=\"YPo9Oh/M\"; 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-language:content-transfer-encoding; \n\tbh=5jMBmM1zXwz5Pp3SCpbx0rxXgxKzaPp+ZNjUPjNLm3w=;\n\tb=YPo9Oh/M62lVnkPY7wUbbtMaL9W2NFgP33pRvLkCMQ3dqeGMQC82xRy+PnTY/7fbKb\n\t3dcugfvVJiq1PqG2bbMowGFmAnT+rj2/AhYeSMHM5Q3pAuvL4dtElTXyaVAifJxYI15K\n\teEkJRf/g/Us6ba43xJeohvpYeWXKI5Vwhjc6oMXH6982AGKFLu3aMQmgPbGeYrv1RZ9E\n\tPhLAch+hsXmAPzR2bX+MwlU8LH1a0wbbdQAWTgf/j9hcAq/pG8Xw8VOuzEWC3pN/D0jy\n\trqQuVV5hCXowMI2n5E13SvZarXpfNX8nb65ZcCR30U/r1NV+3zOpbgHkcYLxeAYHdmkU\n\tBOxQ==","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-language\n\t:content-transfer-encoding;\n\tbh=5jMBmM1zXwz5Pp3SCpbx0rxXgxKzaPp+ZNjUPjNLm3w=;\n\tb=REHvpHwUlpamQv0f6RtjoKuRGmH6DU2q+oacG45Vw8hCVX7Y5OOffllFGzOFw6URfr\n\t2ybqg6HSTkwBBtxKFfAtjHLzibQtBd+nxmc9IE7IZLYrJn7oWfLCL3T2X07y1hzaKIDn\n\trBOcmZ+ApkltpXb6sNQ7HtMw5UNWJrz2po31ZX82WqgwXnnfKzjhu+VX7y4frWQ+E4U4\n\tzAGMHtmZXGydqmvchlttkI5QpBTdobPIu/APBR0frFa4KpMhSPtzkq1AZRKhN57er6/m\n\t7DovgjwblayQwdLDno+qbc/2dLIZlXi95hiF+osodDzVtg5IoyN+MDbNsnRD7GEiLcjn\n\tsxFQ==","X-Gm-Message-State":"AOAM530S+6T68ZwYcSHufnpzfklpyIFVKTJ2xREZtLm8lgN99MtDuYd9\n\t+mrziYSVDsQNTpcEXDZmfwtpmCc3OQY=","X-Google-Smtp-Source":"ABdhPJyB0F6HtefW0am7brj1kIkbnjbKD5LpRBSNrlqKQXxkpG1e3x5pnMYv7k1bK8xZ7XpQTeNmDw==","X-Received":"by 2002:a05:6000:2c4:: with SMTP id\n\to4mr31413803wry.303.1638654072464; \n\tSat, 04 Dec 2021 13:41:12 -0800 (PST)","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20211203224230.38700-1-djrscally@gmail.com>\n\t<20211203224230.38700-8-djrscally@gmail.com>\n\t<Yaq2AUn0V9HR/9T1@pendragon.ideasonboard.com>","From":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<f907e470-342f-1e25-cc22-f7c8c265fc9c@gmail.com>","Date":"Sat, 4 Dec 2021 21:41:11 +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":"<Yaq2AUn0V9HR/9T1@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v2 7/7] 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>"}}]