Show a patch.

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

{
    "id": 26213,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/26213/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/26213/",
    "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": "<20260219173423.1028522-1-dev@fredfunk.tech>",
    "date": "2026-02-19T17:34:34",
    "name": "[v2] gstreamer: Add CSI-2 packed Bayer format mappings",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a4587cf43fc9ca9f3e8f1154e13d04a17d7fe5c9",
    "submitter": {
        "id": 260,
        "url": "https://patchwork.libcamera.org/api/1.1/people/260/?format=api",
        "name": "Frederic Laing",
        "email": "dev@fredfunk.tech"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/26213/mbox/",
    "series": [
        {
            "id": 5803,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5803/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5803",
            "date": "2026-02-19T17:34:34",
            "name": "[v2] gstreamer: Add CSI-2 packed Bayer format mappings",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/5803/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/26213/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/26213/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 451CAC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Feb 2026 17:34:43 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A9C596225A;\n\tThu, 19 Feb 2026 18:34:42 +0100 (CET)",
            "from mail-4397.protonmail.ch (mail-4397.protonmail.ch\n\t[185.70.43.97])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1118A620C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Feb 2026 18:34:41 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=fredfunk.tech header.i=@fredfunk.tech\n\theader.b=\"mat30PXr\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=fredfunk.tech;\n\ts=protonmail; t=1771522478; x=1771781678;\n\tbh=o9MtWsiLlSyjJuVdnJWhuV7uepbeppX3vMF270fPFpk=;\n\th=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:\n\tSubject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector;\n\tb=mat30PXrCigUJ8BYo+J+olR1MKFrgeOZibJXf3wAQvSt1EbLDkuxwMCSUdudc3PzS\n\tHeTlXhcavBwbKv2BB9QNNT2BIbA97l5pr1BcJDeBduiZVXGrnRhGoErqjtoh/l0LkX\n\tFw6b2qEdcnMAnsmj7k8xwOOk4HmQws36gnFXZcaQNLe7rfX22gV0rlq5PkLKOC4vQi\n\twxmtanLLEMS4mLKK2t7dfOE+cDEZ7Vvxi9x74CJHBtyLSwIFAWy7FPl1vZXUhjaJkU\n\tY1quCT8PjMzhahbapz9G8zLhxiY+e989mMCmyPVBUk4rrnJ/XFckmRaWr2+T7G0Lc4\n\tIoizNhNXCMDFg==",
        "Date": "Thu, 19 Feb 2026 17:34:34 +0000",
        "To": "libcamera-devel@lists.libcamera.org",
        "From": "Frederic Laing <dev@fredfunk.tech>",
        "Cc": "Frederic Laing <dev@fredfunk.tech>",
        "Subject": "[PATCH v2] gstreamer: Add CSI-2 packed Bayer format mappings",
        "Message-ID": "<20260219173423.1028522-1-dev@fredfunk.tech>",
        "Feedback-ID": "182542373:user:proton",
        "X-Pm-Message-ID": "ad1820bcd37e3a4ca8247e7956dfc8dc508f0899",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=utf-8",
        "Content-Transfer-Encoding": "quoted-printable",
        "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": "Add SRGGB/SBGGR/SGBRG/SGRBG 10/12/14-bit CSI-2 packed (CSI2P) format\nentries to both format_map and bayer_map in gstlibcamera-utils.cpp.\n\nMany camera sensors (e.g., IMX371, IMX376) natively output\nCSI-2 packed Bayer formats like SRGGB10_CSI2P. Without mappings for\nthese formats, GStreamer's libcamerasrc cannot negotiate raw Bayer\noutput (video/x-bayer caps) when the sensor only supports CSI2P\nvariants, causing caps negotiation to fail with empty caps.\n\nThis is particularly important for dual-stream (ViewFinder + Raw)\ncapture where the Raw stream needs to use the sensor's native CSI2P\nformat. The Software ISP processes only the ViewFinder stream while\nthe Raw stream bypasses it entirely, but GStreamer needs to be able\nto represent the Raw stream's format in caps.\n\nThe CSI2P formats are mapped to distinct GStreamer Bayer format names\nusing a \"p\" suffix (e.g., SRGGB10_CSI2P -> \"rggb10p\") to distinguish\nthem from their unpacked counterparts (e.g., SRGGB10 -> \"rggb10le\").\n\nThis patch depends on the corresponding GStreamer merge request that\nadds CSI-2 packed Bayer format support to the V4L2 plugin:\nhttps://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/10852\n\nTested on OnePlus 6T (Qualcomm SDM845) with IMX371 front camera:\n- Single raw stream: 4656x3496 SRGGB10_CSI2P\n- Dual stream: 640x480 ABGR8888 (ViewFinder) + 4656x3496 SRGGB10_CSI2P\n\nSigned-off-by: Frederic Laing <dev@fredfunk.tech>\n---\n src/gstreamer/gstlibcamera-utils.cpp | 31 +++++++++++++++++++++++++++-\n 1 file changed, 30 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp\nindex bfb094c9..467e4f71 100644\n--- a/src/gstreamer/gstlibcamera-utils.cpp\n+++ b/src/gstreamer/gstlibcamera-utils.cpp\n@@ -22,7 +22,7 @@ static const struct {\n \t/* Compressed */\n \t{ GST_VIDEO_FORMAT_ENCODED, formats::MJPEG },\n \n-\t/* Bayer formats */\n+\t/* Bayer formats - unpacked */\n \t{ GST_VIDEO_FORMAT_ENCODED, formats::SBGGR8 },\n \t{ GST_VIDEO_FORMAT_ENCODED, formats::SGBRG8 },\n \t{ GST_VIDEO_FORMAT_ENCODED, formats::SGRBG8 },\n@@ -44,6 +44,20 @@ static const struct {\n \t{ GST_VIDEO_FORMAT_ENCODED, formats::SGRBG16 },\n \t{ GST_VIDEO_FORMAT_ENCODED, formats::SRGGB16 },\n \n+\t/* Bayer formats - CSI-2 packed */\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SBGGR10_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SGBRG10_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SGRBG10_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SRGGB10_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SBGGR12_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SGBRG12_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SGRBG12_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SRGGB12_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SBGGR14_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SGBRG14_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SGRBG14_CSI2P },\n+\t{ GST_VIDEO_FORMAT_ENCODED, formats::SRGGB14_CSI2P },\n+\n \t/* Monochrome */\n \t{ GST_VIDEO_FORMAT_GRAY8, formats::R8 },\n \t{ GST_VIDEO_FORMAT_GRAY16_LE, formats::R16 },\n@@ -265,6 +279,7 @@ static const struct {\n \tPixelFormat format;\n \tconst gchar *name;\n } bayer_map[]{\n+\t/* Unpacked */\n \t{ formats::SBGGR8, \"bggr\" },\n \t{ formats::SGBRG8, \"gbrg\" },\n \t{ formats::SGRBG8, \"grbg\" },\n@@ -285,6 +300,20 @@ static const struct {\n \t{ formats::SGBRG16, \"gbrg16le\" },\n \t{ formats::SGRBG16, \"grbg16le\" },\n \t{ formats::SRGGB16, \"rggb16le\" },\n+\n+\t/* CSI-2 packed */\n+\t{ formats::SBGGR10_CSI2P, \"bggr10p\" },\n+\t{ formats::SGBRG10_CSI2P, \"gbrg10p\" },\n+\t{ formats::SGRBG10_CSI2P, \"grbg10p\" },\n+\t{ formats::SRGGB10_CSI2P, \"rggb10p\" },\n+\t{ formats::SBGGR12_CSI2P, \"bggr12p\" },\n+\t{ formats::SGBRG12_CSI2P, \"gbrg12p\" },\n+\t{ formats::SGRBG12_CSI2P, \"grbg12p\" },\n+\t{ formats::SRGGB12_CSI2P, \"rggb12p\" },\n+\t{ formats::SBGGR14_CSI2P, \"bggr14p\" },\n+\t{ formats::SGBRG14_CSI2P, \"gbrg14p\" },\n+\t{ formats::SGRBG14_CSI2P, \"grbg14p\" },\n+\t{ formats::SRGGB14_CSI2P, \"rggb14p\" },\n };\n \n static const gchar *\n",
    "prefixes": [
        "v2"
    ]
}