Show a patch.

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

{
    "id": 11303,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/11303/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11303/",
    "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": "<20210216085342.1012717-5-naush@raspberrypi.com>",
    "date": "2021-02-16T08:53:41",
    "name": "[libcamera-devel,v2,4/5] libcamera: delayed_controls: Remove spurious no-op queued controls",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d5da540b46784658fa283f12ea94ea96e4cd154e",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "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/11303/mbox/",
    "series": [
        {
            "id": 1694,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1694/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1694",
            "date": "2021-02-16T08:53:37",
            "name": "DelayedControls updates and fixes",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1694/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11303/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11303/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 02A14BD1EF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Feb 2021 08:53:54 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7983D637DC;\n\tTue, 16 Feb 2021 09:53:53 +0100 (CET)",
            "from mail-wm1-x330.google.com (mail-wm1-x330.google.com\n\t[IPv6:2a00:1450:4864:20::330])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C0F13637C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Feb 2021 09:53:50 +0100 (CET)",
            "by mail-wm1-x330.google.com with SMTP id n10so13671985wmq.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Feb 2021 00:53:50 -0800 (PST)",
            "from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\te1sm9300369wrd.44.2021.02.16.00.53.49\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 16 Feb 2021 00:53:49 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"UjaFdmGg\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=X83bfbi6hYD9/lgpvD3X6XcqhNR4s9wHCFQad4teq1A=;\n\tb=UjaFdmGg7PnL8TXTWuOWhrDQBnMdWdWnrFjEmQIcKPtJO2WPumqeOaSX1ratZjj4ZW\n\tjIJQJ7D461dgHrHDVEL0vXng6u5pkrOJ/C97YB8yP9L7jF99vprs2WW52TiLtNHajDez\n\tceQraCUwDeB1lPN5u6GRpcmLitdaPc/tqvT0xMnqhG8p1Kc6wxHTb2p6yl1IMq5ZczKb\n\tjsRISSSjWIpOTNsFGsiwWYBRLKfK60IKRR/wCFZ9wnAJiLJX/VJcdnn3k1V66MB2ayKl\n\thy40o0M34vbWiOZAKxgXP2b16dvlwAtpqPPE8hJ/UlKiO3Otyy9hyR4oAzwXij3t9C8z\n\toy5w==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=X83bfbi6hYD9/lgpvD3X6XcqhNR4s9wHCFQad4teq1A=;\n\tb=Kn3xJ57WBkCK0+TVRq4PXj0A9pRd+T7bTHeZ9aUWvj47wTIn0hpI7fYgCO3Ub6PXJ3\n\tXkj8q9w8UGnA/EPYS30JtjL9KGAxDuwuVlyiMUzqsXzZELPc/aBF8/FvEwK2OLJZTyuD\n\tKSEJXjm73Bf1sLtvy7h0K/TUvAjJ4gxX5yCt7purwR0r8A8zn8g1iEWVHGaF94haA492\n\t1kmJZv3lWWyBVYlb8dTFu3uF5JyYfnrOP1YTyTOVI2Ts5/KJnRRZkMrWdz+p+uu2bS7R\n\tL4jpVI7pwrpht0zW5HoyrbcjOxf4+96ETytOUyDqHS6C80Y9bGbQ4PVsO1yca8zfd1Oa\n\t5reg==",
        "X-Gm-Message-State": "AOAM531RxhGc4wbLmoPm7Wl+9J257Ejac+0R8fPLhGPScO0NOMuu5ZzT\n\tkdQsSnJNdftMm7mDABjFIiZkxtibK78JV6XB",
        "X-Google-Smtp-Source": "ABdhPJxJAWo4ugi121NZgQccpaEIlItxALapeLqAhiE3DiABhmJ2CmiS5JdgfT6Hnv15j4qxkOsrKQ==",
        "X-Received": "by 2002:a1c:5a54:: with SMTP id o81mr2352219wmb.50.1613465630243;\n\tTue, 16 Feb 2021 00:53:50 -0800 (PST)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 16 Feb 2021 08:53:41 +0000",
        "Message-Id": "<20210216085342.1012717-5-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210216085342.1012717-1-naush@raspberrypi.com>",
        "References": "<20210216085342.1012717-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2 4/5] libcamera: delayed_controls:\n\tRemove spurious no-op queued controls",
        "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=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "In DelayedControls::applyControls(), the controls queue would be\nextended via a no-op control push to fill the intermittent slots with\nunchanged control values. This is needed so that we read back unchanged\ncontrol values correctly on every frame.\n\nHowever, there was one additional no-op performed on every frame that is\nnot required, meaning that any controls queued by the pipeline handler\nwould have their write delayed by one further frame. The original\nStaggeredCtrl did not do this, as it only had one index to manage,\nwhereas DelayedControls uses two.\n\nRemove this last no-op push so that the pipeline_handler provided\ncontrols would be written on the very next frame if possible. As a\nconsequence, we must mark the control update as completed within the\nDelayedControls::applyControls() loop, otherwise it might get reused\nwhen cycling through the ring buffer.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReported-by: David Plowman <david.plowman@raspberrypi.com>\nFixes: 3d4b7b005911 (\"libcamera: delayed_controls: Add helper for controls that apply with a delay\")\n---\n src/libcamera/delayed_controls.cpp | 9 ++++++---\n 1 file changed, 6 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp\nindex 21dc3e164fe9..d1b79dc3570e 100644\n--- a/src/libcamera/delayed_controls.cpp\n+++ b/src/libcamera/delayed_controls.cpp\n@@ -225,11 +225,11 @@ void DelayedControls::applyControls(uint32_t sequence)\n \t * values are set in time to satisfy the sensor delay.\n \t */\n \tControlList out(device_->controls());\n-\tfor (const auto &ctrl : values_) {\n+\tfor (auto &ctrl : values_) {\n \t\tconst ControlId *id = ctrl.first;\n \t\tunsigned int delayDiff = maxDelay_ - controlParams_[id].delay;\n \t\tunsigned int index = std::max<int>(0, writeCount_ - delayDiff);\n-\t\tconst Info &info = ctrl.second[index];\n+\t\tInfo &info = ctrl.second[index];\n \n \t\tif (info.updated) {\n \t\t\tif (controlParams_[id].priorityWrite) {\n@@ -252,12 +252,15 @@ void DelayedControls::applyControls(uint32_t sequence)\n \t\t\t\t<< \"Setting \" << id->name()\n \t\t\t\t<< \" to \" << info.toString()\n \t\t\t\t<< \" at index \" << index;\n+\n+\t\t\t/* Done with this update, so mark as completed. */\n+\t\t\tinfo.updated = false;\n \t\t}\n \t}\n \n \twriteCount_++;\n \n-\twhile (writeCount_ >= queueCount_) {\n+\twhile (writeCount_ > queueCount_) {\n \t\tLOG(DelayedControls, Debug)\n \t\t\t<< \"Queue is empty, auto queue no-op.\";\n \t\tpush({});\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "4/5"
    ]
}