Show a patch.

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

{
    "id": 11115,
    "url": "https://patchwork.libcamera.org/api/patches/11115/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11115/",
    "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": "<20210203112316.150393-1-jacopo@jmondi.org>",
    "date": "2021-02-03T11:23:16",
    "name": "[libcamera-devel] libcamera: ipu3: Fix RAW sizes selection",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "2ae6e7330916c66d6416493915ab6e039465a38d",
    "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/11115/mbox/",
    "series": [
        {
            "id": 1643,
            "url": "https://patchwork.libcamera.org/api/series/1643/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1643",
            "date": "2021-02-03T11:23:16",
            "name": "[libcamera-devel] libcamera: ipu3: Fix RAW sizes selection",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1643/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11115/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11115/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 2555FBD161\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Feb 2021 11:23:00 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B67AA6843D;\n\tWed,  3 Feb 2021 12:22:59 +0100 (CET)",
            "from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 490F1683FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Feb 2021 12:22:59 +0100 (CET)",
            "from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id F2402100008\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Feb 2021 11:22:58 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  3 Feb 2021 12:23:16 +0100",
        "Message-Id": "<20210203112316.150393-1-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.30.0",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH] libcamera: ipu3: Fix RAW sizes selection",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Commit 7208e70211a6 (\"libcamera: ipu3: Always use sensor full frame size\")\nchanged the CIO2 configuration procedure to always select the full\nsensor resolution to work around an ImgU configuration issue, as\nreported in the todo item introduced in said commit.\n\nWhen capturing a RAW stream only and the ImgU is not involved, the CIO2\nhas to be configured with the requested stream size to avoid adjusting\nthe stream to the sensor resolution.\n\nAs an example, capturing a raw frame smaller than the sensor resolution\nwith this patch applied results in the stream configuration to be\ncorrectly assigned.\n\n$ cam -c1 -swidth=1056,height=784,role=raw\nipu3.cpp:207 CIO2 configuration: 1056x784-SGRBG10_IPU3\nipu3.cpp:222 Validating stream: 1056x784-SGRBG10_IPU3\nipu3.cpp:233 Assigned 1056x784-SGRBG10_IPU3 to the raw stream\n\nWithout this patch the same operation results in the stream resolution\nto be adjusted to the sensor resolution.\n\n$ cam -c1 -swidth=1056,height=784,role=raw\nipu3.cpp:201 CIO2 configuration: 4224x3136-SGRBG10_IPU3\nipu3.cpp:216 Validating stream: 1056x784-SGRBG10_IPU3\nipu3.cpp:227 Assigned 4224x3136-SGRBG10_IPU3 to the raw stream\nipu3.cpp:297 Stream 0 configuration adjusted to 4224x3136-SGRBG10_IPU3\nCamera configuration adjusted\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 15 +++++++++++----\n 1 file changed, 11 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex db0d6b91be70..d73dd50e2f1d 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -162,12 +162,14 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \tunsigned int rawCount = 0;\n \tunsigned int yuvCount = 0;\n \tSize maxYuvSize;\n+\tSize maxRawSize;\n \n \tfor (const StreamConfiguration &cfg : config_) {\n \t\tconst PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat);\n \n \t\tif (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW) {\n \t\t\trawCount++;\n+\t\t\tmaxRawSize.expandTo(cfg.size);\n \t\t} else {\n \t\t\tyuvCount++;\n \t\t\tmaxYuvSize.expandTo(cfg.size);\n@@ -190,11 +192,16 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t * commit message of the patch that introduced this comment for more\n \t * failure examples).\n \t *\n-\t * Until the sensor frame size calculation criteria are clarified,\n-\t * always use the largest possible one which guarantees better results\n-\t * at the expense of the frame rate and CSI-2 bus bandwidth.\n+\t * Until the sensor frame size calculation criteria are clarified, when\n+\t * capturing from ImgU always use the largest possible size which\n+\t * guarantees better results at the expense of the frame rate and CSI-2\n+\t * bus bandwidth. When only a raw stream is requested use the requested\n+\t * size instead, as the ImgU is not involved.\n \t */\n-\tcio2Configuration_ = data_->cio2_.generateConfiguration({});\n+\tif (!yuvCount)\n+\t\tcio2Configuration_ = data_->cio2_.generateConfiguration(maxRawSize);\n+\telse\n+\t\tcio2Configuration_ = data_->cio2_.generateConfiguration({});\n \tif (!cio2Configuration_.pixelFormat.isValid())\n \t\treturn Invalid;\n \n",
    "prefixes": [
        "libcamera-devel"
    ]
}