Patch Detail
Show a patch.
GET /api/patches/14788/?format=api
{ "id": 14788, "url": "https://patchwork.libcamera.org/api/patches/14788/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14788/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20211126003118.42356-6-djrscally@gmail.com>", "date": "2021-11-26T00:31:18", "name": "[libcamera-devel,5/5] ipa: ipu3: af: Remove v4l2 interaction from AF algorithm", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "132e12acceed5b4c91f76a14701514538febaca1", "submitter": { "id": 90, "url": "https://patchwork.libcamera.org/api/people/90/?format=api", "name": "Daniel Scally", "email": "djrscally@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14788/mbox/", "series": [ { "id": 2757, "url": "https://patchwork.libcamera.org/api/series/2757/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2757", "date": "2021-11-26T00:31:13", "name": "Enumerate CameraLens by following sensor's ancillary links", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2757/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14788/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14788/checks/", "tags": {}, "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 94B37C3250\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Nov 2021 00:31:37 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2485560128;\n\tFri, 26 Nov 2021 01:31:37 +0100 (CET)", "from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n\t[IPv6:2a00:1450:4864:20::32d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5FDFA60442\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Nov 2021 01:31:31 +0100 (CET)", "by mail-wm1-x32d.google.com with SMTP id\n\taz34-20020a05600c602200b0033bf8662572so5740110wmb.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 16:31:31 -0800 (PST)", "from localhost.localdomain\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\tb188sm4381455wmd.45.2021.11.25.16.31.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 25 Nov 2021 16:31:30 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"PLGekzFb\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=bZVKkt1twe0fHtrI7EWid1fVCYFD2Bw6ZSsYAt/eJoI=;\n\tb=PLGekzFbOzSnWsGUE30E0SKMTw2cOc62QI1NBLKjKU9mkeICWrSQwmBlSjcUkwDjt9\n\t5CXNcFZRezttu51A4CanzaGCrPQarInlVfFQVIC++Uhs4l5iRk7dNLZL0vFRPZ9f+bxP\n\tM84jtmfK7Q/AFSjFFX8Wn36Oac/75t2KbHx384YkMrFYove4VA1uuCkzjCKGV6LR5IDu\n\tVIrElDEVQRkK6kczssAjhRYd7NhXTAYGM6YtHJTZGliaaKHeyBlaA0IuDUexrm03Tanf\n\tuDCBRXsYiifHAibxDoWcF7Wa/efXRk7XKyS5lkBD71ClQcKycmYFrgRp5DzR0Y+AA0EJ\n\tjPDA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=bZVKkt1twe0fHtrI7EWid1fVCYFD2Bw6ZSsYAt/eJoI=;\n\tb=eidFLN/PCmj0Jxsz9Oh+f9ci1u/WK1JwgycEJIioJzb5Enst4tLU/unCj5B2OL4J2Z\n\tip2pzzyjb6uCaA1RHH7PIVbGq5CRkUl6uoSFg3W2pJhyArsdfwgCpCdBnQQk7UXUSUHb\n\tLzQLo2+ZQFfeGOuDM8BImdce/QWAs3Eea0iFKxox3kGFZ5nHSEUd5/gwmsIJNIg7EYHT\n\tnRNb9SumjIu2SEtMR7NHciI1XoTNiZJwGuXR4Cgy4F6t/9RhZVQ/xXR5s8BVmHodxH10\n\tSuWTjlYI/30vCyJoJdsJDhb6cM4FMwJICOGf4II6vZdIBq6fp7LJh1P7sTzgm4ApnaKO\n\tzIYw==", "X-Gm-Message-State": "AOAM531KAPLbH9OKEcTEB5yuqLHEUyeqHiI8jSJLx/GEi3Bv6We7tSsa\n\t5fXF12zkBuawMiwtUXsiO4yZcYHEf7o=", "X-Google-Smtp-Source": "ABdhPJxYe3DiW79GymGq1R7ghGkljJwRbQzmkX9+oIgOjTsem/fjVFP1U+hkuTjOPF2mAXvLYO8bCQ==", "X-Received": "by 2002:a05:600c:224a:: with SMTP id\n\ta10mr11882982wmm.154.1637886691161; \n\tThu, 25 Nov 2021 16:31:31 -0800 (PST)", "From": "Daniel Scally <djrscally@gmail.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 26 Nov 2021 00:31:18 +0000", "Message-Id": "<20211126003118.42356-6-djrscally@gmail.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20211126003118.42356-1-djrscally@gmail.com>", "References": "<20211126003118.42356-1-djrscally@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "quoted-printable", "Subject": "[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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Now that the actual interaction with the VCM's V4L2 subdev can be\ndone through the CameraLens class, remove it from the auto focus\nalgorithm code.\n\nSigned-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(-)", "diff": "diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\r\nindex 2859a6a8..1bbf64aa 100644\r\n--- a/src/ipa/ipu3/algorithms/af.cpp\r\n+++ b/src/ipa/ipu3/algorithms/af.cpp\r\n@@ -66,17 +66,10 @@ static constexpr double MaxChange_ = 0.8;\r\n Af::Af()\r\n \t: focus_(0), currentVariance_(0.0)\r\n {\r\n-\t/**\r\n-\t * For surface Go 2 back camera VCM (dw9719)\r\n-\t * \\todo move to control class\r\n-\t*/\r\n-\tvcmFd_ = open(\"/dev/v4l-subdev8\", O_RDWR);\r\n }\r\n \r\n Af::~Af()\r\n {\r\n-\tif (vcmFd_ != -1)\r\n-\t\tclose(vcmFd_);\r\n }\r\n \r\n void Af::prepare(IPAContext &context, ipu3_uapi_params *params)\r\n@@ -169,25 +162,6 @@ int Af::configure(IPAContext &context, [[maybe_unused]] const IPAConfigInfo &con\r\n \treturn 0;\r\n }\r\n \r\n-/**\r\n- * \\brief Send focus step to the VCM.\r\n- * \\param[in] value Set lens position.\r\n- * \\todo It is hardcoded here for the dw9717 VCM and will be moved to the\r\n- * subdev control in the future.\r\n- */\r\n-int Af::vcmSet(int value)\r\n-{\r\n-\tint ret;\r\n-\tstruct v4l2_control ctrl;\r\n-\tif (vcmFd_ == -1)\r\n-\t\treturn -EINVAL;\r\n-\tmemset(&ctrl, 0, sizeof(struct v4l2_control));\r\n-\tctrl.id = V4L2_CID_FOCUS_ABSOLUTE;\r\n-\tctrl.value = value;\r\n-\tret = ioctl(vcmFd_, VIDIOC_S_CTRL, &ctrl);\r\n-\treturn ret;\r\n-}\r\n-\r\n /**\r\n * \\brief Determine the max contrast image and lens position. y_table is the\r\n * statictic data from IPU3 and is composed of low pass and high pass filtered\r\n@@ -263,10 +237,9 @@ void Af::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)\r\n \t\t\tif (focus_ > MaxFocusSteps_) {\r\n \t\t\t\t/* If reach the max step, move lens to the position and set \"focus stable\". */\r\n \t\t\t\tcontext.frameContext.af.stable = true;\r\n-\t\t\t\tvcmSet(context.frameContext.af.focus);\r\n \t\t\t} else {\r\n \t\t\t\tfocus_ += MinSearchStep_;\r\n-\t\t\t\tvcmSet(focus_);\r\n+\t\t\t\tcontext.frameContext.af.focus = focus_;\r\n \t\t\t}\r\n \t\t\tLOG(IPU3Af, Debug) << \"Focus searching max variance is: \"\r\n \t\t\t\t\t << context.frameContext.af.maxVariance\r\ndiff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\r\nindex d32d5184..b21084e9 100644\r\n--- a/src/ipa/ipu3/algorithms/af.h\r\n+++ b/src/ipa/ipu3/algorithms/af.h\r\n@@ -36,9 +36,6 @@ public:\r\n \tvoid process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\r\n \r\n private:\r\n-\tint vcmSet(int value);\r\n-\r\n-\tint vcmFd_;\r\n \t/* Used for focus scan. */\r\n \tuint32_t focus_;\r\n \t/* Recent AF statistic variance. */\r\n", "prefixes": [ "libcamera-devel", "5/5" ] }