Show a patch.

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

{
    "id": 15463,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15463/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15463/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20220317091937.168527-1-jeanmichel.hautbois@ideasonboard.com>",
    "date": "2022-03-17T09:19:37",
    "name": "[libcamera-devel,v2,1/2] libcamera: raspberrypi: Control the lens from pipeline",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "9f169d49ac64ff6bf670a7e3c6037101dbf9f4f4",
    "submitter": {
        "id": 75,
        "url": "https://patchwork.libcamera.org/api/1.1/people/75/?format=api",
        "name": "Jean-Michel Hautbois",
        "email": "jeanmichel.hautbois@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/15463/mbox/",
    "series": [
        {
            "id": 2969,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2969/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2969",
            "date": "2022-03-17T09:19:37",
            "name": "[libcamera-devel,v2,1/2] libcamera: raspberrypi: Control the lens from pipeline",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2969/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15463/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15463/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\r\n\t[92.243.16.209])\r\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D564DBF415\r\n\tfor <parsemail@patchwork.libcamera.org>;\r\n\tThu, 17 Mar 2022 09:20:40 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\r\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 15B88604DC;\r\n\tThu, 17 Mar 2022 10:20:40 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\r\n\t[213.167.242.64])\r\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 366D0604DB\r\n\tfor <libcamera-devel@lists.libcamera.org>;\r\n\tThu, 17 Mar 2022 10:20:38 +0100 (CET)",
            "from tatooine.ideasonboard.com (unknown\r\n\t[IPv6:2a01:e0a:169:7140:2f87:7946:75e2:1cf1])\r\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CE710493;\r\n\tThu, 17 Mar 2022 10:20:37 +0100 (CET)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\r\n\ts=mail; t=1647508840;\r\n\tbh=Q8iGi+LQryGFePvlcMQyHcRls0AQ0SqTr99aoozW7kE=;\r\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\r\n\tList-Help:List-Subscribe:From:Reply-To:From;\r\n\tb=jirfgYchQZon+BgvAq4RRbi1aLZxjBjOCvhJkWf7m1bUyy8FE9qfdjWj31W1v429z\r\n\ts6HTOj9pB1zMSA39UARyUmfU8HEtE2C5LFo8S0fSwamZheSwK61EP905uulV9yWYPr\r\n\tOVHYQNn3XKDfBXIupAtMCnTj527S5b1JOZ5HePmmXqQUji/m4PVKJ8KgfpO8QJoROu\r\n\t8nk8wLdgbXMMhbB2xxNU8kssyKW3TpXRgIVjt1NiZ/Tn8awrrMyfRkIXHmQtWVJf1u\r\n\tlTwFC37nSyuvp8C0lAhtX8rsisIhXxIb3QrZnNQEBmGtYWKoZfrAgGtjJHtimseEta\r\n\tBW8kmwtwRWeAQ==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\r\n\ts=mail; t=1647508837;\r\n\tbh=Q8iGi+LQryGFePvlcMQyHcRls0AQ0SqTr99aoozW7kE=;\r\n\th=From:To:Cc:Subject:Date:From;\r\n\tb=GBph0MKMLpvIcDtqvNUo5HRgVijJpw9V6ShNbLWFxnDfT0A9Rz8Z3c6M5Mq2PenE4\r\n\tdK1e8DxfOynyhZEF/3vz048tGICa1CGAhNCXNFRndngQy0xuxXILqydVgS8EanLP4B\r\n\tKaRbJaeZyODdt+fzCXW9OA2ZIg7uS9Sam/Wxf5CM="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \r\n\tunprotected) header.d=ideasonboard.com\r\n\theader.i=@ideasonboard.com\r\n\theader.b=\"GBph0MKM\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 17 Mar 2022 10:19:37 +0100",
        "Message-Id": "<20220317091937.168527-1-jeanmichel.hautbois@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.32.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 1/2] libcamera: raspberrypi: Control\r\n\tthe lens 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>,\r\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>,\r\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "From": "Jean-Michel Hautbois via libcamera-devel\r\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The 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\r\nindex acd3cafe..0c3922b0 100644\r\n--- a/include/libcamera/ipa/raspberrypi.mojom\r\n+++ b/include/libcamera/ipa/raspberrypi.mojom\r\n@@ -125,4 +125,5 @@ interface IPARPiEventInterface {\r\n \tembeddedComplete(uint32 bufferId);\r\n \tsetIspControls(libcamera.ControlList controls);\r\n \tsetDelayedControls(libcamera.ControlList controls);\r\n+\tsetLensControls(libcamera.ControlList controls);\r\n };\r\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\r\nindex c2230199..41be10ff 100644\r\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\r\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\r\n@@ -33,6 +33,7 @@\r\n \r\n #include \"libcamera/internal/bayer_format.h\"\r\n #include \"libcamera/internal/camera.h\"\r\n+#include \"libcamera/internal/camera_lens.h\"\r\n #include \"libcamera/internal/camera_sensor.h\"\r\n #include \"libcamera/internal/delayed_controls.h\"\r\n #include \"libcamera/internal/device_enumerator.h\"\r\n@@ -202,6 +203,7 @@ public:\r\n \tvoid setIspControls(const ControlList &controls);\r\n \tvoid setDelayedControls(const ControlList &controls);\r\n \tvoid setSensorControls(ControlList &controls);\r\n+\tvoid setLensControls(const ControlList &controls);\r\n \r\n \t/* bufferComplete signal handlers. */\r\n \tvoid unicamBufferDequeue(FrameBuffer *buffer);\r\n@@ -1483,6 +1485,7 @@ int RPiCameraData::loadIPA(ipa::RPi::SensorConfig *sensorConfig)\r\n \tipa_->embeddedComplete.connect(this, &RPiCameraData::embeddedComplete);\r\n \tipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);\r\n \tipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);\r\n+\tipa_->setLensControls.connect(this, &RPiCameraData::setLensControls);\r\n \r\n \t/*\r\n \t * The configuration (tuning file) is made from the sensor name unless\r\n@@ -1519,6 +1522,10 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\r\n \tentityControls.emplace(0, sensor_->controls());\r\n \tentityControls.emplace(1, isp_[Isp::Input].dev()->controls());\r\n \r\n+\tCameraLens *lens = sensor_->focusLens();\r\n+\tif (lens)\r\n+\t\tentityControls.emplace(2, lens->controls());\r\n+\r\n \t/* Always send the user transform to the IPA. */\r\n \tipaConfig.transform = static_cast<unsigned int>(config->transform);\r\n \r\n@@ -1735,6 +1742,16 @@ void RPiCameraData::setDelayedControls(const ControlList &controls)\r\n \thandleState();\r\n }\r\n \r\n+void RPiCameraData::setLensControls(const ControlList &controls)\r\n+{\r\n+\tControlList ctrls = controls;\r\n+\r\n+\tCameraLens *lens = sensor_->focusLens();\r\n+\tif (lens)\r\n+\t\tlens->setFocusPosition(ctrls.get(V4L2_CID_FOCUS_ABSOLUTE).get<int32_t>());\r\n+\thandleState();\r\n+}\r\n+\r\n void RPiCameraData::setSensorControls(ControlList &controls)\r\n {\r\n \t/*",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "1/2"
    ]
}