Show a patch.

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

{
    "id": 19698,
    "url": "https://patchwork.libcamera.org/api/patches/19698/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19698/",
    "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": "<20240313105645.120317-10-stefan.klug@ideasonboard.com>",
    "date": "2024-03-13T10:56:41",
    "name": "[08/12] libcamera: delayed_controls: add ctrls list to reset function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "c592a7eb40d1161a2c380dcd93954f688bcee1c8",
    "submitter": {
        "id": 184,
        "url": "https://patchwork.libcamera.org/api/people/184/?format=api",
        "name": "Stefan Klug",
        "email": "stefan.klug@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19698/mbox/",
    "series": [
        {
            "id": 4220,
            "url": "https://patchwork.libcamera.org/api/series/4220/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4220",
            "date": "2024-03-13T10:56:41",
            "name": null,
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4220/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19698/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19698/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 AAFDFC32C5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Mar 2024 10:57:13 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8830C62CA6;\n\tWed, 13 Mar 2024 11:57:08 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A064A62C91\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Mar 2024 11:56:54 +0100 (CET)",
            "from jasper.fritz.box (unknown\n\t[IPv6:2a00:6020:448c:6c00:9b07:31b5:38e1:e957])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2ED4B899;\n\tWed, 13 Mar 2024 11:56:32 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"XfpRMsV5\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1710327392;\n\tbh=3FfanLJUApKs1WDW9CpWtnIIjK3Qjfh5LEQCWvo9zTo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=XfpRMsV5IyxB7RyAsOVM/oNhOkCPhTxMUf1ABNS6gS56RCiLbTpMmQcJILGUUg/fO\n\t7gfd+j6loTxN1t8uo3/3beCqrgPwQEkK/6Imxip9+wxIP/f3A4KVfT5/eNXd9wJMg6\n\tz2a7LziEpP2rroxVyZ9axhiqo89TtougQ6cvOvhs=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH 08/12] libcamera: delayed_controls: add ctrls list to reset\n\tfunction",
        "Date": "Wed, 13 Mar 2024 11:56:41 +0100",
        "Message-Id": "<20240313105645.120317-10-stefan.klug@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.40.1",
        "In-Reply-To": "<20240313105645.120317-1-stefan.klug@ideasonboard.com>",
        "References": "<20240313105645.120317-1-stefan.klug@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "This makes it easier for the caller. There is often this pattern\n\n  sensor_->setControls(controls);\n  delayedControls_->reset();\n\nwhich can then be reduced to\n\n  delayedControls_->reset(controls);\n---\n include/libcamera/internal/delayed_controls.h |  2 +-\n src/libcamera/delayed_controls.cpp            | 14 +++++++++++++-\n 2 files changed, 14 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/delayed_controls.h b/include/libcamera/internal/delayed_controls.h\nindex 2738e8bf..a3063400 100644\n--- a/include/libcamera/internal/delayed_controls.h\n+++ b/include/libcamera/internal/delayed_controls.h\n@@ -27,7 +27,7 @@ public:\n \tDelayedControls(V4L2Device *device,\n \t\t\tconst std::unordered_map<uint32_t, ControlParams> &controlParams);\n \n-\tvoid reset();\n+\tvoid reset(ControlList *controls = nullptr);\n \n \tbool push(const ControlList &controls);\n \tbool pushForFrame(uint32_t sequence, const ControlList &controls);\ndiff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp\nindex c46e54d1..ac38eb64 100644\n--- a/src/libcamera/delayed_controls.cpp\n+++ b/src/libcamera/delayed_controls.cpp\n@@ -115,7 +115,7 @@ DelayedControls::DelayedControls(V4L2Device *device,\n  * Resets the state machine to a starting position based on control values\n  * retrieved from the device.\n  */\n-void DelayedControls::reset()\n+void DelayedControls::reset(ControlList *ctrls)\n {\n \tqueueIndex_ = 0;\n \t/* Frames up to maxDelay_ will be based on sensor init values. */\n@@ -126,6 +126,18 @@ void DelayedControls::reset()\n \tfor (auto const &param : controlParams_)\n \t\tids.push_back(param.first->id());\n \n+\tif (ctrls) {\n+\t\tdevice_->setControls(ctrls);\n+\n+\t\tLOG(DelayedControls, Debug) << \"reset:\";\n+\t\tauto idMap = ctrls->idMap();\n+\t\tif (idMap) {\n+\t\t\tfor (const auto &[id, value] : *ctrls) {\n+\t\t\t\tLOG(DelayedControls, Debug) << \"  \" << idMap->at(id)->name() << \" : \" << value.toString();\n+\t\t\t}\n+\t\t}\n+\t}\n+\n \tControlList controls = device_->getControls(ids);\n \n \t/* Seed the control queue with the controls reported by the device. */\n",
    "prefixes": [
        "08/12"
    ]
}