Show a patch.

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

{
    "id": 27359,
    "url": "https://patchwork.libcamera.org/api/patches/27359/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/27359/",
    "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": "<20260709134832.915809-1-kieran.bingham@ideasonboard.com>",
    "date": "2026-07-09T13:48:31",
    "name": "include: linux: Update to Linux 7.1",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e68a3ab3a85eee75774bc266520cb13d3fd5b2e5",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/27359/mbox/",
    "series": [
        {
            "id": 6055,
            "url": "https://patchwork.libcamera.org/api/series/6055/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6055",
            "date": "2026-07-09T13:48:31",
            "name": "include: linux: Update to Linux 7.1",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/6055/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/27359/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/27359/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 4FD8AC3301\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Jul 2026 13:48:37 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7D4CB660ED;\n\tThu,  9 Jul 2026 15:48:36 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B44BB660E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Jul 2026 15:48:35 +0200 (CEST)",
            "from Monstersaurus.lan\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1CE50593;\n\tThu,  9 Jul 2026 15:47:45 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pYVIxLO8\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1783604865;\n\tbh=LFaxYV9ffxF6Rgsx0Yze4lVv89Hht2yHYhnedjsDnNg=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=pYVIxLO8A7lYhRXBHP8P2JW1pBtmbQrnZAVEac3Yg5DKYEJSKFCzVMBiqFoJxQcXN\n\tYuoeJZYixjJvNmebMYl+1/U3+HoJJmO2jNzqhVr93gKXXBWSiSK6ZS6z3Hyek6zjsa\n\tG8awuyJokSk84llSkDEN8iji1BmKZ0AvyMxyzUIE=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Cc": "Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Subject": "[PATCH] include: linux: Update to Linux 7.1",
        "Date": "Thu,  9 Jul 2026 14:48:31 +0100",
        "Message-ID": "<20260709134832.915809-1-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Update the kernel headers to v7.1 using utils/update-kernel-headers.sh.\nPreserve the libcamera local modifications manually.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n---\n\nv2:\n - Update commit message\n - Bring in linux/bits.h which is now used by linux/drm_mode.h\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n include/linux/README           |  2 +-\n include/linux/bits.h           | 14 ++++++\n include/linux/drm_fourcc.h     | 16 +++++++\n include/linux/drm_mode.h       | 84 ++++++++++++++++++++++++++++++++++\n utils/update-kernel-headers.sh |  1 +\n 5 files changed, 116 insertions(+), 1 deletion(-)\n create mode 100644 include/linux/bits.h",
    "diff": "diff --git a/include/linux/README b/include/linux/README\nindex b02952bb28ca..9303e0f14ae6 100644\n--- a/include/linux/README\n+++ b/include/linux/README\n@@ -1,4 +1,4 @@\n # SPDX-License-Identifier: CC0-1.0\n \n-Files in this directory are imported from v7.0 of the Linux kernel. Do not\n+Files in this directory are imported from v7.1 of the Linux kernel. Do not\n modify them manually.\ndiff --git a/include/linux/bits.h b/include/linux/bits.h\nnew file mode 100644\nindex 000000000000..9243f3897518\n--- /dev/null\n+++ b/include/linux/bits.h\n@@ -0,0 +1,14 @@\n+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n+/* bits.h: Macros for dealing with bitmasks.  */\n+\n+#ifndef _LINUX_BITS_H\n+#define _LINUX_BITS_H\n+\n+#define __GENMASK(h, l) (((~_UL(0)) << (l)) & (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))\n+\n+#define __GENMASK_ULL(h, l) (((~_ULL(0)) << (l)) & (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))\n+\n+#define __GENMASK_U128(h, l) \\\n+\t((_BIT128((h)) << 1) - (_BIT128(l)))\n+\n+#endif /* _LINUX_BITS_H */\ndiff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\nindex e8a3d949032b..8e2a6abae62f 100644\n--- a/include/linux/drm_fourcc.h\n+++ b/include/linux/drm_fourcc.h\n@@ -1480,6 +1480,22 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n #define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED \\\n \tDRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 1ULL)\n \n+/*\n+ * ARM 64k interleaved modifier\n+ *\n+ * This is used by ARM Mali v10+ GPUs. With this modifier, the plane is divided\n+ * into 64k byte 1:1 or 2:1 -sided tiles. The 64k tiles are laid out linearly.\n+ * Each 64k tile is divided into blocks of 16x16 texel blocks, which are\n+ * themselves laid out linearly within a 64k tile. Then within each 16x16\n+ * block, texel blocks are laid out according to U order, similar to\n+ * 16X16_BLOCK_U_INTERLEAVED.\n+ *\n+ * Note that unlike 16X16_BLOCK_U_INTERLEAVED, the layout does not change\n+ * depending on whether a format is compressed or not.\n+ */\n+#define DRM_FORMAT_MOD_ARM_INTERLEAVED_64K \\\n+\tDRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 2ULL)\n+\n /*\n  * Allwinner tiled modifier\n  *\ndiff --git a/include/linux/drm_mode.h b/include/linux/drm_mode.h\nindex 8894b7a80732..381a3e857d4e 100644\n--- a/include/linux/drm_mode.h\n+++ b/include/linux/drm_mode.h\n@@ -10,6 +10,9 @@\n #ifndef _DRM_MODE_H\n #define _DRM_MODE_H\n \n+#include <linux/bits.h>\n+#include <linux/const.h>\n+\n #include \"drm.h\"\n \n #if defined(__cplusplus)\n@@ -149,6 +152,10 @@ extern \"C\" {\n #define DRM_MODE_LINK_STATUS_GOOD\t0\n #define DRM_MODE_LINK_STATUS_BAD\t1\n \n+/* Panel type property */\n+#define DRM_MODE_PANEL_TYPE_UNKNOWN\t0\n+#define DRM_MODE_PANEL_TYPE_OLED\t1\n+\n /*\n  * DRM_MODE_ROTATE_<degrees>\n  *\n@@ -1528,6 +1535,83 @@ struct drm_mode_closefb {\n \t__u32 pad;\n };\n \n+/*\n+ * Put 16-bit ARGB values into a standard 64-bit representation that can be\n+ * used for ioctl parameters, inter-driver communication, etc.\n+ *\n+ * If the component values being provided contain less than 16 bits of\n+ * precision, use a conversion ratio to get a better color approximation.\n+ * The ratio is computed as (2^16 - 1) / (2^bpc - 1), where bpc and 16 are\n+ * the input and output precision, respectively.\n+ * Also note bpc must be greater than 0.\n+ */\n+#define __DRM_ARGB64_PREP(c, shift)\t\t\t\t\t\\\n+\t(((__u64)(c) & __GENMASK(15, 0)) << (shift))\n+\n+#define __DRM_ARGB64_PREP_BPC(c, shift, bpc)\t\t\t\t\\\n+({\t\t\t\t\t\t\t\t\t\\\n+\t__u16 mask = __GENMASK((bpc) - 1, 0);\t\t\t\t\\\n+\t__u16 conv = __KERNEL_DIV_ROUND_CLOSEST((mask & (c)) *\t\t\\\n+\t\t\t\t\t\t__GENMASK(15, 0), mask);\\\n+\t__DRM_ARGB64_PREP(conv, shift);\t\t\t\t\t\\\n+})\n+\n+#define DRM_ARGB64_PREP(alpha, red, green, blue)\t\t\t\\\n+(\t\t\t\t\t\t\t\t\t\\\n+\t__DRM_ARGB64_PREP(alpha, 48) |\t\t\t\t\t\\\n+\t__DRM_ARGB64_PREP(red,   32) |\t\t\t\t\t\\\n+\t__DRM_ARGB64_PREP(green, 16) |\t\t\t\t\t\\\n+\t__DRM_ARGB64_PREP(blue,   0)\t\t\t\t\t\\\n+)\n+\n+#define DRM_ARGB64_PREP_BPC(alpha, red, green, blue, bpc)\t\t\\\n+({\t\t\t\t\t\t\t\t\t\\\n+\t__typeof__(bpc) __bpc = bpc;\t\t\t\t\t\\\n+\t__DRM_ARGB64_PREP_BPC(alpha, 48, __bpc) |\t\t\t\\\n+\t__DRM_ARGB64_PREP_BPC(red,   32, __bpc) |\t\t\t\\\n+\t__DRM_ARGB64_PREP_BPC(green, 16, __bpc) |\t\t\t\\\n+\t__DRM_ARGB64_PREP_BPC(blue,   0, __bpc);\t\t\t\\\n+})\n+\n+/*\n+ * Extract the specified color component from a standard 64-bit ARGB value.\n+ *\n+ * If the requested precision is less than 16 bits, make use of a conversion\n+ * ratio calculated as (2^bpc - 1) / (2^16 - 1), where bpc and 16 are the\n+ * output and input precision, respectively.\n+ *\n+ * If speed is more important than accuracy, use DRM_ARGB64_GET*_BPCS()\n+ * instead of DRM_ARGB64_GET*_BPC() in order to replace the expensive\n+ * division with a simple bit right-shift operation.\n+ */\n+#define __DRM_ARGB64_GET(c, shift)\t\t\t\t\t\\\n+\t((__u16)(((__u64)(c) >> (shift)) & __GENMASK(15, 0)))\n+\n+#define __DRM_ARGB64_GET_BPC(c, shift, bpc)\t\t\t\t\\\n+({\t\t\t\t\t\t\t\t\t\\\n+\t__u16 comp = __DRM_ARGB64_GET(c, shift);\t\t\t\\\n+\t__KERNEL_DIV_ROUND_CLOSEST(comp * __GENMASK((bpc) - 1, 0),\t\\\n+\t\t\t\t   __GENMASK(15, 0));\t\t\t\\\n+})\n+\n+#define __DRM_ARGB64_GET_BPCS(c, shift, bpc)\t\t\t\t\\\n+\t(__DRM_ARGB64_GET(c, shift) >> (16 - (bpc)))\n+\n+#define DRM_ARGB64_GETA(c)\t\t__DRM_ARGB64_GET(c, 48)\n+#define DRM_ARGB64_GETR(c)\t\t__DRM_ARGB64_GET(c, 32)\n+#define DRM_ARGB64_GETG(c)\t\t__DRM_ARGB64_GET(c, 16)\n+#define DRM_ARGB64_GETB(c)\t\t__DRM_ARGB64_GET(c, 0)\n+\n+#define DRM_ARGB64_GETA_BPC(c, bpc)\t__DRM_ARGB64_GET_BPC(c, 48, bpc)\n+#define DRM_ARGB64_GETR_BPC(c, bpc)\t__DRM_ARGB64_GET_BPC(c, 32, bpc)\n+#define DRM_ARGB64_GETG_BPC(c, bpc)\t__DRM_ARGB64_GET_BPC(c, 16, bpc)\n+#define DRM_ARGB64_GETB_BPC(c, bpc)\t__DRM_ARGB64_GET_BPC(c, 0, bpc)\n+\n+#define DRM_ARGB64_GETA_BPCS(c, bpc)\t__DRM_ARGB64_GET_BPCS(c, 48, bpc)\n+#define DRM_ARGB64_GETR_BPCS(c, bpc)\t__DRM_ARGB64_GET_BPCS(c, 32, bpc)\n+#define DRM_ARGB64_GETG_BPCS(c, bpc)\t__DRM_ARGB64_GET_BPCS(c, 16, bpc)\n+#define DRM_ARGB64_GETB_BPCS(c, bpc)\t__DRM_ARGB64_GET_BPCS(c, 0, bpc)\n+\n #if defined(__cplusplus)\n }\n #endif\ndiff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh\nindex d97840ee0181..3fdea5f1eb5d 100755\n--- a/utils/update-kernel-headers.sh\n+++ b/utils/update-kernel-headers.sh\n@@ -49,6 +49,7 @@ headers=\"\n \tdrm/drm.h\n \tdrm/drm_fourcc.h\n \tdrm/drm_mode.h\n+\tlinux/bits.h\n \tlinux/dma-buf.h\n \tlinux/dma-heap.h\n \tlinux/dw100.h\n",
    "prefixes": []
}