Show a patch.

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

{
    "id": 16474,
    "url": "https://patchwork.libcamera.org/api/patches/16474/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16474/",
    "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": "<20220630133902.321099-17-jacopo@jmondi.org>",
    "date": "2022-06-30T13:38:55",
    "name": "[libcamera-devel,v3,16/23] libcamera: IPACameraSensorInfo: Add VBLANK",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "b7415b655eba3885e13db33a26db27af19a0c596",
    "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/16474/mbox/",
    "series": [
        {
            "id": 3238,
            "url": "https://patchwork.libcamera.org/api/series/3238/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3238",
            "date": "2022-06-30T13:38:39",
            "name": "Internal controls, sensor delays and IPA rework",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3238/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16474/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16474/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 B4FF3BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 30 Jun 2022 13:39:48 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 568C7656B0;\n\tThu, 30 Jun 2022 15:39:48 +0200 (CEST)",
            "from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C914D6564F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Jun 2022 15:39:39 +0200 (CEST)",
            "(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 7E23A24000A;\n\tThu, 30 Jun 2022 13:39:38 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656596388;\n\tbh=foCxZ0go4cL640cwJ1RY+DLYNuS4Pp9tGf3lwEIiy6U=;\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=dmJZSZ+hQsVDRp0DKDQ7za2us2BXYgAzcA9Ix5paFb1g+Axna4/2xfUBmlSkunJ9j\n\tn8o/h9pP8q7CPH2eyNLn+xMjelgBCXWZt1l/OWmW4iRd851bQd4Mc4Vae6agCeu6TC\n\tsk+cm2ii/pJFnXqukKeiXF0d5AC4bCOU0wlc14iinG4CEV6UaDDcz2tMDWTAQri5Mo\n\tZb+Jw61tiHliopN/iEQV4wQ0n1CQE4JfxXRFi5g8EmYoTKjFaVVrFlViPGAlFHN0Re\n\t7T6k0P2JTXcVNymJwfAuEhTRr1Xh55SYdDCLP/oI2Hy86AlHezZkmTvbCWvTuO7BSL\n\tTsX7Pe/KXIwlQ==",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 30 Jun 2022 15:38:55 +0200",
        "Message-Id": "<20220630133902.321099-17-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.36.1",
        "In-Reply-To": "<20220630133902.321099-1-jacopo@jmondi.org>",
        "References": "<20220630133902.321099-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 16/23] libcamera: IPACameraSensorInfo:\n\tAdd VBLANK",
        "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 IPA module needs the vertical blanking value to calculate the\ntotal frame size.\n\nIn order to prepare removing usage of V4L2_CID_VBLANK in IPA modules,\nadd the vblank value to the IPACameraSensorInfo structure.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/ipa/core.mojom              |  6 ++++++\n src/libcamera/camera_sensor/camera_sensor.cpp | 15 +++++++++++++++\n 2 files changed, 21 insertions(+)",
    "diff": "diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom\nindex 74f3339e56f2..d122fb7add4d 100644\n--- a/include/libcamera/ipa/core.mojom\n+++ b/include/libcamera/ipa/core.mojom\n@@ -178,6 +178,11 @@ module libcamera;\n  * The total line length in pixel clock periods, including blanking.\n  */\n \n+/**\n+ * \\var IPACameraSensorInfo::vblank\n+ * \\brief The vertical blanking, expressed in number of lines\n+ */\n+\n /**\n  * \\var IPACameraSensorInfo::minFrameLength\n  * \\brief The minimum allowable frame length in units of lines\n@@ -218,6 +223,7 @@ struct IPACameraSensorInfo {\n \n \tuint64 pixelRate;\n \tuint32 lineLength;\n+\tuint32 vblank;\n \n \tuint32 minFrameLength;\n \tuint32 maxFrameLength;\ndiff --git a/src/libcamera/camera_sensor/camera_sensor.cpp b/src/libcamera/camera_sensor/camera_sensor.cpp\nindex 02810c7c5ad0..08b96b9c3b40 100644\n--- a/src/libcamera/camera_sensor/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor/camera_sensor.cpp\n@@ -1008,6 +1008,21 @@ int CameraSensor::sensorInfo(IPACameraSensorInfo *info) const\n \tinfo->minFrameLength = info->outputSize.height + vblank.min().get<int32_t>();\n \tinfo->maxFrameLength = info->outputSize.height + vblank.max().get<int32_t>();\n \n+\t/*\n+\t * Retrieve the vertical blanking.\n+\t *\n+\t * We can't rely on the valued cached as vblank can be modified while\n+\t * streaming to adjust the frame rate.\n+\t */\n+\tControlList ctrls = subdev_->getControls({ V4L2_CID_VBLANK });\n+\tif (ctrls.empty()) {\n+\t\tLOG(CameraSensor, Error)\n+\t\t\t<< \"Failed to retrieve camera info controls\";\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tinfo->vblank = ctrls.get(V4L2_CID_VBLANK).get<int32_t>();\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "16/23"
    ]
}