Show a patch.

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

{
    "id": 11416,
    "url": "https://patchwork.libcamera.org/api/patches/11416/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11416/",
    "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": "<20210301133159.4179129-5-naush@raspberrypi.com>",
    "date": "2021-03-01T13:31:58",
    "name": "[libcamera-devel,v3,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/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11416/mbox/",
    "series": [
        {
            "id": 1734,
            "url": "https://patchwork.libcamera.org/api/series/1734/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1734",
            "date": "2021-03-01T13:31:54",
            "name": "DelayedControls updates and fixes",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1734/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11416/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11416/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 3D8A7BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Mar 2021 13:32:12 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0DBD568A9C;\n\tMon,  1 Mar 2021 14:32:12 +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 D3F2960521\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Mar 2021 14:32:09 +0100 (CET)",
            "by mail-wm1-x330.google.com with SMTP id u11so8358619wmq.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 01 Mar 2021 05:32:09 -0800 (PST)",
            "from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\ta75sm11263630wme.10.2021.03.01.05.32.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 01 Mar 2021 05:32:07 -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=\"SsH17KWR\"; 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=JVxr9wPhqpMPUC/muNAswAu0GDAhUwE5M/mXi2ElBc4=;\n\tb=SsH17KWR1VrOrWpagONYmtdauE4n0jIkU2e9jynDEl8lGyR62MsP2m1RP+tH+tJbsW\n\tPKHA9BDdLEqpslKZ8hQQ2vqH8v+GYuGD5OK5Z0oGMlGvLCuU32++YNrX1K8gNKnMZsrd\n\tFDA+dAmzekUQ3MkONn1DPx056Cm84AStH7IDCP2+xd7bVoKioh1M55SxjE1X4PY+tYRe\n\tIagt0rjJLAU4oN9uratvDQcHrJWiP589/k17LbSrWwJcQv/KafcnyrfThnoCYilsoZlC\n\t5IZa+vYQkEuV7zVv+sG3DHiDwCRAJPv2jxE9oGjWGNBRyYbjYafWQNcCCiKW4CDW5kJ1\n\tJ2FA==",
        "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=JVxr9wPhqpMPUC/muNAswAu0GDAhUwE5M/mXi2ElBc4=;\n\tb=rqKdPaLyCr5dVW7O3VLaZcurbLGXFZKQ22uAzgxXvXrSDTb6G0iGrdm3bJK/bLPUoD\n\tnaGfXG/AmWPOKcaC5nhCZpLMBPdetgJD9/0qoHElyKcakadZ6jGVZR/9LbFRphxHn4Ef\n\tg86pqctzz+zubAfNMD8Z+g2IcoRVJxHNueBqAa1wwueiwVByBE0mNPWfba+rFLmtBwpK\n\tA3lfT5mwEZ+b8Hp6Ux3wznB5mbaBN7G8MYZKvQjBggznzmazQLAsmsBFe6Jn9XVKrdIE\n\tB+sVpFLwH33khezpKlYKCxpoE8UnSgRGNMykwlg2HwRP+x9Uv6QoOs7dj7iM9RtnI5/c\n\thkag==",
        "X-Gm-Message-State": "AOAM531CvK83NPnehpTJ4P4wpNtzcnbx/G2bm3pUtROzzKqWNhiJkCwK\n\tdvewYF8FF2eaw2FTgXs63I/x8oN62SoIn8EC",
        "X-Google-Smtp-Source": "ABdhPJxcc31Nf/BE2WVwLzIrRib0FO+kZ3ooZjWEl+0fg6l1vMed8WFhPthSL3YqAVgRIp4E2tUwGQ==",
        "X-Received": "by 2002:a7b:c92d:: with SMTP id\n\th13mr11028042wml.96.1614605528613; \n\tMon, 01 Mar 2021 05:32:08 -0800 (PST)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  1 Mar 2021 13:31:58 +0000",
        "Message-Id": "<20210301133159.4179129-5-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210301133159.4179129-1-naush@raspberrypi.com>",
        "References": "<20210301133159.4179129-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v3 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\")\nTested-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\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 f6d761d1cc41..5a05741c0285 100644\n--- a/src/libcamera/delayed_controls.cpp\n+++ b/src/libcamera/delayed_controls.cpp\n@@ -226,11 +226,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@@ -253,12 +253,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",
        "v3",
        "4/5"
    ]
}