Show a patch.

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

{
    "id": 19710,
    "url": "https://patchwork.libcamera.org/api/patches/19710/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19710/",
    "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": "<20240313121223.138150-9-stefan.klug@ideasonboard.com>",
    "date": "2024-03-13T12:12:19",
    "name": "[v2,08/12] libcamera: delayed_controls: Add ctrls list parameter 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/19710/mbox/",
    "series": [
        {
            "id": 4221,
            "url": "https://patchwork.libcamera.org/api/series/4221/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4221",
            "date": "2024-03-13T12:12:11",
            "name": "Preparation for per-frame-controls and initial tests",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/4221/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19710/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19710/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 8CBDAC32C3\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Mar 2024 12:13:02 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8342162CA6;\n\tWed, 13 Mar 2024 13:13:01 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ED20762C9B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Mar 2024 13:12:45 +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 5BA92899;\n\tWed, 13 Mar 2024 13:12:23 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"q+UrVthQ\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1710331943;\n\tbh=sO0A/gemJARVBZjvuPwdylUf4HYJ/EZt5BDp1fF+NCs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=q+UrVthQG3//1xRgjJc2ssxbuS71ale86Nt94Z2OIW8wBX9b+oK149WKZuUQWw3av\n\tQVJDtzFTv+Ep2AYNG3VrHFIrIDYDHtfAgJ/pYxTtPd95BQMZeOfnpk23de1BKSH5CQ\n\t5INR5Q5z7wHKyDGvzwzqzSqrj1bm/kAQ1tgKudYw=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH v2 08/12] libcamera: delayed_controls: Add ctrls list\n\tparameter to reset() function",
        "Date": "Wed, 13 Mar 2024 13:12:19 +0100",
        "Message-Id": "<20240313121223.138150-9-stefan.klug@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.40.1",
        "In-Reply-To": "<20240313121223.138150-1-stefan.klug@ideasonboard.com>",
        "References": "<20240313121223.138150-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>",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "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\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\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": [
        "v2",
        "08/12"
    ]
}