Show a patch.

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

{
    "id": 16529,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16529/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16529/",
    "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": "<20220704133751.1582959-1-kieran.bingham@ideasonboard.com>",
    "date": "2022-07-04T13:37:51",
    "name": "[libcamera-devel] delayed_controls: Remove reduandant firstSequence_",
    "commit_ref": "6f539a6d2fa992c90782a7b7077cd009fce4457b",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "35e03d19c156ad9503ea985e973e53500d2a6233",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16529/mbox/",
    "series": [
        {
            "id": 3246,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3246/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3246",
            "date": "2022-07-04T13:37:51",
            "name": "[libcamera-devel] delayed_controls: Remove reduandant firstSequence_",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3246/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16529/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16529/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 CD017BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Jul 2022 13:37:56 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 120106564E;\n\tMon,  4 Jul 2022 15:37:56 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DDB5061FB1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Jul 2022 15:37:54 +0200 (CEST)",
            "from Monstersaurus.ksquared.org.uk.beta.tailscale.net\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 45C15802;\n\tMon,  4 Jul 2022 15:37:54 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656941876;\n\tbh=OkEQFijXyOmcLQ9BgepeJ7LuywuhYCLuPGZQXSf3CVA=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=U7TLq6hCJsQ5PEE3DGIIiHaaAK6HbuiUyDpXfnDwivHp0LsZWjnqEnqV+A2qzBAWu\n\tsCKAGgHpPFvBzbHX2cgPr5fSPBcKGxU8+adT/c8RTDqM5hL9OWg4A31EN0I3WuE2Sk\n\t/WyLIUPt37RacJbvn/tYZIVTGEWNPMF820LIs2yB3NiySYWGfcZtN2Ue4MIzXfz8on\n\tevALBcNAtZAUxDetpNf6qBvy1Rizhctr6H5y8aaoVqKtm7n2CLDQ3j3geu2D+SkDZu\n\tXNSYyOK3Tx+dy4RZbUCKXBhUEGjENxOVRR5zPlGYZn9JBtoCDBr30EREbOkgs1YeuR\n\t9EVuPQSRdyykA==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656941874;\n\tbh=OkEQFijXyOmcLQ9BgepeJ7LuywuhYCLuPGZQXSf3CVA=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=OdQmXsldDXvzoOOLkQC1qwn+3cofVPJHkMXQrjoo1lkfFOCxmqDIoyKDgIIA4RzxG\n\tIAG/+hWYKGK5CRrDqhiZFAPFPijG6CxfBRTVrRUPeX/O+ILNqfgvgN/iUg3hTCyVIn\n\tD1IvC+tNoZjubren/CVxFcYQx1gVarpkv4OaC+CU="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"OdQmXsld\"; dkim-atps=neutral",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Mon,  4 Jul 2022 14:37:51 +0100",
        "Message-Id": "<20220704133751.1582959-1-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] delayed_controls: Remove reduandant\n\tfirstSequence_",
        "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>",
        "From": "Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The DelayedControls implementation tracked the sequence numbers to\ndetermine the offset if a device did not commence with a sequence number\nof 0.\n\nThis guarantee is now handled by the V4L2VideoDevice.\n\nRemove the firstSequence_ offset and the corresponding running_ flag\nwhich was used to track setting firstSequence_ from the DelayedControls.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n\nThis will conflict with Jacopo's series, but is still applicable\nconceptually, whichever gets to go first.\n\n include/libcamera/internal/delayed_controls.h |  3 ---\n src/libcamera/delayed_controls.cpp            | 12 ++----------\n 2 files changed, 2 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/delayed_controls.h b/include/libcamera/internal/delayed_controls.h\nindex 703fdb66bc27..f560c823d4e9 100644\n--- a/include/libcamera/internal/delayed_controls.h\n+++ b/include/libcamera/internal/delayed_controls.h\n@@ -72,9 +72,6 @@ private:\n \tstd::unordered_map<const ControlId *, ControlParams> controlParams_;\n \tunsigned int maxDelay_;\n \n-\tbool running_;\n-\tuint32_t firstSequence_;\n-\n \tuint32_t queueCount_;\n \tuint32_t writeCount_;\n \t/* \\todo Evaluate if we should index on ControlId * or unsigned int */\ndiff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp\nindex 9667187e9a4a..527c319113ac 100644\n--- a/src/libcamera/delayed_controls.cpp\n+++ b/src/libcamera/delayed_controls.cpp\n@@ -115,8 +115,6 @@ DelayedControls::DelayedControls(V4L2Device *device,\n  */\n void DelayedControls::reset()\n {\n-\trunning_ = false;\n-\tfirstSequence_ = 0;\n \tqueueCount_ = 1;\n \twriteCount_ = 0;\n \n@@ -204,8 +202,7 @@ bool DelayedControls::push(const ControlList &controls)\n  */\n ControlList DelayedControls::get(uint32_t sequence)\n {\n-\tuint32_t adjustedSeq = sequence - firstSequence_;\n-\tunsigned int index = std::max<int>(0, adjustedSeq - maxDelay_);\n+\tunsigned int index = std::max<int>(0, sequence - maxDelay_);\n \n \tControlList out(device_->controls());\n \tfor (const auto &ctrl : values_) {\n@@ -236,11 +233,6 @@ void DelayedControls::applyControls(uint32_t sequence)\n {\n \tLOG(DelayedControls, Debug) << \"frame \" << sequence << \" started\";\n \n-\tif (!running_) {\n-\t\tfirstSequence_ = sequence;\n-\t\trunning_ = true;\n-\t}\n-\n \t/*\n \t * Create control list peeking ahead in the value queue to ensure\n \t * values are set in time to satisfy the sensor delay.\n@@ -279,7 +271,7 @@ void DelayedControls::applyControls(uint32_t sequence)\n \t\t}\n \t}\n \n-\twriteCount_ = sequence - firstSequence_ + 1;\n+\twriteCount_ = sequence + 1;\n \n \twhile (writeCount_ > queueCount_) {\n \t\tLOG(DelayedControls, Debug)\n",
    "prefixes": [
        "libcamera-devel"
    ]
}