Show a patch.

GET /api/patches/17931/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 17931,
    "url": "https://patchwork.libcamera.org/api/patches/17931/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17931/",
    "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": "<20221201145133.479794-3-umang.jain@ideasonboard.com>",
    "date": "2022-12-01T14:51:30",
    "name": "[libcamera-devel,2/5] libcamera: raspberrypi: Control the lens from pipeline",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "9ae84e0af53fd3a4d063ad9f0a18659e550c0d65",
    "submitter": {
        "id": 86,
        "url": "https://patchwork.libcamera.org/api/people/86/?format=api",
        "name": "Umang Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17931/mbox/",
    "series": [
        {
            "id": 3653,
            "url": "https://patchwork.libcamera.org/api/series/3653/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3653",
            "date": "2022-12-01T14:51:28",
            "name": "ipa: rapsberrypi: Introduce auto-focus (auto-mode)",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3653/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17931/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17931/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 E054ABE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  1 Dec 2022 14:52:45 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9C2D76333F;\n\tThu,  1 Dec 2022 15:52:45 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CF67163336\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  1 Dec 2022 15:52:43 +0100 (CET)",
            "from umang.jainideasonboard.com (unknown [210.186.188.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BDCE06D0;\n\tThu,  1 Dec 2022 15:52:42 +0100 (CET)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669906365;\n\tbh=sRr+TVmkOtBZrmMpxPYURb0t1dQR+ieK7x5VMfVjpD0=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=cDtZvMxuQaQMEIr91CrqlMV/7JY2HSuxIfRTTxpzsGzCOQ0qTrHAtEnAOe1y6M5ry\n\tumJJY01RaCnXSlEg7QbVpkG8YCC/Mz6syScv+wkae/BFDup29OfOn8mmLyijgf2Yu7\n\t7lb9oou/9pAAdAewAmzdMYFvHpjavsIZnUyutZrgAWapzWuPfJx3iCE+Tqwbma5eqy\n\t6txBCnFZGIm7bFr72+jgwTXF/YW09JuXmMk7uNm2kz7Yb/tM8q0HCPjmXniJi33h8H\n\taujHaUKgxf6frJV1y+KbZENvtA0K+tHEjkmgVp3N2Mz0pOBKVCz8nfQFcTVf4nEgOA\n\t0zmjz2c6oLVqQ==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669906363;\n\tbh=sRr+TVmkOtBZrmMpxPYURb0t1dQR+ieK7x5VMfVjpD0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ZRPkYmI6mgmhn5Zz4BOj9YpJkDYxaJmlH9MMdG17A9cFPQar/42cjyeJRWP1obO7/\n\t11MXaqSYKUZP3z24kfz6PstcJinzdYkHJkM7icwQhS7t15UcCogvfbcX5vLV7qpoh8\n\texqrjJGG5ha+ZraTI3xWVNR0qlI7KZm2GHxskSoI="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ZRPkYmI6\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu,  1 Dec 2022 22:51:30 +0800",
        "Message-Id": "<20221201145133.479794-3-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.38.1",
        "In-Reply-To": "<20221201145133.479794-1-umang.jain@ideasonboard.com>",
        "References": "<20221201145133.479794-1-umang.jain@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 2/5] libcamera: raspberrypi: Control the\n\tlens from pipeline",
        "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>",
        "From": "Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Umang Jain <umang.jain@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n\nThe lens focus is controled by a VCM, which is linked to the sensor\nusing the ancillary links.\nPass the control to the config info structure and make it possible to\nupdate by the IPA.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n---\n include/libcamera/ipa/raspberrypi.mojom         |  1 +\n .../pipeline/raspberrypi/raspberrypi.cpp        | 17 +++++++++++++++++\n 2 files changed, 18 insertions(+)",
    "diff": "diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nindex d53644fe..e01f0b2b 100644\n--- a/include/libcamera/ipa/raspberrypi.mojom\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -130,4 +130,5 @@ interface IPARPiEventInterface {\n \tembeddedComplete(uint32 bufferId);\n \tsetIspControls(libcamera.ControlList controls);\n \tsetDelayedControls(libcamera.ControlList controls);\n+\tsetLensControls(libcamera.ControlList controls);\n };\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 0e0b7194..911d5b55 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -32,6 +32,7 @@\n \n #include \"libcamera/internal/bayer_format.h\"\n #include \"libcamera/internal/camera.h\"\n+#include \"libcamera/internal/camera_lens.h\"\n #include \"libcamera/internal/camera_sensor.h\"\n #include \"libcamera/internal/delayed_controls.h\"\n #include \"libcamera/internal/device_enumerator.h\"\n@@ -209,6 +210,7 @@ public:\n \tvoid setDelayedControls(const ControlList &controls);\n \tvoid setSensorControls(ControlList &controls);\n \tvoid unicamTimeout();\n+\tvoid setLensControls(const ControlList &controls);\n \n \t/* bufferComplete signal handlers. */\n \tvoid unicamBufferDequeue(FrameBuffer *buffer);\n@@ -1551,6 +1553,7 @@ int RPiCameraData::loadIPA(ipa::RPi::IPAInitResult *result)\n \tipa_->embeddedComplete.connect(this, &RPiCameraData::embeddedComplete);\n \tipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);\n \tipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);\n+\tipa_->setLensControls.connect(this, &RPiCameraData::setLensControls);\n \n \t/*\n \t * The configuration (tuning file) is made from the sensor name unless\n@@ -1591,6 +1594,10 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::IPA\n \tentityControls.emplace(0, sensor_->controls());\n \tentityControls.emplace(1, isp_[Isp::Input].dev()->controls());\n \n+\tCameraLens *lens = sensor_->focusLens();\n+\tif (lens)\n+\t\tentityControls.emplace(2, lens->controls());\n+\n \t/* Always send the user transform to the IPA. */\n \tipaConfig.transform = static_cast<unsigned int>(config->transform);\n \n@@ -1807,6 +1814,16 @@ void RPiCameraData::setDelayedControls(const ControlList &controls)\n \thandleState();\n }\n \n+void RPiCameraData::setLensControls(const ControlList &ctrls)\n+{\n+\tCameraLens *lens = sensor_->focusLens();\n+\tif (!lens)\n+\t\treturn;\n+\n+\t/* \\todo Should we keep track of the latest value applied ? */\n+\tlens->setFocusPosition(ctrls.get(V4L2_CID_FOCUS_ABSOLUTE).get<int32_t>());\n+}\n+\n void RPiCameraData::setSensorControls(ControlList &controls)\n {\n \t/*\n",
    "prefixes": [
        "libcamera-devel",
        "2/5"
    ]
}