Show a patch.

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

{
    "id": 17299,
    "url": "https://patchwork.libcamera.org/api/patches/17299/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17299/",
    "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": "<20220905073956.7342-4-naush@raspberrypi.com>",
    "date": "2022-09-05T07:39:52",
    "name": "[libcamera-devel,v2,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/17299/mbox/",
    "series": [
        {
            "id": 3471,
            "url": "https://patchwork.libcamera.org/api/series/3471/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3471",
            "date": "2022-09-05T07:39:49",
            "name": "Raspberry Pi AGC digial gain fixes",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3471/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17299/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17299/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 C9592C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Sep 2022 07:40:08 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 90B2D62068;\n\tMon,  5 Sep 2022 09:40:08 +0200 (CEST)",
            "from mail-wr1-x431.google.com (mail-wr1-x431.google.com\n\t[IPv6:2a00:1450:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2137E62058\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Sep 2022 09:40:05 +0200 (CEST)",
            "by mail-wr1-x431.google.com with SMTP id c11so5883643wrp.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Sep 2022 00:40:05 -0700 (PDT)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tv16-20020a5d5910000000b00228a6ce17b4sm1342841wrd.37.2022.09.05.00.40.03\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 05 Sep 2022 00:40:03 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662363608;\n\tbh=YG8zKuN4cx17jT26zExVUEUn1t8fvoswfulGuF4ti20=;\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=ne786i4FaRbhmGmZLrf9FCQiI+TsgR8bu97IW40AUTtC2d2XuGHyJERGNA8jaAGC9\n\tFyKOEcDwGOx7Ltgvu/NF1LSlO/gS2Yn8Jq8LKChhCvlcPte61I4wM22uRto/DVUi/r\n\tqZxztC9bRPbF2vgQuE63I1aNW9hq/e17in14SKrbyf3upF4f7yhLNkRDZw8dOSZeKW\n\tiROC7Idglz6mu45jg5hqqppizfKu1L2IX/jC/f4W3CwDJHpp6oo+8CcE/FaW96b6bl\n\tMJijzWpTkIZjnJsX/w4R5cGXauV/S4QBe2lafJgHm1Ep6BvgIpMBEfr0fZ31KRqWX2\n\tiDCrGM+M87MgQ==",
            "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\tbh=CiHEOsMF91m92inxh4BZs7UxuXbwFOzk4SqKgH3uS1Q=;\n\tb=ZDdzBBHHT9L4WCTDaUwPi6eHhy8HOv36oIO+Jyk6j5hO2gpHpEY0IUk/0L/4c7aCqw\n\te4rjaEJC+afnbkQjrkhkK9rkIc6w4gl8+QU1iApFV4RSCXlT/sEXhKfztS5wwF1BwbkI\n\tn3JY73ASSLPQIPKeUiNoxbaME3mJrdi31ptEJqDf8H2fN1lywAWJ4Ftns97Tiov8Wt5U\n\t02eZA5gu1tu9JpNMgSyo1jQUzACavz1QDG2yrAChgQeIAfeHaS/LxlLc/hZc9mdZgS9/\n\t0HzJ/cz1TusOGDI3iiYBb8g5fMHayDqYAQVP2bgVwZB8ViMXK59+8grPyZvucBnsF1aI\n\tBVGQ=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"ZDdzBBHH\"; 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;\n\tbh=CiHEOsMF91m92inxh4BZs7UxuXbwFOzk4SqKgH3uS1Q=;\n\tb=Ji2sa1jlQhIMeJIDbgRDi4/FmgvM0QljgFQssxpn3ElSfz8OU7NHRejGnrrkBHLs92\n\tB2hSvF/5y+0s7KvuP72FMa4p+tW6lbye/5OU/G4h8fM/7VpbDYG5FOmWxQEZml2eS3t/\n\tFOgC6fzGusEFfxFcrMKoRsx8NmtJ2TvFMKNOPFwFcUdMsbzOmTLBAoFIAGATc7N1fI8Q\n\tPldFzkL2v3m7MX6UDZdkjYJhwn0lKANpcYm62JtMoX0LknIJlihW2oFHvjG97w/4lCpk\n\txLsiEEC77kR77hcDXyuWltMG5T+2RUSkRSnufQLlrT5F/0d5930poHoSDwuGMZmN/rTU\n\t8Vkw==",
        "X-Gm-Message-State": "ACgBeo0vE1sr5Dokyv7ag5KANkkOgTEeGR3mtp7sR3X7j76+o802PzXF\n\thRxNlNwhXxeQnrKcL27knqwyMB3Uotz/9Rhi",
        "X-Google-Smtp-Source": "AA6agR6tRcgLXyKXer3qlusDcX3wZFciJfIgkVyCbVHYULmivuUtg/BdXO1MjtM8W5tbiUNcczYr6A==",
        "X-Received": "by 2002:a05:6000:1546:b0:226:ee3f:a5d2 with SMTP id\n\t6-20020a056000154600b00226ee3fa5d2mr14130169wry.76.1662363604619; \n\tMon, 05 Sep 2022 00:40:04 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  5 Sep 2022 08:39:52 +0100",
        "Message-Id": "<20220905073956.7342-4-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220905073956.7342-1-naush@raspberrypi.com>",
        "References": "<20220905073956.7342-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 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>\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",
        "v2",
        "3/7"
    ]
}