Show a patch.

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

{
    "id": 19604,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/19604/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19604/",
    "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": "<20240301212121.9072-14-laurent.pinchart@ideasonboard.com>",
    "date": "2024-03-01T21:21:02",
    "name": "[PATCH/RFC,13/32] libcamera: v4l2_videodevice: Update to the new kernel metadata API",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": false,
    "hash": "a61d06caf92f46ac9387a1b421d6566308b72dab",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19604/mbox/",
    "series": [
        {
            "id": 4197,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4197/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4197",
            "date": "2024-03-01T21:20:49",
            "name": "libcamera: Support the upstream Unicam driver",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4197/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19604/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19604/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 939F0C3260\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  1 Mar 2024 21:21:41 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 29578628AC;\n\tFri,  1 Mar 2024 22:21:41 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0635F6285F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Mar 2024 22:21:39 +0100 (CET)",
            "from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8335D335C;\n\tFri,  1 Mar 2024 22:21:24 +0100 (CET)"
        ],
        "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=\"H5+TuIkl\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709328084;\n\tbh=Ykoy4mK1Q+sBVellJ/mJHZzrIxLMGD90dumBlouCl60=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=H5+TuIkl/Y7AYxagQNo2wO/8A21l6R8rvI1SGErBfBq6Nc7AhZo5S3XyjlqBHuolY\n\t+NwcrMzNbWMU13S6xk0h6Clj9zyD+g100y5byi8FeAfgk8wMUVrgAJV797KIsXVnYI\n\tgJGOSo0kHs9aLjKcvO4OaB++gkXvBtUDODX1G0Sk=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH/RFC 13/32] libcamera: v4l2_videodevice: Update to the new\n\tkernel metadata API",
        "Date": "Fri,  1 Mar 2024 23:21:02 +0200",
        "Message-ID": "<20240301212121.9072-14-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240301212121.9072-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20240301212121.9072-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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>",
        "Cc": "Sakari Ailus <sakari.ailus@iki.fi>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "With support for metadata in the streams API, the v4l2_meta_format\nstructure has been extended with width, height and bytesperline fields.\nSupport them in the V4L2VideoDevice getFormat() and setFormat()\nfunctions.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/v4l2_videodevice.cpp | 31 ++++++++++++++++--------------\n 1 file changed, 17 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex a72ef64de4a2..9d4a0a3ccd0b 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -863,7 +863,7 @@ int V4L2VideoDevice::setFormat(V4L2DeviceFormat *format)\n int V4L2VideoDevice::getFormatMeta(V4L2DeviceFormat *format)\n {\n \tstruct v4l2_format v4l2Format = {};\n-\tstruct v4l2_meta_format *pix = &v4l2Format.fmt.meta;\n+\tstruct v4l2_meta_format *meta = &v4l2Format.fmt.meta;\n \tint ret;\n \n \tv4l2Format.type = bufferType_;\n@@ -873,12 +873,12 @@ int V4L2VideoDevice::getFormatMeta(V4L2DeviceFormat *format)\n \t\treturn ret;\n \t}\n \n-\tformat->size.width = 0;\n-\tformat->size.height = 0;\n-\tformat->fourcc = V4L2PixelFormat(pix->dataformat);\n+\tformat->size.width = meta->width;\n+\tformat->size.height = meta->height;\n+\tformat->fourcc = V4L2PixelFormat(meta->dataformat);\n \tformat->planesCount = 1;\n-\tformat->planes[0].bpl = pix->buffersize;\n-\tformat->planes[0].size = pix->buffersize;\n+\tformat->planes[0].bpl = meta->bytesperline;\n+\tformat->planes[0].size = meta->buffersize;\n \n \treturn 0;\n }\n@@ -886,12 +886,15 @@ int V4L2VideoDevice::getFormatMeta(V4L2DeviceFormat *format)\n int V4L2VideoDevice::trySetFormatMeta(V4L2DeviceFormat *format, bool set)\n {\n \tstruct v4l2_format v4l2Format = {};\n-\tstruct v4l2_meta_format *pix = &v4l2Format.fmt.meta;\n+\tstruct v4l2_meta_format *meta = &v4l2Format.fmt.meta;\n \tint ret;\n \n \tv4l2Format.type = bufferType_;\n-\tpix->dataformat = format->fourcc;\n-\tpix->buffersize = format->planes[0].size;\n+\tmeta->width = format->size.width;\n+\tmeta->height = format->size.height;\n+\tmeta->dataformat = format->fourcc;\n+\tmeta->bytesperline = format->planes[0].bpl;\n+\tmeta->buffersize = format->planes[0].size;\n \tret = ioctl(set ? VIDIOC_S_FMT : VIDIOC_TRY_FMT, &v4l2Format);\n \tif (ret) {\n \t\tLOG(V4L2, Error)\n@@ -904,12 +907,12 @@ int V4L2VideoDevice::trySetFormatMeta(V4L2DeviceFormat *format, bool set)\n \t * Return to caller the format actually applied on the video device,\n \t * which might differ from the requested one.\n \t */\n-\tformat->size.width = 0;\n-\tformat->size.height = 0;\n-\tformat->fourcc = V4L2PixelFormat(pix->dataformat);\n+\tformat->size.width = meta->width;\n+\tformat->size.height = meta->height;\n+\tformat->fourcc = V4L2PixelFormat(meta->dataformat);\n \tformat->planesCount = 1;\n-\tformat->planes[0].bpl = pix->buffersize;\n-\tformat->planes[0].size = pix->buffersize;\n+\tformat->planes[0].bpl = meta->bytesperline;\n+\tformat->planes[0].size = meta->buffersize;\n \n \treturn 0;\n }\n",
    "prefixes": [
        "PATCH/RFC",
        "13/32"
    ]
}