Show a patch.

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

{
    "id": 26324,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/26324/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/26324/",
    "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": "<20260324151714.3345-2-david.plowman@raspberrypi.com>",
    "date": "2026-03-24T14:32:07",
    "name": "[v1,1/3] pipeline: rpi: Simplify delayed controls",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b5e667d1eb5a73cdf711f7d2f5b52680fe411e77",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/1.1/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/26324/mbox/",
    "series": [
        {
            "id": 5842,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5842/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5842",
            "date": "2026-03-24T14:32:06",
            "name": "Atomic control lists on Raspberry Pi",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5842/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/26324/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/26324/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 A40A3C32DE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 24 Mar 2026 15:17:22 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DFD7762790;\n\tTue, 24 Mar 2026 16:17:20 +0100 (CET)",
            "from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com\n\t[IPv6:2a00:1450:4864:20::32b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F0E566277D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Mar 2026 16:17:18 +0100 (CET)",
            "by mail-wm1-x32b.google.com with SMTP id\n\t5b1f17b1804b1-486ff3a0fc1so35172645e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Mar 2026 08:17:18 -0700 (PDT)",
            "from davidp-pi5.pitowers.org\n\t([2a00:1098:3142:1f:88ea:c658:5b20:5e46])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-487116c44bfsm63826065e9.9.2026.03.24.08.17.17\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 24 Mar 2026 08:17:17 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"lHZ8tF6X\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1774365438; x=1774970238;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=6aADIWBAWxWqOxkg3S/oIUwyQIh5VxmPUzgQyo+Vg5M=;\n\tb=lHZ8tF6X3107F424gmPji4pT542umVZgTImJvuu4tZUEt7hBRqW6SGtzSHY/sWj+7q\n\tAs+IQJrrkY+2Z2MtuanaEmYyvbTfM+OnCwr+EU8JMUxfoFyZkQmx+JC2v5yXB8qPb5HX\n\tKQQPwWcK8zOEB+4i01ZWfYZD4IXmnOrsOfGR2WrVqcf7xqRIJ3RI2I/u4/zejOd/Pbhl\n\te3mgVj3TOnkn52YCopCH9OZFjKziscDqFiToQ6QY0TuPBBf1ZNnUv2OJQ+ULdyQOok2F\n\te87YnQR1EGappiVa864zZWogbmibK7r8eZPkNZFaJBPFfZ6/8Jt526hnEoD6xDhT1Ig5\n\twRCA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1774365438; x=1774970238;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=6aADIWBAWxWqOxkg3S/oIUwyQIh5VxmPUzgQyo+Vg5M=;\n\tb=SmAikSdcZ4xjWfyHiE7ONlKpdUdfwyce4d7fm1bVzxg3Ua6wTK0XW0pnilKu3FM/1F\n\tOnrkrtpDLdRS/+E353h9vzWEiwwMdxc4RjhMD6y8yubBgsRYZkyXkTyPbolh7hWIpsof\n\tb37j3ZpOgySlHML6UsINtGzMYQTtXkcNXqOFwZfExLqz7scxoXE04MxsWW2cXqs1KPe1\n\tT0AvQTVs98mGrDw6eorpokr4/Pw2/1scV0iA8jLcfQGnduwC8JpSbi8hXHgT/TCFv/x/\n\tgy502HzR88ELZ2zk1DRfwZQaNOov8thkIZiloQA4C+uCfDJacpjj6s/KaO9pFMMS+6si\n\tHDwQ==",
        "X-Gm-Message-State": "AOJu0YzOkEz0Ogu1S9WSTU2KuLY07fn5h44BdiEQebITog3aZrzMa7Da\n\tCnaPKm6FRrjtHdiw1VG2sViIrPsVCFZv7TT2aeiRSImketQiMysogvU6EiABL/bJhgqxift5VPx\n\tMYXyZ",
        "X-Gm-Gg": "ATEYQzxVfWe8+nH3LHfPIhTJpdI7LH9ffRLJwqIdYBa+jCNcZX2Y5MCFKkYW8s01+Cf\n\tBRjzdt0Kg+MFYJPGSyDLiiqfTI3HR86xjb7HORrBvAK4+N35BjGfTImP67WPiTDBqzWIV7F6Hv7\n\t04pHqaFpQLthYLDcKiY7pjRtF6D/5FjwGWolWrja5FaMTQje2s8MuSSfKWdP439ougtvVeBU8d8\n\tlAy8yGQB1kjuE14t11bU+AOy/IRXNm3e57QX9mAkCcUZC9Rf7Zd3hh1S2eiyo3riq8TAmrzHAC7\n\t+zcj2QrxpZXCH3zqWGpRZoEcMcYaoezkyLW03oDyrywk5JaFcezIxEdY86YSR5GiJABF0DM81BK\n\tQ6J5SphQNvWRd/XGLVP4EDVgXYTYEu+9IGb+0nfOScA5Nn5KFfHCyR25B7Glp7rwfqonWWZuxUV\n\tuQQNm7+o1l0sH9v4P6XyX9G8WqQb0S4Utez4ZB49NSpqEKhh/0wsA4J+xvLHYJWczeyKeqNK6uW\n\tQEcJeB0S+gaZwmgF9OOf7StXPrxsmj4t/NFpiCJDg==",
        "X-Received": "by 2002:a05:600c:1d02:b0:487:716:2fa2 with SMTP id\n\t5b1f17b1804b1-48716039accmr1911365e9.16.1774365438088; \n\tTue, 24 Mar 2026 08:17:18 -0700 (PDT)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "David Plowman <david.plowman@raspberrypi.com>",
        "Subject": "[PATCH v1 1/3] pipeline: rpi: Simplify delayed controls",
        "Date": "Tue, 24 Mar 2026 14:32:07 +0000",
        "Message-ID": "<20260324151714.3345-2-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.47.3",
        "In-Reply-To": "<20260324151714.3345-1-david.plowman@raspberrypi.com>",
        "References": "<20260324151714.3345-1-david.plowman@raspberrypi.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": "The queueCount field in the DelayedControls is actually\nredundant. Remove it.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n .../pipeline/rpi/common/delayed_controls.cpp  | 22 +++++++++----------\n .../pipeline/rpi/common/delayed_controls.h    |  1 -\n 2 files changed, 10 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rpi/common/delayed_controls.cpp b/src/libcamera/pipeline/rpi/common/delayed_controls.cpp\nindex 19c71946..c06bd784 100644\n--- a/src/libcamera/pipeline/rpi/common/delayed_controls.cpp\n+++ b/src/libcamera/pipeline/rpi/common/delayed_controls.cpp\n@@ -119,7 +119,6 @@ DelayedControls::DelayedControls(V4L2Device *device,\n  */\n void DelayedControls::reset(unsigned int cookie)\n {\n-\tqueueCount_ = 1;\n \twriteCount_ = 0;\n \tcookies_[0] = cookie;\n \n@@ -155,8 +154,8 @@ bool DelayedControls::push(const ControlList &controls, const unsigned int cooki\n {\n \t/* Copy state from previous frame. */\n \tfor (auto &ctrl : values_) {\n-\t\tInfo &info = ctrl.second[queueCount_];\n-\t\tinfo = values_[ctrl.first][queueCount_ - 1];\n+\t\tInfo &info = ctrl.second[writeCount_];\n+\t\tinfo = values_[ctrl.first][writeCount_ - 1];\n \t\tinfo.updated = false;\n \t}\n \n@@ -175,18 +174,17 @@ bool DelayedControls::push(const ControlList &controls, const unsigned int cooki\n \t\tif (controlParams_.find(id) == controlParams_.end())\n \t\t\treturn false;\n \n-\t\tInfo &info = values_[id][queueCount_];\n+\t\tInfo &info = values_[id][writeCount_];\n \n \t\tinfo = Info(control.second);\n \n \t\tLOG(RPiDelayedControls, Debug)\n \t\t\t<< \"Queuing \" << id->name()\n \t\t\t<< \" to \" << info.toString()\n-\t\t\t<< \" at index \" << queueCount_;\n+\t\t\t<< \" at index \" << writeCount_;\n \t}\n \n-\tcookies_[queueCount_] = cookie;\n-\tqueueCount_++;\n+\tcookies_[writeCount_] = cookie;\n \n \treturn true;\n }\n@@ -277,12 +275,12 @@ void DelayedControls::applyControls(uint32_t sequence)\n \t\t}\n \t}\n \n-\twriteCount_ = sequence + 1;\n-\n-\twhile (writeCount_ > queueCount_) {\n+\twhile (writeCount_ < sequence + 1) {\n+\t\twriteCount_++;\n \t\tLOG(RPiDelayedControls, Debug)\n-\t\t\t<< \"Queue is empty, auto queue no-op.\";\n-\t\tpush({}, cookies_[queueCount_ - 1]);\n+\t\t\t<< \"Pushing noop with for index \" << writeCount_\n+\t\t\t<< \" with cookie \" << cookies_[writeCount_ - 1];\n+\t\tpush({}, cookies_[writeCount_ - 1]);\n \t}\n \n \tdevice_->setControls(&out);\ndiff --git a/src/libcamera/pipeline/rpi/common/delayed_controls.h b/src/libcamera/pipeline/rpi/common/delayed_controls.h\nindex 487b0057..48ad5a0f 100644\n--- a/src/libcamera/pipeline/rpi/common/delayed_controls.h\n+++ b/src/libcamera/pipeline/rpi/common/delayed_controls.h\n@@ -76,7 +76,6 @@ private:\n \tstd::unordered_map<const ControlId *, ControlParams> controlParams_;\n \tunsigned int maxDelay_;\n \n-\tuint32_t queueCount_;\n \tuint32_t writeCount_;\n \tstd::unordered_map<const ControlId *, RingBuffer<Info>> values_;\n \tRingBuffer<unsigned int> cookies_;\n",
    "prefixes": [
        "v1",
        "1/3"
    ]
}