Show a patch.

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

{
    "id": 15932,
    "url": "https://patchwork.libcamera.org/api/patches/15932/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15932/",
    "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": "<20220517143325.71784-9-tomi.valkeinen@ideasonboard.com>",
    "date": "2022-05-17T14:33:20",
    "name": "[libcamera-devel,v2,08/13] py: cam_kms: support multiplanar formats",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "7855d9e70224d785c2bb9d784c2010b2a49c4075",
    "submitter": {
        "id": 109,
        "url": "https://patchwork.libcamera.org/api/people/109/?format=api",
        "name": "Tomi Valkeinen",
        "email": "tomi.valkeinen@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/15932/mbox/",
    "series": [
        {
            "id": 3116,
            "url": "https://patchwork.libcamera.org/api/series/3116/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3116",
            "date": "2022-05-17T14:33:12",
            "name": "Misc Python bindings patches",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3116/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15932/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15932/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 19C11C3270\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 May 2022 14:34:00 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6D6B965683;\n\tTue, 17 May 2022 16:33:59 +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 A78866566B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 May 2022 16:33:55 +0200 (CEST)",
            "from deskari.lan (91-156-85-209.elisa-laajakaista.fi\n\t[91.156.85.209])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 22D678E6;\n\tTue, 17 May 2022 16:33:55 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652798039;\n\tbh=hFwAE5tnu4o6+UhDKvevxclNwmDGxiwsg/j5d7ZJsUo=;\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=2ooL/cPTWSCZWB+bi0lWpFeBmPULlEXi70rH8gYbzrym7yW1Lf3h9gURWKnWbX75Z\n\tuwgb64apGj2XxrRGkVhgvvnQN6u9l4qK6N2a5IivgGM5AIUztKdZg7UM6dZywxhKLN\n\txHBSKv7XvJtip2cV8S7WBjRtnSN98mmOc2zitJg0axo/OMNmzuSoDuqcAL2jZI+8vI\n\tdtbupZ6CLrcOdl7hgsO+xElDPohQxoCYjkQTnjN8N1uWAOACp0ONABeMCIZ32563I/\n\tJW+VkbyEDksh3r38utMzXdGr6uVKlMrgA4j5cXaukdKnKvAs0dofCDY76tzKjZJbd9\n\tfN1z3KDDraTkQ==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652798035;\n\tbh=hFwAE5tnu4o6+UhDKvevxclNwmDGxiwsg/j5d7ZJsUo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=DNEfYBRscUID0CkpUu3wPCLShTmUwuBuUwifYKJGMyUs/gb1JQ4mB7c8Gritz8/q9\n\tetzzVZraJfSnOkZOGKjMK/s4gPXYE0aJqaOj+wlcdtFz3QUrxOQj8Zjns42eEbvhAE\n\tkAHFXVPGfJjasJ9Uw+QEh6t8Pp2R/9DOSFTVHDow="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"DNEfYBRs\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tJacopo Mondi <jacopo@jmondi.org>",
        "Date": "Tue, 17 May 2022 17:33:20 +0300",
        "Message-Id": "<20220517143325.71784-9-tomi.valkeinen@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220517143325.71784-1-tomi.valkeinen@ideasonboard.com>",
        "References": "<20220517143325.71784-1-tomi.valkeinen@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 08/13] py: cam_kms: support multiplanar\n\tformats",
        "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": "Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Support multiplanar formats in the kms renderer. Tested with RPi and\nNV12.\n\nSigned-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/py/cam/cam_kms.py | 13 ++++++++++---\n 1 file changed, 10 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/py/cam/cam_kms.py b/src/py/cam/cam_kms.py\nindex ae6be277..f1844717 100644\n--- a/src/py/cam/cam_kms.py\n+++ b/src/py/cam/cam_kms.py\n@@ -10,6 +10,7 @@ FMT_MAP = {\n     'YUYV': pykms.PixelFormat.YUYV,\n     'ARGB8888': pykms.PixelFormat.ARGB8888,\n     'XRGB8888': pykms.PixelFormat.XRGB8888,\n+    'NV12': pykms.PixelFormat.NV12,\n }\n \n \n@@ -133,10 +134,16 @@ class KMSRenderer:\n \n                 for fb in ctx['allocator'].buffers(stream):\n                     w, h = cfg.size\n-                    stride = cfg.stride\n-                    fd = fb.fd(0)\n+                    fds = []\n+                    strides = []\n+                    offsets = []\n+                    for i in range(fb.num_planes):\n+                        fds.append(fb.fd(i))\n+                        strides.append(cfg.stride)\n+                        offsets.append(fb.offset(i))\n+\n                     drmfb = pykms.DmabufFramebuffer(self.card, w, h, fmt,\n-                                                    [fd], [stride], [0])\n+                                                    fds, strides, offsets)\n                     self.cam_2_drm[fb] = drmfb\n \n                 idx += 1\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "08/13"
    ]
}