Show a patch.

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

{
    "id": 16573,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16573/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16573/",
    "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": "<20220707150310.3645858-3-paul.elder@ideasonboard.com>",
    "date": "2022-07-07T15:03:08",
    "name": "[libcamera-devel,2/4] libcamera: v4l2_pixelformat: Use multiplanar if single is unavailable",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "74e9d96b03473487ec3198a3b2bc32685ca32b9b",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16573/mbox/",
    "series": [
        {
            "id": 3264,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3264/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3264",
            "date": "2022-07-07T15:03:06",
            "name": "Add more formats to rkisp1",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3264/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16573/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16573/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 6A427BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  7 Jul 2022 15:03:36 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8155C6048D;\n\tThu,  7 Jul 2022 17:03:35 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3E93960400\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 Jul 2022 17:03:34 +0200 (CEST)",
            "from pyrite.rasen.tech (softbank036240121080.bbtec.net\n\t[36.240.121.80])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C31896CA;\n\tThu,  7 Jul 2022 17:03:32 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657206215;\n\tbh=YjLFLMawFqx4ktHg3snvp3H1fxzHguA1o6Y9LJI0U/Y=;\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=LbvEMdpTgFNvQfq7loH3KdpOlJ/EOXntYKUUKAwcdVNLP2jUl/S4/6gKh8yqbS0VA\n\tfN2Qqwwn/TYGXGtEftEFrar4uk5S5s0VKyPPKstDWPvTenjyjhRitg7dn9hS8XpXfE\n\taCYoBcdIKCJeh/uXnvLZn+2NKmHvLKE3p0oW0VRegcDoApmaFGXAP4UhYOMOHNxaRa\n\tqtrKeKrH8h8cACgHzpmPNMkXANI0MhGek1yhUKi+2KsntSVJfYuzsskiul6NNtqC2y\n\tkVVX56kDLMNxscyruPivthUBK+o15b7FGc5V79tr3vxRNpx5uXO5xB8MPSIDb5Zplx\n\tcWtH+44nG1Exw==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1657206214;\n\tbh=YjLFLMawFqx4ktHg3snvp3H1fxzHguA1o6Y9LJI0U/Y=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=osFyxhUSCsDWV4D9+mM7V/4PE3FHb7ctSMfnz+4pZUPknQQn/O6pBPVMoMhTdydbX\n\tju/dKWSCW2C9nXNU6SLdTRgRUkbu8+Bt0JYDU6KSDm8LupJ+ab4H72dBnsWK0QLB4Y\n\tSSjIX6GrN6BZ/HlV02O+4lGb9b9hQfO2zQq66hAs="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"osFyxhUS\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  8 Jul 2022 00:03:08 +0900",
        "Message-Id": "<20220707150310.3645858-3-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20220707150310.3645858-1-paul.elder@ideasonboard.com>",
        "References": "<20220707150310.3645858-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 2/4] libcamera: v4l2_pixelformat: Use\n\tmultiplanar if single is unavailable",
        "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": "Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Paul Elder <paul.elder@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Some formats, such as YVU422 (but *not* YUV422), YUV444, and YVU444,\nhave only a multiplanar v4l2 format and no singleplanar format. When\nusing V4L2PixelFormat::fromPixelFormat() to convert a libcamera format\nto V4L2PixelFormat, the default is to fetch the singleplanar format, and\nfor those three formats an invalid format will be returned. The caller\nshouldn't be expected to check first if it should request the\nsingleplanar or multiplanar version (that's the whole point of\nV4L2PixelFormat::fromPixelFormat()), so the solution that this patch\nimplements is if fetching singleplanar/multiplanar fails, try fetching\nthe other one.\n\nThe side effect is that as most formats have only singleplanar v4l2\nformat and no multiplanar format, if a multiplanar format is request for\nthese formats then the singleplanar one will be automatically returned.\nSince currently all callers of V4L2PixelFormat::fromPixelFormat() use\nthe default singleplanar call, it is reasoned that this is not an issue.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/libcamera/v4l2_pixelformat.cpp | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\nindex 58fc4e9d..0d2bc350 100644\n--- a/src/libcamera/v4l2_pixelformat.cpp\n+++ b/src/libcamera/v4l2_pixelformat.cpp\n@@ -321,7 +321,14 @@ V4L2PixelFormat V4L2PixelFormat::fromPixelFormat(const PixelFormat &pixelFormat,\n \tif (!info.isValid())\n \t\treturn V4L2PixelFormat();\n \n-\treturn multiplanar ? info.v4l2Formats.multi : info.v4l2Formats.single;\n+\tV4L2PixelFormat ret = multiplanar ? info.v4l2Formats.multi\n+\t\t\t\t\t  : info.v4l2Formats.single;\n+\t/* Try the other of multi/single if the proper one doesn't exist */\n+\tif (!ret.isValid())\n+\t\tret = multiplanar ? info.v4l2Formats.single\n+\t\t\t\t  : info.v4l2Formats.multi;\n+\n+\treturn ret;\n }\n \n /**\n",
    "prefixes": [
        "libcamera-devel",
        "2/4"
    ]
}