Patch Detail
Show a patch.
GET /api/1.1/patches/18536/?format=api
{ "id": 18536, "url": "https://patchwork.libcamera.org/api/1.1/patches/18536/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18536/", "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": "<20230418141823.24642-1-jacopo.mondi@ideasonboard.com>", "date": "2023-04-18T14:18:23", "name": "[libcamera-devel] libcamera: formats: Add 14-bits Bayer RAW formats", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c0061688ce9d8f71798791f46b9d811d88e27885", "submitter": { "id": 143, "url": "https://patchwork.libcamera.org/api/1.1/people/143/?format=api", "name": "Jacopo Mondi", "email": "jacopo.mondi@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18536/mbox/", "series": [ { "id": 3841, "url": "https://patchwork.libcamera.org/api/1.1/series/3841/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3841", "date": "2023-04-18T14:18:23", "name": "[libcamera-devel] libcamera: formats: Add 14-bits Bayer RAW formats", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3841/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18536/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18536/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 3EEC8BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 18 Apr 2023 14:18:43 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7136B627B8;\n\tTue, 18 Apr 2023 16:18:42 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CD70E603A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 18 Apr 2023 16:18:40 +0200 (CEST)", "from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6147C9C;\n\tTue, 18 Apr 2023 16:18:34 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1681827522;\n\tbh=GzGhVj9cB6z6qgWduaX/Gsi5PijyTF0fJaHuHW3YZlQ=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=qTMzM0W/5gOnDIeyrP8A2O992I3KZCzBMKVOgr0Q6vfeA9BSZ+uK1C3jRSLIIwVfX\n\tAGAIVti2YTi8wWfJ7iENoqLpXhBIcHYrgj/x71aowkxzI2UVva8iiK1M498bohwWcL\n\tFIC4ycgDngD0YaJKxnScPV9GjECgslNAuv2CoLDU1/U5BTub7v9ZkLmyj+sFNlFUzy\n\tgwBV7REUwU1OvPwdQVx4fj3QO5l8dIIFRnwpOAWafOfTXng7VFnzfsGkW3XAh9fy0C\n\tBKt/tckM3zCx+k11IHx99dMx6dtY8JxsWnx60kSTJdIoiFdDCojNZH2F8FDfJ7m63+\n\tc9NoG7nHUolIQ==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1681827514;\n\tbh=GzGhVj9cB6z6qgWduaX/Gsi5PijyTF0fJaHuHW3YZlQ=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=TVZEvz4I87QFBXWkPE9edutQ0NYaEc03yg22g24IdGNaJrIUVMfD5m1GVRRzDa+Uq\n\tR0Ugqt5BbABP0Gy/WF4ulCcF02t58JpbQF4DM/Uxk4FXYxLfMVdcF0uGLCZJbyju94\n\tqOf5jjqMRmBzmOdgiAFCyj5wcvfKX8B6FmuZleqM=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"TVZEvz4I\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 18 Apr 2023 16:18:23 +0200", "Message-Id": "<20230418141823.24642-1-jacopo.mondi@ideasonboard.com>", "X-Mailer": "git-send-email 2.40.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: formats: Add 14-bits Bayer RAW\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": "Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add formats definition and mappings for 14-bits Bayer RAW formats.\n\nAdd definitions for non-packed and CSI-2 packed variants.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/libcamera/bayer_format.cpp | 16 ++++++\n src/libcamera/formats.c | 0\n src/libcamera/formats.cpp | 80 ++++++++++++++++++++++++++++++\n src/libcamera/formats.yaml | 22 ++++++++\n src/libcamera/v4l2_pixelformat.cpp | 16 ++++++\n 5 files changed, 134 insertions(+)\n create mode 100644 src/libcamera/formats.c\n\n--\n2.40.0", "diff": "diff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp\nindex 6a76d6a4b6dc..3bf15fb48f36 100644\n--- a/src/libcamera/bayer_format.cpp\n+++ b/src/libcamera/bayer_format.cpp\n@@ -140,6 +140,22 @@ const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{\n \t\t{ formats::SGRBG12_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P) } },\n \t{ { BayerFormat::RGGB, 12, BayerFormat::Packing::CSI2 },\n \t\t{ formats::SRGGB12_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P) } },\n+\t{ { BayerFormat::BGGR, 14, BayerFormat::Packing::None },\n+\t\t{ formats::SBGGR14, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR14) } },\n+\t{ { BayerFormat::GBRG, 14, BayerFormat::Packing::None },\n+\t\t{ formats::SGBRG14, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG14) } },\n+\t{ { BayerFormat::GRBG, 14, BayerFormat::Packing::None },\n+\t\t{ formats::SGRBG14, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG14) } },\n+\t{ { BayerFormat::RGGB, 14, BayerFormat::Packing::None },\n+\t\t{ formats::SRGGB14, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB14) } },\n+\t{ { BayerFormat::BGGR, 14, BayerFormat::Packing::CSI2 },\n+\t\t{ formats::SBGGR14_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR14P) } },\n+\t{ { BayerFormat::GBRG, 14, BayerFormat::Packing::CSI2 },\n+\t\t{ formats::SGBRG14_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_SGBRG14P) } },\n+\t{ { BayerFormat::GRBG, 14, BayerFormat::Packing::CSI2 },\n+\t\t{ formats::SGRBG14_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG14P) } },\n+\t{ { BayerFormat::RGGB, 14, BayerFormat::Packing::CSI2 },\n+\t\t{ formats::SRGGB14_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB14P) } },\n \t{ { BayerFormat::BGGR, 16, BayerFormat::Packing::None },\n \t\t{ formats::SBGGR16, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16) } },\n \t{ { BayerFormat::GBRG, 16, BayerFormat::Packing::None },\ndiff --git a/src/libcamera/formats.c b/src/libcamera/formats.c\nnew file mode 100644\nindex 000000000000..e69de29bb2d1\ndiff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nindex f5769c489e16..447e623803c7 100644\n--- a/src/libcamera/formats.cpp\n+++ b/src/libcamera/formats.cpp\n@@ -719,6 +719,86 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t\t.pixelsPerGroup = 2,\n \t\t.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},\n \t} },\n+\t{ formats::SBGGR14, {\n+\t\t.name = \"SBGGR14\",\n+\t\t.format = formats::SBGGR14,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SBGGR14), },\n+\t\t.bitsPerPixel = 14,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = false,\n+\t\t.pixelsPerGroup = 2,\n+\t\t.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::SGBRG14, {\n+\t\t.name = \"SGBRG14\",\n+\t\t.format = formats::SGBRG14,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGBRG14), },\n+\t\t.bitsPerPixel = 14,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = false,\n+\t\t.pixelsPerGroup = 2,\n+\t\t.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::SGRBG14, {\n+\t\t.name = \"SGRBG14\",\n+\t\t.format = formats::SGRBG14,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGRBG14), },\n+\t\t.bitsPerPixel = 14,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = false,\n+\t\t.pixelsPerGroup = 2,\n+\t\t.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::SRGGB14, {\n+\t\t.name = \"SRGGB14\",\n+\t\t.format = formats::SRGGB14,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SRGGB14), },\n+\t\t.bitsPerPixel = 14,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = false,\n+\t\t.pixelsPerGroup = 2,\n+\t\t.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::SBGGR14_CSI2P, {\n+\t\t.name = \"SBGGR14_CSI2P\",\n+\t\t.format = formats::SBGGR14_CSI2P,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SBGGR14P), },\n+\t\t.bitsPerPixel = 14,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = true,\n+\t\t.pixelsPerGroup = 4,\n+\t\t.planes = {{ { 7, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::SGBRG14_CSI2P, {\n+\t\t.name = \"SGBRG14_CSI2P\",\n+\t\t.format = formats::SGBRG14_CSI2P,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGBRG14P), },\n+\t\t.bitsPerPixel = 14,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = true,\n+\t\t.pixelsPerGroup = 4,\n+\t\t.planes = {{ { 7, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::SGRBG14_CSI2P, {\n+\t\t.name = \"SGRBG14_CSI2P\",\n+\t\t.format = formats::SGRBG14_CSI2P,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SGRBG14P), },\n+\t\t.bitsPerPixel = 14,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = true,\n+\t\t.pixelsPerGroup = 4,\n+\t\t.planes = {{ { 7, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n+\t{ formats::SRGGB14_CSI2P, {\n+\t\t.name = \"SRGGB14_CSI2P\",\n+\t\t.format = formats::SRGGB14_CSI2P,\n+\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SRGGB14P), },\n+\t\t.bitsPerPixel = 14,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n+\t\t.packed = true,\n+\t\t.pixelsPerGroup = 4,\n+\t\t.planes = {{ { 7, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\n \t{ formats::SBGGR16, {\n \t\t.name = \"SBGGR16\",\n \t\t.format = formats::SBGGR16,\ndiff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\nindex e586cde1d705..539ac0b33084 100644\n--- a/src/libcamera/formats.yaml\n+++ b/src/libcamera/formats.yaml\n@@ -110,6 +110,15 @@ formats:\n - SBGGR12:\n fourcc: DRM_FORMAT_SBGGR12\n\n+ - SRGGB14:\n+ fourcc: DRM_FORMAT_SRGGB14\n+ - SGRBG14:\n+ fourcc: DRM_FORMAT_SGRBG14\n+ - SGBRG14:\n+ fourcc: DRM_FORMAT_SGBRG14\n+ - SBGGR14:\n+ fourcc: DRM_FORMAT_SBGGR14\n+\n - SRGGB16:\n fourcc: DRM_FORMAT_SRGGB16\n - SGRBG16:\n@@ -149,6 +158,19 @@ formats:\n fourcc: DRM_FORMAT_SBGGR12\n mod: MIPI_FORMAT_MOD_CSI2_PACKED\n\n+ - SRGGB14_CSI2P:\n+ fourcc: DRM_FORMAT_SRGGB14\n+ mod: MIPI_FORMAT_MOD_CSI2_PACKED\n+ - SGRBG14_CSI2P:\n+ fourcc: DRM_FORMAT_SGRBG14\n+ mod: MIPI_FORMAT_MOD_CSI2_PACKED\n+ - SGBRG14_CSI2P:\n+ fourcc: DRM_FORMAT_SGBRG14\n+ mod: MIPI_FORMAT_MOD_CSI2_PACKED\n+ - SBGGR14_CSI2P:\n+ fourcc: DRM_FORMAT_SBGGR14\n+ mod: MIPI_FORMAT_MOD_CSI2_PACKED\n+\n - SRGGB10_IPU3:\n fourcc: DRM_FORMAT_SRGGB10\n mod: IPU3_FORMAT_MOD_PACKED\ndiff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\nindex d87665a4916f..a7ae69bb317d 100644\n--- a/src/libcamera/v4l2_pixelformat.cpp\n+++ b/src/libcamera/v4l2_pixelformat.cpp\n@@ -177,6 +177,22 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{\n \t\t{ formats::SGRBG12_CSI2P, \"12-bit Bayer GRGR/BGBG Packed\" } },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P),\n \t\t{ formats::SRGGB12_CSI2P, \"12-bit Bayer RGRG/GBGB Packed\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR14),\n+\t\t{ formats::SBGGR14, \"14-bit Bayer BGBG/GRGR\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG14),\n+\t\t{ formats::SGBRG14, \"14-bit Bayer GBGB/RGRG\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG14),\n+\t\t{ formats::SGRBG14, \"14-bit Bayer GRGR/BGBG\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB14),\n+\t\t{ formats::SRGGB14, \"14-bit Bayer RGRG/GBGB\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR14P),\n+\t\t{ formats::SBGGR14_CSI2P, \"14-bit Bayer BGBG/GRGR Packed\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG14P),\n+\t\t{ formats::SGBRG14_CSI2P, \"14-bit Bayer GBGB/RGRG Packed\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG14P),\n+\t\t{ formats::SGRBG14_CSI2P, \"14-bit Bayer GRGR/BGBG Packed\" } },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB14P),\n+\t\t{ formats::SRGGB14_CSI2P, \"14-bit Bayer RGRG/GBGB Packed\" } },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16),\n \t\t{ formats::SBGGR16, \"16-bit Bayer BGBG/GRGR\" } },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16),\n", "prefixes": [ "libcamera-devel" ] }