Show a patch.

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

{
    "id": 10485,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10485/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10485/",
    "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": "<20201123221234.485933-6-niklas.soderlund@ragnatech.se>",
    "date": "2020-11-23T22:12:31",
    "name": "[libcamera-devel,v3,5/8] libcamera: camera_sensor: Expose a DelayedControls interface",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "ee47021f1e884b5288caf4ab35e48294e1b2bccb",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": {
        "id": 16,
        "url": "https://patchwork.libcamera.org/api/1.1/users/16/?format=api",
        "username": "neg",
        "first_name": "Niklas",
        "last_name": "Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "mbox": "https://patchwork.libcamera.org/patch/10485/mbox/",
    "series": [
        {
            "id": 1478,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1478/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1478",
            "date": "2020-11-23T22:12:26",
            "name": "libcamera: Add helper for controls that take effect with a delay",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1478/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10485/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10485/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 077EEBE177\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 23 Nov 2020 22:12:55 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CC04063409;\n\tMon, 23 Nov 2020 23:12:54 +0100 (CET)",
            "from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9D624633F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Nov 2020 23:12:50 +0100 (CET)",
            "from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de\n\t[79.202.36.88])\n\tby bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid 27ec7f73-2dd8-11eb-a076-005056917f90;\n\tMon, 23 Nov 2020 23:06:37 +0100 (CET)"
        ],
        "X-Halon-ID": "27ec7f73-2dd8-11eb-a076-005056917f90",
        "Authorized-sender": "niklas.soderlund@fsdn.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org,\n\tnaush@raspberrypi.com",
        "Date": "Mon, 23 Nov 2020 23:12:31 +0100",
        "Message-Id": "<20201123221234.485933-6-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.29.2",
        "In-Reply-To": "<20201123221234.485933-1-niklas.soderlund@ragnatech.se>",
        "References": "<20201123221234.485933-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v3 5/8] libcamera: camera_sensor: Expose a\n\tDelayedControls interface",
        "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>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Expose the optional DelayedControls interface to pipeline handlers. If\nused by a pipeline generic delays are used. In the future the delay\nvalues should be fetched to match the specific sensor module, either\nfrom a new kernel interface or worst case a sensors database.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/libcamera/internal/camera_sensor.h |  5 ++++\n src/libcamera/camera_sensor.cpp            | 31 ++++++++++++++++++++++\n 2 files changed, 36 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\nindex b9eba89f00fba882..6be1cfd49134c534 100644\n--- a/include/libcamera/internal/camera_sensor.h\n+++ b/include/libcamera/internal/camera_sensor.h\n@@ -14,6 +14,7 @@\n #include <libcamera/controls.h>\n #include <libcamera/geometry.h>\n \n+#include \"libcamera/internal/delayed_controls.h\"\n #include \"libcamera/internal/formats.h\"\n #include \"libcamera/internal/log.h\"\n #include \"libcamera/internal/v4l2_subdevice.h\"\n@@ -61,6 +62,8 @@ public:\n \tControlList getControls(const std::vector<uint32_t> &ids);\n \tint setControls(ControlList *ctrls);\n \n+\tDelayedControls *delayedContols();\n+\n \tconst ControlList &properties() const { return properties_; }\n \tint sensorInfo(CameraSensorInfo *info) const;\n \n@@ -83,6 +86,8 @@ private:\n \tstd::vector<Size> sizes_;\n \n \tControlList properties_;\n+\n+\tstd::unique_ptr<DelayedControls> delayedControls_;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 935de528c4963453..6c92c97f4cc2547a 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -493,6 +493,37 @@ int CameraSensor::setControls(ControlList *ctrls)\n \treturn subdev_->setControls(ctrls);\n }\n \n+/**\n+ * \\brief Get the sensors delayed controls interface\n+ *\n+ * Access the sensors delayed controls interface. This interface aids pipelines\n+ * keeping tack of controls that needs time to take effect. The interface is\n+ * optional to use and does not interact with setControls() and getControls()\n+ * that operates directly on the sensor device.\n+ *\n+ * \\sa DelayedControls\n+ * \\return The delayed controls interface\n+ */\n+DelayedControls *CameraSensor::delayedContols()\n+{\n+\tif (!delayedControls_) {\n+\t\t/*\n+\t\t * \\todo Read dealy values from the sensor itself or from a\n+\t\t * a sensor database. For now use generic values taken from\n+\t\t * the Raspberry Pi and listed as generic values.\n+\t\t */\n+\t\tstd::unordered_map<uint32_t, unsigned int> delays = {\n+\t\t\t{ V4L2_CID_ANALOGUE_GAIN, 1 },\n+\t\t\t{ V4L2_CID_EXPOSURE, 2 },\n+\t\t};\n+\n+\t\tdelayedControls_ =\n+\t\t\tstd::make_unique<DelayedControls>(subdev_.get(), delays);\n+\t}\n+\n+\treturn delayedControls_.get();\n+}\n+\n /**\n  * \\brief Assemble and return the camera sensor info\n  * \\param[out] info The camera sensor info\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "5/8"
    ]
}