Show a patch.

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

{
    "id": 14835,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14835/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14835/",
    "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": "<20211129083424.3136533-3-hiroh@chromium.org>",
    "date": "2021-11-29T08:34:24",
    "name": "[libcamera-devel,v9,3/3] libcamera: pipeline: ipu3: Apply a requested test pattern mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "960e900a3047f58c24b168c6a313db43bd660929",
    "submitter": {
        "id": 63,
        "url": "https://patchwork.libcamera.org/api/1.1/people/63/?format=api",
        "name": "Hirokazu Honda",
        "email": "hiroh@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14835/mbox/",
    "series": [
        {
            "id": 2769,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2769/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2769",
            "date": "2021-11-29T08:34:22",
            "name": "[libcamera-devel,v9,1/3] libcamera: camera_sensor: Reference test pattern modes by enum type",
            "version": 9,
            "mbox": "https://patchwork.libcamera.org/series/2769/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14835/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14835/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 E2FBABF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Nov 2021 08:34:39 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9604260582;\n\tMon, 29 Nov 2021 09:34:39 +0100 (CET)",
            "from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com\n\t[IPv6:2607:f8b0:4864:20::1029])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 70B8D6057B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 09:34:36 +0100 (CET)",
            "by mail-pj1-x1029.google.com with SMTP id\n\tgb13-20020a17090b060d00b001a674e2c4a8so13504283pjb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Nov 2021 00:34:36 -0800 (PST)",
            "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:f254:cda9:46e8:17b7])\n\tby smtp.gmail.com with ESMTPSA id\n\ty7sm11245948pge.44.2021.11.29.00.34.33\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 29 Nov 2021 00:34:34 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"mvDAyFm/\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=WGgFh8QVhko/8UEdudseB9ve2z97aC6CpvAr/2CW8Jc=;\n\tb=mvDAyFm/ifl/74vE/5dixoYMhjG8LfOJxSsKWhFVspYlkJuE2WMARRKF8p7Ey5b5Wm\n\t3UAr11Ov6Yvyp0TuQ+/bljeS/M1nF6X4aRr+1QQ107cDT4412cZtjJ01uG8VcWhvsjub\n\taZ8XK6H+yVTw5o/yBwSWHQB9ZfhtPHKDmKvuM=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\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=WGgFh8QVhko/8UEdudseB9ve2z97aC6CpvAr/2CW8Jc=;\n\tb=T87mdaVS5Ta/B/VRgf97vnaQhhlLMuY2aYM+VIjrnWa3IviVpJJCbR2sM6MnFRFXIN\n\t2po1QTHNnGL9otNBmVloe3SlPJGl+iRuJVDd6a4U2ye5tAAv/oS9b0GFsSvevmYpDZUy\n\tQ1SAAQoCU+zj9CDQitvBxvxu4MlOPkrA5OmchNvMworXSslxCZGO637T94pCuj9KgN13\n\tj2k9VG35CBNDkDRgu/T+j7oIa9TXMcmSOuhP61KyHb8Nib6pOti5mkIDRPUHo8HFFBmy\n\tnPjsPdfL8at6zj47xiSQbapM85iHTMVyAM+5HYyxkvAfW6xgiZDKBN9Esag34rI/6J+F\n\tGwfQ==",
        "X-Gm-Message-State": "AOAM531cSoII27VFlCG1X8SlU36pzbZBzvtWvbDbm+eFun1J7IB9bOZJ\n\t+DZi/yIVHa+yN2WXcPBkZ+VWtycWBE8WTA==",
        "X-Google-Smtp-Source": "ABdhPJxUvz+xYPx9tappfXVNhrPtPagA4hYPXiK61QwRaJkwb5CPEd1JTZjrGk7V5jWHyleYj/Ntmg==",
        "X-Received": "by 2002:a17:903:2344:b0:142:25b4:76c1 with SMTP id\n\tc4-20020a170903234400b0014225b476c1mr59316532plh.43.1638174874764; \n\tMon, 29 Nov 2021 00:34:34 -0800 (PST)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 29 Nov 2021 17:34:24 +0900",
        "Message-Id": "<20211129083424.3136533-3-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.34.0.rc2.393.gf8c9666880-goog",
        "In-Reply-To": "<20211129083424.3136533-1-hiroh@chromium.org>",
        "References": "<20211129083424.3136533-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v9 3/3] libcamera: pipeline: ipu3: Apply a\n\trequested test pattern mode",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "This introduces a way to set controls immediately for a capture\nin ipu3 pipeline handler. It enables to apply a test pattern mode\nper frame.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 54 ++++++++++++++++++++++++++--\n 1 file changed, 52 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 25490dcf..f80001fa 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -59,6 +59,7 @@ public:\n \tvoid statBufferReady(FrameBuffer *buffer);\n \tvoid queuePendingRequests();\n \tvoid cancelPendingRequests();\n+\tvoid frameStart(uint32_t sequence);\n \n \tCIO2Device cio2_;\n \tImgUDevice *imgu_;\n@@ -76,7 +77,10 @@ public:\n \n \tstd::unique_ptr<ipa::ipu3::IPAProxyIPU3> ipa_;\n \n+\t/* Requests before queueing cio2 device. */\n \tstd::queue<Request *> pendingRequests_;\n+\t/* Requests queued in cio2 device and before passing imgu device. */\n+\tstd::queue<Request *> processingRequests_;\n \n \tControlInfoMap ipaControls_;\n \n@@ -811,6 +815,8 @@ void PipelineHandlerIPU3::stop(Camera *camera)\n \n void IPU3CameraData::cancelPendingRequests()\n {\n+\tprocessingRequests_ = {};\n+\n \twhile (!pendingRequests_.empty()) {\n \t\tRequest *request = pendingRequests_.front();\n \n@@ -853,6 +859,8 @@ void IPU3CameraData::queuePendingRequests()\n \n \t\tinfo->rawBuffer = rawBuffer;\n \n+\t\tprocessingRequests_.push(request);\n+\n \t\tipa::ipu3::IPU3Event ev;\n \t\tev.op = ipa::ipu3::EventProcessControls;\n \t\tev.frame = info->id;\n@@ -1121,8 +1129,8 @@ int PipelineHandlerIPU3::registerCameras()\n \t\tdata->delayedCtrls_ =\n \t\t\tstd::make_unique<DelayedControls>(cio2->sensor()->device(),\n \t\t\t\t\t\t\t  params);\n-\t\tdata->cio2_.frameStart().connect(data->delayedCtrls_.get(),\n-\t\t\t\t\t\t &DelayedControls::applyControls);\n+\t\tdata->cio2_.frameStart().connect(data.get(),\n+\t\t\t\t\t\t &IPU3CameraData::frameStart);\n \n \t\t/* Convert the sensor rotation to a transformation */\n \t\tint32_t rotation = 0;\n@@ -1414,6 +1422,48 @@ void IPU3CameraData::statBufferReady(FrameBuffer *buffer)\n \tipa_->processEvent(ev);\n }\n \n+/*\n+ * \\brief Handle the start of frame exposure signal\n+ * \\param[in] sequence The sequence number of frame\n+ *\n+ * Inspect the list of pending requests waiting for a RAW frame to be\n+ * produced and apply controls for the 'next' one.\n+ *\n+ * Some controls need to be applied immediately, such as the\n+ * TestPatternMode one. Other controls are handled through the delayed\n+ * controls class.\n+ */\n+void IPU3CameraData::frameStart(uint32_t sequence)\n+{\n+\tdelayedCtrls_->applyControls(sequence);\n+\n+\tif (processingRequests_.empty())\n+\t\treturn;\n+\n+\t/* Handle controls which are to be set ready for the next frame to start. */\n+\tRequest *request = processingRequests_.front();\n+\tprocessingRequests_.pop();\n+\n+\t/* Takes effect applying the test pattern mode affects immediately. */\n+\tif (!request->controls().contains(controls::draft::TestPatternMode))\n+\t\treturn;\n+\n+\tconst int32_t testPatternMode = request->controls().get(\n+\t\tcontrols::draft::TestPatternMode);\n+\n+\tint ret = cio2_.sensor()->setTestPatternMode(\n+\t\tstatic_cast<controls::draft::TestPatternModeEnum>(\n+\t\t\ttestPatternMode));\n+\tif (ret) {\n+\t\tLOG(IPU3, Error) << \"Failed to set test pattern mode: \"\n+\t\t\t\t << ret;\n+\t\treturn;\n+\t}\n+\n+\trequest->metadata().set(controls::draft::TestPatternMode,\n+\t\t\t\ttestPatternMode);\n+}\n+\n REGISTER_PIPELINE_HANDLER(PipelineHandlerIPU3)\n \n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "v9",
        "3/3"
    ]
}