Show a patch.

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

{
    "id": 17628,
    "url": "https://patchwork.libcamera.org/api/patches/17628/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17628/",
    "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": "<20221019090107.19975-4-naush@raspberrypi.com>",
    "date": "2022-10-19T09:01:03",
    "name": "[libcamera-devel,v4,3/7] tests: delayed_controls: Add cookie value test",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "14737abaa69b0cd62da4b9aebcc19644929c2355",
    "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/17628/mbox/",
    "series": [
        {
            "id": 3566,
            "url": "https://patchwork.libcamera.org/api/series/3566/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3566",
            "date": "2022-10-19T09:01:00",
            "name": "Raspberry Pi AGC digital gain fixes",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/3566/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17628/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17628/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 B7CF6C327C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 19 Oct 2022 09:01:22 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 59BB962E45;\n\tWed, 19 Oct 2022 11:01:22 +0200 (CEST)",
            "from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F3F0A62DD7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Oct 2022 11:01:19 +0200 (CEST)",
            "by mail-wr1-x42e.google.com with SMTP id bk15so27951232wrb.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Oct 2022 02:01:19 -0700 (PDT)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tr9-20020a05600c458900b003b47b913901sm1017595wmo.1.2022.10.19.02.01.18\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 19 Oct 2022 02:01:18 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666170082;\n\tbh=uLP2iD4+d5hVVPRB9S50teMWW/Bbnhk3D9hEpEiufrw=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=rzJHQLgcry5lyfe4YuKlAypa9mxdcOJemv3bQbYqJlhli6PribSm/xhN17GK7xCg0\n\tT+jqk+rOOplRQv9WcxbrrKAGvAQYjkoDBa3Y4AQD/GPi9Eajc5OSQFpO3E8a0AtP06\n\txKiEV06jsu/6HI3Pm6U1aSXc3v3PdllFyBh6cFDVaVywIDnysDrjnLFJg31YAz5NII\n\tgQljuv0zAsI5i+sYBRfFgPr/BKRddKdfKWv0+DW5PRE7ITT8q7vtvaoxtxJwLh3t8c\n\t1eStHY5psHywKhyuWaeaM1PGDikjS6dtEac07HH1GnzjpMTS9LDMPVLK3KjOpRPIH1\n\tUBrkmqpTz3PAA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\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=+T3xcs+sb+8OgweMkuTstG9ZLZCS0dNJ3UIDGexYQRk=;\n\tb=KJLJRTJ6h7OP8R17WjoJsZ45MjO99Svbg/ekQBQuNBQ8z6MaclHtbV3+AX6bG4LjZJ\n\tQ/oJp0OnnRZfxS75UJ0jrZnXtsk2wzr2zXmXybK/ESgV6bFb2PkWMAoxJSRf+vimRhWs\n\tkVC6Qw5CVruiDF2ketphO6RK8CRwd0kNpGL2D/Z5XkHkQU0A8Nm9fxhGqD3jFPjdYMFq\n\tp8R+tkEtC7/GKH1m3bLrKEsNWzVhD3EUYj2uqiMvIUTWIunHed8enZAQcRMhbwru3z5l\n\tEVlhwdN0UuuXIlDO30eOcUshis3d1iuBi0I6eEa2nSPjOKdaPjkOHsyEEMVjAMn5ojf1\n\tLZqg=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"KJLJRTJ6\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=+T3xcs+sb+8OgweMkuTstG9ZLZCS0dNJ3UIDGexYQRk=;\n\tb=sxNSOKws79G9B+1hG6gdurDZ44+Wcq/FY0v7JX3uZyuupEn/CU3pucFlBPt/NmiE7v\n\tvzvmuvBAr1+lq+4x+Eyo7kd1MjHF5qRViCF9wG10ewtKUv/vKUfVrcHtE8BN05csOPCU\n\tv5E8Ngyh0f4bb+QRDpabV0KH2mGM5Rr1Oian3HnvCFjmEE0EQJx80I+V3TAr54ggKOi3\n\teYdKoyx3aHJVWGESq7ruz+wQ497SKXw8ykPFBIWR5ykjkmsMpbTdJHM8ovQPmPKuMhzA\n\tJBzpMuoTFvy2bW2NF0Ktu2cuFMKg4Eh3lSJVRI7ugYkWipEw2y+pbxebCEUvC5Shxerh\n\t80sg==",
        "X-Gm-Message-State": "ACrzQf3GgBcmeuc1ZjltoZ5D4CvZ1xnUvPcari6pyFqa4cMssWZr+5mP\n\tcVjl0pt6mbWz/LG7NJ566kp4J9vldqPZ5g==",
        "X-Google-Smtp-Source": "AMsMyM5GY850MYVKP/zF/gnzgiV8FQ/Jaf+do/AUTquBo4dvqmkvSqI6THRA6yTQyxkwD6YLhkXoNw==",
        "X-Received": "by 2002:a05:6000:2aa:b0:231:ac4f:196d with SMTP id\n\tl10-20020a05600002aa00b00231ac4f196dmr4170023wry.121.1666170079444; \n\tWed, 19 Oct 2022 02:01:19 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 19 Oct 2022 10:01:03 +0100",
        "Message-Id": "<20221019090107.19975-4-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221019090107.19975-1-naush@raspberrypi.com>",
        "References": "<20221019090107.19975-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 3/7] tests: delayed_controls: Add\n\tcookie value test",
        "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": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Naushir Patuck <naush@raspberrypi.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add a test for passing and returning cookie values in DelayedControls.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n test/delayed_controls.cpp | 44 +++++++++++++++++++++++++++++++++++++++\n 1 file changed, 44 insertions(+)",
    "diff": "diff --git a/test/delayed_controls.cpp b/test/delayed_controls.cpp\nindex 322c545998b2..5cc7d3aed4fd 100644\n--- a/test/delayed_controls.cpp\n+++ b/test/delayed_controls.cpp\n@@ -267,6 +267,45 @@ protected:\n \t\treturn TestPass;\n \t}\n \n+\tint cookieValue()\n+\t{\n+\t\tstd::unordered_map<uint32_t, DelayedControls::ControlParams> delays = {\n+\t\t\t{ V4L2_CID_BRIGHTNESS, { 1, false } },\n+\t\t};\n+\t\tstd::unique_ptr<DelayedControls> delayed =\n+\t\t\tstd::make_unique<DelayedControls>(dev_.get(), delays);\n+\t\tControlList ctrls;\n+\n+\t\t/* Set a cookie to the reset value. */\n+\t\tconst unsigned int startCookie = 0x1234;\n+\t\tctrls.set(V4L2_CID_BRIGHTNESS, 1);\n+\t\tdev_->setControls(&ctrls);\n+\t\tdelayed->reset(startCookie);\n+\n+\t\t/* Trigger the first frame start event */\n+\t\tdelayed->applyControls(0);\n+\n+\t\tfor (unsigned int i = 1; i < 100; i++) {\n+\t\t\tctrls.set(V4L2_CID_BRIGHTNESS, 1);\n+\t\t\tdelayed->push(ctrls, startCookie + i);\n+\n+\t\t\tdelayed->applyControls(i);\n+\n+\t\t\tauto [result, cookie] = delayed->get(i);\n+\t\t\tunsigned int expected = startCookie + i - 1;\n+\t\t\tif (cookie != expected) {\n+\t\t\t\tcerr << \"Failed cookie value\"\n+\t\t\t\t     << \" frame \" << i\n+\t\t\t\t     << \" expected cookie \" << expected\n+\t\t\t\t     << \" got cookie \" << cookie\n+\t\t\t\t     << endl;\n+\t\t\t\treturn TestFail;\n+\t\t\t}\n+\t\t}\n+\n+\t\treturn TestPass;\n+\t}\n+\n \tint run() override\n \t{\n \t\tint ret;\n@@ -291,6 +330,11 @@ protected:\n \t\tif (ret)\n \t\t\treturn ret;\n \n+\t\t/* Test cookie values. */\n+\t\tret = cookieValue();\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\n \t\treturn TestPass;\n \t}\n \n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "3/7"
    ]
}