Show a patch.

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

{
    "id": 20039,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/20039/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20039/",
    "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": "<20240510100208.12188-5-naush@raspberrypi.com>",
    "date": "2024-05-10T10:02:05",
    "name": "[v3,4/7] libcamera: formats: Add PiSP specific image and config buffer formats",
    "commit_ref": "8c93055043a522715f7bdc51af1b25cafa68e3d1",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a07f8fb0dacdb66161cdb18562f25d4bc422ff68",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/20039/mbox/",
    "series": [
        {
            "id": 4305,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4305/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4305",
            "date": "2024-05-10T10:02:01",
            "name": "Pre Raspberry Pi 5 support changes",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/4305/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20039/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20039/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 6F0EABDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 May 2024 10:02:26 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3FB3F6346D;\n\tFri, 10 May 2024 12:02:20 +0200 (CEST)",
            "from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n\t[IPv6:2a00:1450:4864:20::32d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B68D163462\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 May 2024 12:02:14 +0200 (CEST)",
            "by mail-wm1-x32d.google.com with SMTP id\n\t5b1f17b1804b1-41ba1ba55ffso10120375e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 May 2024 03:02:14 -0700 (PDT)",
            "from localhost.localdomain ([188.39.149.98])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-41fccee9318sm57936385e9.30.2024.05.10.03.02.13\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 10 May 2024 03:02:13 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"cQxYUYdx\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1715335334; x=1715940134;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=PyVDYGaov1YiibFVvu3OiFNuibVQ0fL5Fnk/o7/Dc1E=;\n\tb=cQxYUYdxvc/wrBc4aEgR+H7P3TcvyvJlROQH5FTssUgbjKWKv6v6Ore4wp46HiSPPw\n\t62VKV6NXK1DmJK9thtX4RT2TsexY5wEG63uXY93Xr6NpZGU+4FcAHD3e6l9WTmMn4IgZ\n\tczg1FeWnHWO1Wx2C3XUv2b4novFiOHJkXEzJRyIFyFWonC2GBMsOe/eZeKVOMzZgZhO3\n\tzy2ahxFYAjZ7lEq5hFfst06iqNkrbQP1Z4RxSGEnXCYKs3qoJskVUn3oi6UVqEEb3l0N\n\tf4HwsL9ys6gYuEi/gnqECJmcXJDtKreHXXSQE58Il/DaTBGtzo70AJrosOUdKEmwGL3B\n\tnTPw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1715335334; x=1715940134;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=PyVDYGaov1YiibFVvu3OiFNuibVQ0fL5Fnk/o7/Dc1E=;\n\tb=CUJgX+7GW8egjfDasBVBoZECol8h1AMlEVN3xyamnPwZxlVq7H8av9q5AbhSNPpZ6V\n\tGqy5IiSsoiLhzSxM5f3zTlDtoV0T9MYY+JbS3w5ZfU0oAz1G/xr+uWIbVSZDMb7FMPgo\n\tlkUlpcBJC0e++eyCbEL1JZMDqeJiBVHfet4OPeJgJeuwKXdiYAOP/irQJeqkqEezBjQk\n\tPmpwbjdMGPbRZpoDYXUB8MSDTumF3GXMvkgsdfSeGhcvedXBXDHZLjJSEDml6K/8HK03\n\ttWJegW2YXE0jdzZvG28jAS71S0fxhJTvsZBoE/I5IkMWjhVtSeQ8Mwe0OkJNWwIYsXUa\n\tpvcQ==",
        "X-Gm-Message-State": "AOJu0YyoGtt9AphOarJK2XBpdB4Xi8VXNfa/5Qerm5qI6Ik0YzdfMB1E\n\trwKU9HuNW71kY+z022+EiYbOayEaig+qcbqsbdKi4bbCgtKY+JC7vqoUqg+tBwsZypAG8loR0pz\n\ty",
        "X-Google-Smtp-Source": "AGHT+IEPOad8v+RZlR8MnhNxssVFD5udw7va3Ly8BXA6lDBFFwOHm5R/ZWQ8XUehI08vASdKH9bPyQ==",
        "X-Received": "by 2002:a05:600c:4754:b0:41f:ae5a:c72f with SMTP id\n\t5b1f17b1804b1-41fbc91f419mr46821565e9.1.1715335333953; \n\tFri, 10 May 2024 03:02:13 -0700 (PDT)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Naushir Patuck <naush@raspberrypi.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "Subject": "[PATCH v3 4/7] libcamera: formats: Add PiSP specific image and\n\tconfig buffer formats",
        "Date": "Fri, 10 May 2024 11:02:05 +0100",
        "Message-Id": "<20240510100208.12188-5-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240510100208.12188-1-naush@raspberrypi.com>",
        "References": "<20240510100208.12188-1-naush@raspberrypi.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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add the Raspberry Pi 5 PiSP specific compressed Bayer format types 1/2:\n- V4L2_PIX_FMT_PISP_COMP1_xxx\n- V4L2_PIX_FMT_PISP_COMP2_xxx\n\nAdd the Raspberry Pi 5 PiSP Frontend and Backend config formats:\n- V4L2_META_FMT_RPI_FE_CFG\n- V4L2_META_FMT_RPI_BE_CFG\n\nAdd the Raspberry Pi 5 PiSP Frontend statistics format:\n- V4L2_META_FMT_RPI_FE_STATS\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n include/libcamera/internal/bayer_format.h |  2 +\n src/libcamera/bayer_format.cpp            | 18 ++++++++\n src/libcamera/formats.cpp                 | 51 ++++++++++++++++++++++-\n src/libcamera/formats.yaml                | 16 +++++++\n src/libcamera/v4l2_pixelformat.cpp        | 10 +++++\n 5 files changed, 96 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h\nindex e2e69ecc3b49..5c14bb5fb2d5 100644\n--- a/include/libcamera/internal/bayer_format.h\n+++ b/include/libcamera/internal/bayer_format.h\n@@ -34,6 +34,8 @@ public:\n \t\tNone = 0,\n \t\tCSI2 = 1,\n \t\tIPU3 = 2,\n+\t\tPISP1 = 3,\n+\t\tPISP2 = 4,\n \t};\n \n \tconstexpr BayerFormat()\ndiff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp\nindex e7ecadcee534..014f716d28f7 100644\n--- a/src/libcamera/bayer_format.cpp\n+++ b/src/libcamera/bayer_format.cpp\n@@ -61,6 +61,10 @@ namespace libcamera {\n  * \\brief Format uses MIPI CSI-2 style packing\n  * \\var BayerFormat::Packing::IPU3\n  * \\brief Format uses IPU3 style packing\n+ * \\var BayerFormat::Packing::PISP1\n+ * \\brief Format uses PISP mode 1 compression\n+ * \\var BayerFormat::Packing::PISP2\n+ * \\brief Format uses PISP mode 2 compression\n  */\n \n namespace {\n@@ -164,6 +168,14 @@ const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{\n \t\t{ formats::SGRBG16, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16) } },\n \t{ { BayerFormat::RGGB, 16, BayerFormat::Packing::None },\n \t\t{ formats::SRGGB16, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16) } },\n+\t{ { BayerFormat::BGGR, 16, BayerFormat::Packing::PISP1 },\n+\t\t{ formats::BGGR_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_BGGR) } },\n+\t{ { BayerFormat::GBRG, 16, BayerFormat::Packing::PISP1 },\n+\t\t{ formats::GBRG_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GBRG) } },\n+\t{ { BayerFormat::GRBG, 16, BayerFormat::Packing::PISP1 },\n+\t\t{ formats::GRBG_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GRBG) } },\n+\t{ { BayerFormat::RGGB, 16, BayerFormat::Packing::PISP1 },\n+\t\t{ formats::RGGB_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_RGGB) } },\n \t{ { BayerFormat::MONO, 8, BayerFormat::Packing::None },\n \t\t{ formats::R8, V4L2PixelFormat(V4L2_PIX_FMT_GREY) } },\n \t{ { BayerFormat::MONO, 10, BayerFormat::Packing::None },\n@@ -174,6 +186,8 @@ const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{\n \t\t{ formats::R12, V4L2PixelFormat(V4L2_PIX_FMT_Y12) } },\n \t{ { BayerFormat::MONO, 16, BayerFormat::Packing::None },\n \t\t{ formats::R16, V4L2PixelFormat(V4L2_PIX_FMT_Y16) } },\n+\t{ { BayerFormat::MONO, 16, BayerFormat::Packing::PISP1 },\n+\t\t{ formats::MONO_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_MONO) } },\n };\n \n const std::unordered_map<unsigned int, BayerFormat> mbusCodeToBayer{\n@@ -303,6 +317,10 @@ std::ostream &operator<<(std::ostream &out, const BayerFormat &f)\n \t\tout << \"-CSI2P\";\n \telse if (f.packing == BayerFormat::Packing::IPU3)\n \t\tout << \"-IPU3P\";\n+\telse if (f.packing == BayerFormat::Packing::PISP1)\n+\t\tout << \"-PISP1\";\n+\telse if (f.packing == BayerFormat::Packing::PISP2)\n+\t\tout << \"-PISP2\";\n \n \treturn out;\n }\ndiff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nindex e2d292c232a5..cf41f2c261ed 100644\n--- a/src/libcamera/formats.cpp\n+++ b/src/libcamera/formats.cpp\n@@ -547,6 +547,16 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.pixelsPerGroup = 1,\n \t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n \t} },\n+\t{ formats::MONO_PISP_COMP1, {\n+\t\t.name = \"MONO_PISP_COMP1\",\n+\t\t.format = formats::MONO_PISP_COMP1,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_MONO), },\n+\t\t.bitsPerPixel = 8,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n+\t\t.packed = true,\n+\t\t.pixelsPerGroup = 1,\n+\t\t.planes = {{ { 1, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n \n \t/* Bayer formats. */\n \t{ formats::SBGGR8, {\n@@ -910,7 +920,46 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.pixelsPerGroup = 25,\n \t\t.planes = {{ { 32, 1 }, { 0, 0 }, { 0, 0 } }},\n \t} },\n-\n+\t{ formats::BGGR_PISP_COMP1, {\n+\t\t.name = \"BGGR_PISP_COMP1\",\n+\t\t.format = formats::BGGR_PISP_COMP1,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_BGGR), },\n+\t\t.bitsPerPixel = 8,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = true,\n+\t\t.pixelsPerGroup = 2,\n+\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::GBRG_PISP_COMP1, {\n+\t\t.name = \"GBRG_PISP_COMP1\",\n+\t\t.format = formats::GBRG_PISP_COMP1,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GBRG), },\n+\t\t.bitsPerPixel = 8,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = true,\n+\t\t.pixelsPerGroup = 2,\n+\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::GRBG_PISP_COMP1, {\n+\t\t.name = \"GRBG_PISP_COMP1\",\n+\t\t.format = formats::GRBG_PISP_COMP1,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GRBG), },\n+\t\t.bitsPerPixel = 8,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = true,\n+\t\t.pixelsPerGroup = 2,\n+\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::RGGB_PISP_COMP1, {\n+\t\t.name = \"RGGB_PISP_COMP1\",\n+\t\t.format = formats::RGGB_PISP_COMP1,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_RGGB), },\n+\t\t.bitsPerPixel = 8,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = true,\n+\t\t.pixelsPerGroup = 2,\n+\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n \t/* Compressed formats. */\n \t{ formats::MJPEG, {\n \t\t.name = \"MJPEG\",\ndiff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\nindex bde2cc803b98..fe027a7cce70 100644\n--- a/src/libcamera/formats.yaml\n+++ b/src/libcamera/formats.yaml\n@@ -190,4 +190,20 @@ formats:\n   - SBGGR10_IPU3:\n       fourcc: DRM_FORMAT_SBGGR10\n       mod: IPU3_FORMAT_MOD_PACKED\n+\n+  - RGGB_PISP_COMP1:\n+      fourcc: DRM_FORMAT_SRGGB16\n+      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n+  - GRBG_PISP_COMP1:\n+      fourcc: DRM_FORMAT_SGRBG16\n+      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n+  - GBRG_PISP_COMP1:\n+      fourcc: DRM_FORMAT_SGBRG16\n+      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n+  - BGGR_PISP_COMP1:\n+      fourcc: DRM_FORMAT_SBGGR16\n+      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n+  - MONO_PISP_COMP1:\n+      fourcc: DRM_FORMAT_R16\n+      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n ...\ndiff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\nindex d3a882dc69a5..70568335b266 100644\n--- a/src/libcamera/v4l2_pixelformat.cpp\n+++ b/src/libcamera/v4l2_pixelformat.cpp\n@@ -207,6 +207,16 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{\n \t\t{ formats::SGRBG16, \"16-bit Bayer GRGR/BGBG\" } },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16),\n \t\t{ formats::SRGGB16, \"16-bit Bayer RGRG/GBGB\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_BGGR),\n+\t\t{ formats::BGGR_PISP_COMP1, \"16-bit Bayer BGBG/GRGR PiSP Compress Mode 1\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GBRG),\n+\t\t{ formats::GBRG_PISP_COMP1, \"16-bit Bayer GBGB/RGRG PiSP Compress Mode 1\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GRBG),\n+\t\t{ formats::GRBG_PISP_COMP1, \"16-bit Bayer GRGR/BGBG PiSP Compress Mode 1\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_RGGB),\n+\t\t{ formats::RGGB_PISP_COMP1, \"16-bit Bayer RGRG/GBGB PiSP Compress Mode 1\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_MONO),\n+\t\t{ formats::MONO_PISP_COMP1, \"16-bit Mono PiSP Compress Mode 1\" } },\n \n \t/* Compressed formats. */\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_MJPEG),\n",
    "prefixes": [
        "v3",
        "4/7"
    ]
}