[{"id":21302,"web_url":"https://patchwork.libcamera.org/comment/21302/","msgid":"<YaQBum0WwIAkwFYc@pendragon.ideasonboard.com>","date":"2021-11-28T22:24:58","subject":"Re: [libcamera-devel] [PATCH 5/5] ipa: ipu3: af: Remove v4l2\n\tinteraction from AF algorithm","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:18AM +0000, Daniel Scally wrote:\n> Now that the actual interaction with the VCM's V4L2 subdev can be\n> done through the CameraLens class, remove it from the auto focus\n> algorithm code.\n> \n> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n> ---\n>  src/ipa/ipu3/algorithms/af.cpp | 29 +----------------------------\n>  src/ipa/ipu3/algorithms/af.h   |  3 ---\n>  2 files changed, 1 insertion(+), 31 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n> index 2859a6a8..1bbf64aa 100644\n> --- a/src/ipa/ipu3/algorithms/af.cpp\n> +++ b/src/ipa/ipu3/algorithms/af.cpp\n> @@ -66,17 +66,10 @@ static constexpr double MaxChange_ = 0.8;\n>  Af::Af()\n>  \t: focus_(0), currentVariance_(0.0)\n>  {\n> -\t/**\n> -\t * For surface Go 2 back camera VCM (dw9719)\n> -\t * \\todo move to control class\n> -\t*/\n> -\tvcmFd_ = open(\"/dev/v4l-subdev8\", O_RDWR);\n>  }\n>  \n>  Af::~Af()\n>  {\n> -\tif (vcmFd_ != -1)\n> -\t\tclose(vcmFd_);\n>  }\n>  \n>  void Af::prepare(IPAContext &context, ipu3_uapi_params *params)\n> @@ -169,25 +162,6 @@ int Af::configure(IPAContext &context, [[maybe_unused]] const IPAConfigInfo &con\n>  \treturn 0;\n>  }\n>  \n> -/**\n> - * \\brief Send focus step to the VCM.\n> - * \\param[in] value Set lens position.\n> - * \\todo It is hardcoded here for the dw9717 VCM and will be moved to the\n> - * subdev control in the future.\n> - */\n> -int Af::vcmSet(int value)\n> -{\n> -\tint ret;\n> -\tstruct v4l2_control ctrl;\n> -\tif (vcmFd_ == -1)\n> -\t\treturn -EINVAL;\n> -\tmemset(&ctrl, 0, sizeof(struct v4l2_control));\n> -\tctrl.id = V4L2_CID_FOCUS_ABSOLUTE;\n> -\tctrl.value = value;\n> -\tret = ioctl(vcmFd_, VIDIOC_S_CTRL, &ctrl);\n\nWe can probably drop some #include statements, for the headers used by\nopen() and ioctl().\n\nThe patch looks fine overall, I expect Kate will squash it into her\nwork.\n\n> -\treturn ret;\n> -}\n> -\n>  /**\n>   * \\brief Determine the max contrast image and lens position. y_table is the\n>   * statictic data from IPU3 and is composed of low pass and high pass filtered\n> @@ -263,10 +237,9 @@ void Af::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)\n>  \t\t\tif (focus_ > MaxFocusSteps_) {\n>  \t\t\t\t/* If reach the max step, move lens to the position and set \"focus stable\". */\n>  \t\t\t\tcontext.frameContext.af.stable = true;\n> -\t\t\t\tvcmSet(context.frameContext.af.focus);\n>  \t\t\t} else {\n>  \t\t\t\tfocus_ += MinSearchStep_;\n> -\t\t\t\tvcmSet(focus_);\n> +\t\t\t\tcontext.frameContext.af.focus = focus_;\n>  \t\t\t}\n>  \t\t\tLOG(IPU3Af, Debug) << \"Focus searching max variance is: \"\n>  \t\t\t\t\t   << context.frameContext.af.maxVariance\n> diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\n> index d32d5184..b21084e9 100644\n> --- a/src/ipa/ipu3/algorithms/af.h\n> +++ b/src/ipa/ipu3/algorithms/af.h\n> @@ -36,9 +36,6 @@ public:\n>  \tvoid process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n>  \n>  private:\n> -\tint vcmSet(int value);\n> -\n> -\tint vcmFd_;\n>  \t/* Used for focus scan. */\n>  \tuint32_t focus_;\n>  \t/* Recent AF statistic variance. */","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 2E865BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Nov 2021 22:25:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8B5DC6057B;\n\tSun, 28 Nov 2021 23:25:24 +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 E89C1604FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Nov 2021 23:25:22 +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 5AA1CF1;\n\tSun, 28 Nov 2021 23:25:22 +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=\"cMt0CJXT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638138322;\n\tbh=s9/1Ut+iYfB4D43s+ySwAfkkjnh3ZsI0SrnNtpYTVn8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=cMt0CJXTcAhDkq673kee4Ufte2oqFgcrRoDFFuQcCtN2sPtFHkl8z1MqoASqGAOat\n\tabDBkFKM05QxMvcmHp5iEUp2SRmYn1yxAIKber+ojiOG7wtBojlnLADz/yvo5fZ24N\n\t42VEBAJmUWcZAimu8cOEspHD7aFDE3aImczI2Mf0=","Date":"Mon, 29 Nov 2021 00:24:58 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<YaQBum0WwIAkwFYc@pendragon.ideasonboard.com>","References":"<20211126003118.42356-1-djrscally@gmail.com>\n\t<20211126003118.42356-6-djrscally@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211126003118.42356-6-djrscally@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 5/5] ipa: ipu3: af: Remove v4l2\n\tinteraction from AF algorithm","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":21305,"web_url":"https://patchwork.libcamera.org/comment/21305/","msgid":"<ea2192a2-c475-c9a9-1eee-35f0416adba7@gmail.com>","date":"2021-11-28T23:14:36","subject":"Re: [libcamera-devel] [PATCH 5/5] ipa: ipu3: af: Remove v4l2\n\tinteraction from AF algorithm","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:24, Laurent Pinchart wrote:\n> Hi Daniel,\n>\n> Thank you for the patch.\n>\n> On Fri, Nov 26, 2021 at 12:31:18AM +0000, Daniel Scally wrote:\n>> Now that the actual interaction with the VCM's V4L2 subdev can be\n>> done through the CameraLens class, remove it from the auto focus\n>> algorithm code.\n>>\n>> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n>> ---\n>>  src/ipa/ipu3/algorithms/af.cpp | 29 +----------------------------\n>>  src/ipa/ipu3/algorithms/af.h   |  3 ---\n>>  2 files changed, 1 insertion(+), 31 deletions(-)\n>>\n>> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n>> index 2859a6a8..1bbf64aa 100644\n>> --- a/src/ipa/ipu3/algorithms/af.cpp\n>> +++ b/src/ipa/ipu3/algorithms/af.cpp\n>> @@ -66,17 +66,10 @@ static constexpr double MaxChange_ = 0.8;\n>>  Af::Af()\n>>  \t: focus_(0), currentVariance_(0.0)\n>>  {\n>> -\t/**\n>> -\t * For surface Go 2 back camera VCM (dw9719)\n>> -\t * \\todo move to control class\n>> -\t*/\n>> -\tvcmFd_ = open(\"/dev/v4l-subdev8\", O_RDWR);\n>>  }\n>>  \n>>  Af::~Af()\n>>  {\n>> -\tif (vcmFd_ != -1)\n>> -\t\tclose(vcmFd_);\n>>  }\n>>  \n>>  void Af::prepare(IPAContext &context, ipu3_uapi_params *params)\n>> @@ -169,25 +162,6 @@ int Af::configure(IPAContext &context, [[maybe_unused]] const IPAConfigInfo &con\n>>  \treturn 0;\n>>  }\n>>  \n>> -/**\n>> - * \\brief Send focus step to the VCM.\n>> - * \\param[in] value Set lens position.\n>> - * \\todo It is hardcoded here for the dw9717 VCM and will be moved to the\n>> - * subdev control in the future.\n>> - */\n>> -int Af::vcmSet(int value)\n>> -{\n>> -\tint ret;\n>> -\tstruct v4l2_control ctrl;\n>> -\tif (vcmFd_ == -1)\n>> -\t\treturn -EINVAL;\n>> -\tmemset(&ctrl, 0, sizeof(struct v4l2_control));\n>> -\tctrl.id = V4L2_CID_FOCUS_ABSOLUTE;\n>> -\tctrl.value = value;\n>> -\tret = ioctl(vcmFd_, VIDIOC_S_CTRL, &ctrl);\n> We can probably drop some #include statements, for the headers used by\n> open() and ioctl().\n>\n> The patch looks fine overall, I expect Kate will squash it into her\n> work.\n\n\nThat was my thought too, as long as Kate's ok with that\n\n>\n>> -\treturn ret;\n>> -}\n>> -\n>>  /**\n>>   * \\brief Determine the max contrast image and lens position. y_table is the\n>>   * statictic data from IPU3 and is composed of low pass and high pass filtered\n>> @@ -263,10 +237,9 @@ void Af::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)\n>>  \t\t\tif (focus_ > MaxFocusSteps_) {\n>>  \t\t\t\t/* If reach the max step, move lens to the position and set \"focus stable\". */\n>>  \t\t\t\tcontext.frameContext.af.stable = true;\n>> -\t\t\t\tvcmSet(context.frameContext.af.focus);\n>>  \t\t\t} else {\n>>  \t\t\t\tfocus_ += MinSearchStep_;\n>> -\t\t\t\tvcmSet(focus_);\n>> +\t\t\t\tcontext.frameContext.af.focus = focus_;\n>>  \t\t\t}\n>>  \t\t\tLOG(IPU3Af, Debug) << \"Focus searching max variance is: \"\n>>  \t\t\t\t\t   << context.frameContext.af.maxVariance\n>> diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\n>> index d32d5184..b21084e9 100644\n>> --- a/src/ipa/ipu3/algorithms/af.h\n>> +++ b/src/ipa/ipu3/algorithms/af.h\n>> @@ -36,9 +36,6 @@ public:\n>>  \tvoid process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n>>  \n>>  private:\n>> -\tint vcmSet(int value);\n>> -\n>> -\tint vcmFd_;\n>>  \t/* Used for focus scan. */\n>>  \tuint32_t focus_;\n>>  \t/* Recent AF statistic variance. */","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 CA646BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Nov 2021 23:14:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6EF736058C;\n\tMon, 29 Nov 2021 00:14:39 +0100 (CET)","from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com\n\t[IPv6:2a00:1450:4864:20::42d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 177BA6011D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 00:14:38 +0100 (CET)","by mail-wr1-x42d.google.com with SMTP id i5so32676600wrb.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Nov 2021 15:14:38 -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\tn184sm16742827wme.2.2021.11.28.15.14.37\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tSun, 28 Nov 2021 15:14:37 -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=\"nD027ueb\"; 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=By6FczhRyFKEMmRnGP9+SL3Z1p12zfboZM/m8RvxpDk=;\n\tb=nD027uebMPqCFS4ZPWrynt8SVUOiMTHunDPIXlwzkL01srcBhr3TPJ5lwTxEIQz73P\n\tvlOwnjvspg603YmIGTAsOgL6gf0naqaKH3YfiOp6xM3JBQkLmfI+gasJ7/siqdK5sRDH\n\tJKk6tj+xU6Dc9eP6wLAtmXv4GRCCm4b7UF87dUF+iwLAXGVqDZ3IYKes0vJCE+5ikItf\n\tc2c9z56opgvHiKY/+o6q7IHk8xeGCV8VLjACQYM7aXC3DA7zz3PTuePlXTwXaGDxaY72\n\tQTDrxgzGgLGEnxGD1s2iaaMxsjMKZxgBohHhPU59DCsiMofL8vVg58YRP5tPi4P/u1fV\n\t/S/g==","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=By6FczhRyFKEMmRnGP9+SL3Z1p12zfboZM/m8RvxpDk=;\n\tb=fzR9LYlxhjWtg+QRMCPm+8tfoYiiZShWnijQUrAnmYF/yNOnlBMk59AGw6AX9E3fiY\n\t3og4ohwsSiIVy/CYrQhVMBzN3iyjn+S58ZsuO+pqMtf4wQRGydcwI36cEW2IriEduTav\n\tkWAnrHPBhXqAkCmIptO7ZRMv3kCmIL1Y4dJ/wIkIdjUNmKBMwkE8ouZ3QNIz5oGI8vgC\n\tp2bvviPeYg5EmVR/Ty2wkCI7jiXkqY6HtMieCaHOJGHJqupL9EZZY7mZJNqUaiPBynNT\n\tPSnfOWfZ5Grj4I3G+9DX5LvhlgFzKJqlil76yoEPLSBzTusRSX4ySyHbU51Sdoh2bpih\n\ty5hA==","X-Gm-Message-State":"AOAM532XMw3j5XHPPg0O94NfQRRVXTmLbStquonRUcwdUJ1rkaWt72A4\n\t6wghXlCT/oRj0JvOFtKPNLD9RuaBAS4=","X-Google-Smtp-Source":"ABdhPJzEsDbooDPwZcEo99x3dVREBeteJgrRwjGHs5b/5+5MgvoDhPBJk9Q8DK3xCE/uD6GdQm8z7A==","X-Received":"by 2002:adf:fa0b:: with SMTP id\n\tm11mr29156555wrr.152.1638141277862; \n\tSun, 28 Nov 2021 15:14:37 -0800 (PST)","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20211126003118.42356-1-djrscally@gmail.com>\n\t<20211126003118.42356-6-djrscally@gmail.com>\n\t<YaQBum0WwIAkwFYc@pendragon.ideasonboard.com>","From":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<ea2192a2-c475-c9a9-1eee-35f0416adba7@gmail.com>","Date":"Sun, 28 Nov 2021 23:14:36 +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":"<YaQBum0WwIAkwFYc@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 5/5] ipa: ipu3: af: Remove v4l2\n\tinteraction from AF algorithm","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":21307,"web_url":"https://patchwork.libcamera.org/comment/21307/","msgid":"<CAEth8oHMHwPfdFiFZRkyyi2K9UX-dLUJD53SLGwVBpVCNuf_3w@mail.gmail.com>","date":"2021-11-29T02:04:34","subject":"Re: [libcamera-devel] [PATCH 5/5] ipa: ipu3: af: Remove v4l2\n\tinteraction from AF algorithm","submitter":{"id":105,"url":"https://patchwork.libcamera.org/api/people/105/","name":"Kate Hsuan","email":"hpa@redhat.com"},"content":"Hi Daniel,\n\nOn Mon, Nov 29, 2021 at 7:14 AM Daniel Scally <djrscally@gmail.com> wrote:\n>\n> Hi Laurent\n>\n> On 28/11/2021 22:24, Laurent Pinchart wrote:\n> > Hi Daniel,\n> >\n> > Thank you for the patch.\n> >\n> > On Fri, Nov 26, 2021 at 12:31:18AM +0000, Daniel Scally wrote:\n> >> Now that the actual interaction with the VCM's V4L2 subdev can be\n> >> done through the CameraLens class, remove it from the auto focus\n> >> algorithm code.\n> >>\n> >> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n> >> ---\n> >>  src/ipa/ipu3/algorithms/af.cpp | 29 +----------------------------\n> >>  src/ipa/ipu3/algorithms/af.h   |  3 ---\n> >>  2 files changed, 1 insertion(+), 31 deletions(-)\n> >>\n> >> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n> >> index 2859a6a8..1bbf64aa 100644\n> >> --- a/src/ipa/ipu3/algorithms/af.cpp\n> >> +++ b/src/ipa/ipu3/algorithms/af.cpp\n> >> @@ -66,17 +66,10 @@ static constexpr double MaxChange_ = 0.8;\n> >>  Af::Af()\n> >>      : focus_(0), currentVariance_(0.0)\n> >>  {\n> >> -    /**\n> >> -     * For surface Go 2 back camera VCM (dw9719)\n> >> -     * \\todo move to control class\n> >> -    */\n> >> -    vcmFd_ = open(\"/dev/v4l-subdev8\", O_RDWR);\n> >>  }\n> >>\n> >>  Af::~Af()\n> >>  {\n> >> -    if (vcmFd_ != -1)\n> >> -            close(vcmFd_);\n> >>  }\n> >>\n> >>  void Af::prepare(IPAContext &context, ipu3_uapi_params *params)\n> >> @@ -169,25 +162,6 @@ int Af::configure(IPAContext &context, [[maybe_unused]] const IPAConfigInfo &con\n> >>      return 0;\n> >>  }\n> >>\n> >> -/**\n> >> - * \\brief Send focus step to the VCM.\n> >> - * \\param[in] value Set lens position.\n> >> - * \\todo It is hardcoded here for the dw9717 VCM and will be moved to the\n> >> - * subdev control in the future.\n> >> - */\n> >> -int Af::vcmSet(int value)\n> >> -{\n> >> -    int ret;\n> >> -    struct v4l2_control ctrl;\n> >> -    if (vcmFd_ == -1)\n> >> -            return -EINVAL;\n> >> -    memset(&ctrl, 0, sizeof(struct v4l2_control));\n> >> -    ctrl.id = V4L2_CID_FOCUS_ABSOLUTE;\n> >> -    ctrl.value = value;\n> >> -    ret = ioctl(vcmFd_, VIDIOC_S_CTRL, &ctrl);\n> > We can probably drop some #include statements, for the headers used by\n> > open() and ioctl().\n> >\n> > The patch looks fine overall, I expect Kate will squash it into her\n> > work.\n>\n>\n> That was my thought too, as long as Kate's ok with that\n>\n> >\n> >> -    return ret;\n> >> -}\n> >> -\n> >>  /**\n> >>   * \\brief Determine the max contrast image and lens position. y_table is the\n> >>   * statictic data from IPU3 and is composed of low pass and high pass filtered\n> >> @@ -263,10 +237,9 @@ void Af::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)\n> >>                      if (focus_ > MaxFocusSteps_) {\n> >>                              /* If reach the max step, move lens to the position and set \"focus stable\". */\n> >>                              context.frameContext.af.stable = true;\n> >> -                            vcmSet(context.frameContext.af.focus);\n> >>                      } else {\n> >>                              focus_ += MinSearchStep_;\n> >> -                            vcmSet(focus_);\n> >> +                            context.frameContext.af.focus = focus_;\n> >>                      }\n> >>                      LOG(IPU3Af, Debug) << \"Focus searching max variance is: \"\n> >>                                         << context.frameContext.af.maxVariance\n> >> diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\n> >> index d32d5184..b21084e9 100644\n> >> --- a/src/ipa/ipu3/algorithms/af.h\n> >> +++ b/src/ipa/ipu3/algorithms/af.h\n> >> @@ -36,9 +36,6 @@ public:\n> >>      void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n> >>\n> >>  private:\n> >> -    int vcmSet(int value);\n> >> -\n> >> -    int vcmFd_;\n> >>      /* Used for focus scan. */\n> >>      uint32_t focus_;\n> >>      /* Recent AF statistic variance. */\n>\n\nIt's good to me :)\n\nReviewed-by: Kate Hsuan <hpa@redhat.com>","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 F1327BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Nov 2021 02:04:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F3D816057D;\n\tMon, 29 Nov 2021 03:04:54 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 34AB76011A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 03:04:53 +0100 (CET)","from mail-lf1-f72.google.com (mail-lf1-f72.google.com\n\t[209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-159-Ud7NgHVDMsW1F_vpv81vDA-1; Sun, 28 Nov 2021 21:04:46 -0500","by mail-lf1-f72.google.com with SMTP id\n\tj9-20020a05651231c900b004037efe9fddso4998170lfe.18\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Nov 2021 18:04:46 -0800 (PST)"],"Authentication-Results":["lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"L9mlYNjw\"; dkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hpa@redhat.com"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1638151491;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=fKYVLji+tPNn5Gx1dJ+zqfAre7VWw/+UjGLgT0gklAE=;\n\tb=L9mlYNjwl3TGNekdenSHWr16TKL4bRXZ2NoBnvDNWu9cENtQ48DOjo2eG19ADVUTjsl1ed\n\tP0JyfROf8KtCg7oKvC98xUtTUKWLncNIOpmqF0quxeCYS7XOE0PCfwmoY9tiwgiKWCCEw9\n\tUulewNlEhk/nfvJoA2TTSn0ua7Kl7zc=","X-MC-Unique":"Ud7NgHVDMsW1F_vpv81vDA-1","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=fKYVLji+tPNn5Gx1dJ+zqfAre7VWw/+UjGLgT0gklAE=;\n\tb=y+4OzmVC7UnZiZC2vMsBh7p6DZ62u7BIggrVJDz12EwGQBElkdhP0FrOgF54tcVnkJ\n\tBhUuHw3+WORXHUcyzhLEs6T/ay53KOzEiIE0tjGv7nql0rhXoK8oOPcZL0XhIb0ojPXO\n\t4rRK/NuJK1xlzTZowgYZyhVlGNxs20McXbQJUVCrn/7sEuvjJ1Zc8XqR0ASoGJ6DGPHm\n\t7+WwEg0C+WdUUU0QtNf9pz2y71+WDbpAKGyGiNUYMJSRxacHGMMBkYfGyxretEqcD57C\n\t9I1znohwV10OVgpc1MfrTWp0dUt90OI5byxF/BcC2oaR2IHNDTHdG+Kg2LAhwldCppjC\n\ta29g==","X-Gm-Message-State":"AOAM533Wb/Egn8oNDZQ19tdFxDnBMylb+0jWMrMnTttaWrsUZK/OE48r\n\tyTVGLHaLztSDUt+XYHbmM1lKKRYDXcH3levYGiydcdBzJfB6uNrRqURtSEmIWMuXyI/NqQXpcMK\n\tYWVnUA7453Gd7DA4yh74TL9IDn3iFqq0L+Xn1Mw3Ysb+sX4/qBw==","X-Received":["by 2002:a2e:3c13:: with SMTP id\n\tj19mr46046804lja.311.1638151485358; \n\tSun, 28 Nov 2021 18:04:45 -0800 (PST)","by 2002:a2e:3c13:: with SMTP id\n\tj19mr46046774lja.311.1638151485008; \n\tSun, 28 Nov 2021 18:04:45 -0800 (PST)"],"X-Google-Smtp-Source":"ABdhPJxT080XqC56GITl0bvnZwEsqmZ1/PgPR03WyMtyLzSnFod13vraW2/G9p1s4yNe1ub4vm5FPJ6j7I1ngh7sgpU=","MIME-Version":"1.0","References":"<20211126003118.42356-1-djrscally@gmail.com>\n\t<20211126003118.42356-6-djrscally@gmail.com>\n\t<YaQBum0WwIAkwFYc@pendragon.ideasonboard.com>\n\t<ea2192a2-c475-c9a9-1eee-35f0416adba7@gmail.com>","In-Reply-To":"<ea2192a2-c475-c9a9-1eee-35f0416adba7@gmail.com>","From":"Kate Hsuan <hpa@redhat.com>","Date":"Mon, 29 Nov 2021 10:04:34 +0800","Message-ID":"<CAEth8oHMHwPfdFiFZRkyyi2K9UX-dLUJD53SLGwVBpVCNuf_3w@mail.gmail.com>","To":"Daniel Scally <djrscally@gmail.com>","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 5/5] ipa: ipu3: af: Remove v4l2\n\tinteraction from AF algorithm","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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]