Show a patch.

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

{
    "id": 16393,
    "url": "https://patchwork.libcamera.org/api/patches/16393/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16393/",
    "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": "<20220627162732.33160-13-jacopo@jmondi.org>",
    "date": "2022-06-27T16:27:29",
    "name": "[libcamera-devel,12/15] libcamera: ipa: Use the current VBLANK value",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "8bf4ed0d9d3c3c0c8b19ae04f10753ce1badcb42",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16393/mbox/",
    "series": [
        {
            "id": 3224,
            "url": "https://patchwork.libcamera.org/api/series/3224/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3224",
            "date": "2022-06-27T16:27:17",
            "name": "Internal controls, sensor delays and IPA init/configure rework",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3224/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16393/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16393/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 C67BEBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Jun 2022 16:28:02 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7C62265659;\n\tMon, 27 Jun 2022 18:28:02 +0200 (CEST)",
            "from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7752C65648\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Jun 2022 18:27:52 +0200 (CEST)",
            "(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id BA53720004;\n\tMon, 27 Jun 2022 16:27:51 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656347282;\n\tbh=G5D9fOHWCM9PZClxjpkw4/6UIxce7BP82fLdpzG/XbE=;\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=WytnHA9OjvJRq08/lbM2ZWuRaG6sOmS2kpOusVhJ/ag3IH1pqMx3+eyBAxCPNQ2L3\n\tbzVs8FEQ8wtBAJceDj5POVQW2o81YlQSRt6T+UubSCfmrihQ10QyfeHUa5CLYkiPP1\n\tOJel7IhwHizfkb486NtWZoQyvwfI4FcozSJkuPmlVb8RwdEC992v2Bobx0rnjs2wEL\n\ty6O51fyoDjyBDaKEqjHRJsJfwPn/LB6s89SlZwuR9scadMFFG7TQz8Wx+KgTwx7wk/\n\tYVhykYoXrZ7ozWAS2QyVRpV9w5M4xL7UQTWXYig4rrJK8ddNMqv5yaEsF0eY7wERiv\n\tEL/1NXbQ3PsPQ==",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 27 Jun 2022 18:27:29 +0200",
        "Message-Id": "<20220627162732.33160-13-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.36.1",
        "In-Reply-To": "<20220627162732.33160-1-jacopo@jmondi.org>",
        "References": "<20220627162732.33160-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 12/15] libcamera: ipa: Use the current\n\tVBLANK value",
        "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": "Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Jacopo Mondi <jacopo@jmondi.org>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The IPU3 IPA module uses the default value from the V4L2_CID_VBLANK\ncontrol to compute the total frame size in processStatsBuffer().\n\nMost drivers update the VBLANK control limits when a new format is\napplied and assign to the default the current control value.\n\nAs this is not required by the API specification, and the VBLANK default\nvalue can be different than its current value, use the actual control\nvalue as now available from the IPACameraSensorInfo structure.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/ipa/ipu3/ipa_context.cpp |  4 ++--\n src/ipa/ipu3/ipa_context.h   |  2 +-\n src/ipa/ipu3/ipu3.cpp        | 15 ++++++++-------\n 3 files changed, 11 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp\nindex 13cdb835ef7f..06fdf2a1efc7 100644\n--- a/src/ipa/ipu3/ipa_context.cpp\n+++ b/src/ipa/ipu3/ipa_context.cpp\n@@ -126,8 +126,8 @@ namespace libcamera::ipa::ipu3 {\n  * \\var IPASessionConfiguration::sensor.lineDuration\n  * \\brief Line duration in microseconds\n  *\n- * \\var IPASessionConfiguration::sensor.defVBlank\n- * \\brief The default vblank value of the sensor\n+ * \\var IPASessionConfiguration::sensor.vBlank\n+ * \\brief The vertical blanking expressed in number of lines\n  */\n \n /**\ndiff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h\nindex 42e11141d3a1..a5b878ab7792 100644\n--- a/src/ipa/ipu3/ipa_context.h\n+++ b/src/ipa/ipu3/ipa_context.h\n@@ -43,7 +43,7 @@ struct IPASessionConfiguration {\n \t} agc;\n \n \tstruct {\n-\t\tint32_t defVBlank;\n+\t\tint32_t vBlank;\n \t\tutils::Duration lineDuration;\n \t} sensor;\n };\ndiff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 7e8bf0feee8a..3efbc84c4ef1 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -149,7 +149,7 @@ public:\n \t\t\t\tconst uint32_t bufferId,\n \t\t\t\tconst ControlList &sensorControls) override;\n private:\n-\tvoid updateSessionConfiguration(const ControlInfoMap &sensorControls);\n+\tvoid updateSessionConfiguration(const IPAConfigInfo &info);\n \n \tbool validateSensorControls();\n \n@@ -177,10 +177,12 @@ private:\n  * \\brief Compute IPASessionConfiguration using the sensor information and the\n  * sensor V4L2 controls\n  */\n-void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\n+void IPAIPU3::updateSessionConfiguration(const IPAConfigInfo &info)\n {\n-\tconst ControlInfo vBlank = sensorControls.find(V4L2_CID_VBLANK)->second;\n-\tcontext_.configuration.sensor.defVBlank = vBlank.def().get<int32_t>();\n+\tconst IPACameraSensorInfo &sensorInfo = info.sensorInfo;\n+\tcontext_.configuration.sensor.vBlank = sensorInfo.vblank;\n+\n+\tconst ControlInfoMap &sensorControls = info.sensorControls;\n \n \tconst ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;\n \tint32_t minExposure = v4l2Exposure.min().get<int32_t>();\n@@ -391,7 +393,7 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo)\n \t}\n \n \t/* Update the IPASessionConfiguration using the sensor settings. */\n-\tupdateSessionConfiguration(sensorCtrls_);\n+\tupdateSessionConfiguration(configInfo);\n \n \tfor (auto const &algo : algorithms_) {\n \t\tint ret = algo->configure(context_, configInfo);\n@@ -501,7 +503,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n \tframeContext.sensor.gain = camHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n \n \tdouble lineDuration = context_.configuration.sensor.lineDuration.get<std::micro>();\n-\tint32_t vBlank = context_.configuration.sensor.defVBlank;\n+\tint32_t vBlank = context_.configuration.sensor.vBlank;\n \tControlList ctrls(controls::controls);\n \n \tfor (auto const &algo : algorithms_)\n@@ -509,7 +511,6 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n \n \tsetControls(frame);\n \n-\t/* \\todo Use VBlank value calculated from each frame exposure. */\n \tint64_t frameDuration = (vBlank + sensorInfo_.outputSize.height) * lineDuration;\n \tctrls.set(controls::FrameDuration, frameDuration);\n \n",
    "prefixes": [
        "libcamera-devel",
        "12/15"
    ]
}