Show a patch.

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

{
    "id": 8683,
    "url": "https://patchwork.libcamera.org/api/patches/8683/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/8683/",
    "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": "<20200708134417.67747-15-paul.elder@ideasonboard.com>",
    "date": "2020-07-08T13:44:10",
    "name": "[libcamera-devel,v4,14/21] libcamera: ipu3: Fill stride and frameSize at config validation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d014a4dafc79ad4bd8b3ebb1ddcd1f947d47d9bf",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/8683/mbox/",
    "series": [
        {
            "id": 1090,
            "url": "https://patchwork.libcamera.org/api/series/1090/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1090",
            "date": "2020-07-08T13:43:56",
            "name": "Clean up formats in v4l2-compat and pipeline handlers",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/1090/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/8683/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/8683/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 1E1D2BD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Jul 2020 13:45:01 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E149B6113A;\n\tWed,  8 Jul 2020 15:45:00 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1CDA3610B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Jul 2020 15:45:00 +0200 (CEST)",
            "from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A260551B;\n\tWed,  8 Jul 2020 15:44:58 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"jeWkBP+g\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594215899;\n\tbh=GJxUpRt86Lep1STgHoHbsBtzVBV7BXPJyXTrsNluO1Y=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=jeWkBP+g2UhOyJHK8ONnEcgrWyaQtgs6ijYCA82tG067VwH48q9C43ZehrBktsnHL\n\tZGm/MKCzrXAVdgF4HDhajfbUcjkA8126LFTe3sMFI5KTXxzwGgrW1/RFP0GL96nFZA\n\tUSLNs6V2avfaoD914VV6ewFhL/PDAVQYIdKmOqxU=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  8 Jul 2020 22:44:10 +0900",
        "Message-Id": "<20200708134417.67747-15-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20200708134417.67747-1-paul.elder@ideasonboard.com>",
        "References": "<20200708134417.67747-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v4 14/21] libcamera: ipu3: Fill stride and\n\tframeSize at config validation",
        "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": "Fill the stride and frameSize fields of the StreamConfiguration at\nconfiguration validation time instead of at camera configuration time.\nThis allows applications to get the stride when trying a configuration\nwithout modifying the active configuration of the camera.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v4:\n- fix stride and frameSize calculation\n- mention motivation in commit message\n\nNew in v3\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 23 +++++++++++++++--------\n 1 file changed, 15 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 00559ce..4a2d924 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -278,6 +278,21 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t\t\t\t<< cfg.toString();\n \t\t\tstatus = Adjusted;\n \t\t}\n+\n+\t\tconst PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat);\n+\t\tbool packedRaw = info.packed &&\n+\t\t\t\t info.colourEncoding == PixelFormatInfo::ColourEncodingRAW;\n+\n+\t\tif (packedRaw) {\n+\t\t\tcfg.stride = info.stride(cfg.size.width, 0, 64);\n+\t\t\tcfg.frameSize = cfg.stride * cfg.size.height;\n+\t\t} else {\n+\t\t\tcfg.stride = info.stride(cfg.size.width, 0);\n+\t\t\tstd::array<unsigned int, 3> strides;\n+\t\t\tfor (unsigned int j = 0; j < 3; j++)\n+\t\t\t\tstrides[i] = info.stride(cfg.size.width, i, packedRaw ? 64 : 0);\n+\t\t\tcfg.frameSize = info.frameSize(cfg.size, strides);\n+\t\t}\n \t}\n \n \treturn status;\n@@ -495,21 +510,13 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n \t\t\tif (ret)\n \t\t\t\treturn ret;\n \n-\t\t\tcfg.stride = outputFormat.planes[0].bpl;\n \t\t\toutActive = true;\n \t\t} else if (stream == vfStream) {\n \t\t\tret = imgu->configureViewfinder(cfg, &outputFormat);\n \t\t\tif (ret)\n \t\t\t\treturn ret;\n \n-\t\t\tcfg.stride = outputFormat.planes[0].bpl;\n \t\t\tvfActive = true;\n-\t\t} else {\n-\t\t\t/*\n-\t\t\t * The RAW stream is configured as part of the CIO2 and\n-\t\t\t * no configuration is needed for the ImgU.\n-\t\t\t */\n-\t\t\tcfg.stride = cio2Format.planes[0].bpl;\n \t\t}\n \t}\n \n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "14/21"
    ]
}