Show a patch.

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

{
    "id": 17276,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17276/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17276/",
    "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": "<20220902120808.842-4-naush@raspberrypi.com>",
    "date": "2022-09-02T12:08:05",
    "name": "[libcamera-devel,v1,3/6] 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/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17276/mbox/",
    "series": [
        {
            "id": 3459,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3459/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3459",
            "date": "2022-09-02T12:08:02",
            "name": "Raspberry Pi AGC digial gain fixes",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3459/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17276/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17276/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 625CDC327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Sep 2022 12:08:21 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 728E361FE9;\n\tFri,  2 Sep 2022 14:08:20 +0200 (CEST)",
            "from mail-wm1-x333.google.com (mail-wm1-x333.google.com\n\t[IPv6:2a00:1450:4864:20::333])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D53C761FE3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Sep 2022 14:08:18 +0200 (CEST)",
            "by mail-wm1-x333.google.com with SMTP id\n\tc131-20020a1c3589000000b003a84b160addso2517911wma.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 02 Sep 2022 05:08:18 -0700 (PDT)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\th2-20020a5d4302000000b0021e51c039c5sm1397809wrq.80.2022.09.02.05.08.17\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 02 Sep 2022 05:08:17 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662120500;\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=ONDYJhGWfspdS61ki9ykU/bF7LNFXokF7bWrHSoL14a8IBBDZJ77sHOxMCknseqKc\n\t6g9ET/ckSa2W1bDMz6C5pPGDXM68bUeeNPlUrFJA1K4R28yVCp/1OOKgL7EE6g7ZK2\n\tJySDXeWX5O+qs/Re5JdeuoKF8BrUbXOdlMTEChF9Fjp4uJG2rH2VmWD62U8jQzAp/a\n\tvIdn11Ivmr5K9+bycAOXfhkwHsTeaTaDH1VO4oZLMVrHzW4aOONMmp7wTs9Op8sKsN\n\tHpn0V1hiHvrkYti1BP51FL5DWSmD0XbeJrFOKYddzgZsBsiLkcYPykPUNGahoeZIpb\n\txGYTe4PLIQfbw==",
            "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=kmyfU4tl7LjBkEWM06Khb3KtGaZYzmfL1xsmuMikFpkffKdbPH1LA9LNiS0Ypaabri\n\tsYsIWfMZ2kDKoQPZA1on0txgyHXeLmg6KpePkUtptmOI+C0hrL3uJhspcYEMBqLTuswh\n\tZhlc6dV1rx4wV8TV6gHOzMRneMUzX/3z209Uozuy2cdFT/tDHRFfwG2hdX59kDWTZJNN\n\tiX+f89QZ4qpxcnr+fERtgddA5iE40MGkiJzLRBziNywcPXxFkxxABEjX3q4prZxgEBVs\n\t7td3OR5stvkYrFeYlyh5j9DfDv/ujiAQd46iYjXjTAMBU/rL1CGnZyBgCwiot99U3Orm\n\toonQ=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"kmyfU4tl\"; 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=2gNB1GmABskDMMf/XKwbWoJDvqdLkl3vthwfz2cOAG2Jue/v1JKiOpW/3KUgn/hpjX\n\twPAGMSO6PHU9wBJbqJEiUlKILKTPX9h9J4S18qCF9lnpDHrl9WpQVXpPin/Tayzvd5Dm\n\taEaulDqRiIOoUaPa8d50xMVIo7+iajGRtowPpSHzCcUUptr/9HkS3fTGkP94vIj36Teq\n\tSEYcyMo3zbhohdXFN6nPCrL6g85uZp6/cVL+F56K1F9H31VVy5He0xGOkEMXUCNshgj9\n\t0VQY3k4wwx3s7gpOsW7wy6CmvxNJveaqG7h+mHgGgpOxaybmnFgoQYRGWbmS7FILV/c+\n\t/cNA==",
        "X-Gm-Message-State": "ACgBeo0PnYuMvuc3gvLkliWkf/gI8eeAfddwTs057a1GUekFMKs0zeyq\n\teDWOKyfuuwfAL40L2z4DRwVr82VlBpALf5Ex",
        "X-Google-Smtp-Source": "AA6agR7QvNgUJEqlZNjoocw1nXVcHBeYu75N0XE8tcf/wpDpQcX0/WTuNj/bzpesuMYi9a9Xo8IYgQ==",
        "X-Received": "by 2002:a05:600c:22c8:b0:3a5:c134:1f50 with SMTP id\n\t8-20020a05600c22c800b003a5c1341f50mr2693161wmg.55.1662120498006; \n\tFri, 02 Sep 2022 05:08:18 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  2 Sep 2022 13:08:05 +0100",
        "Message-Id": "<20220902120808.842-4-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220902120808.842-1-naush@raspberrypi.com>",
        "References": "<20220902120808.842-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v1 3/6] 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",
        "v1",
        "3/6"
    ]
}