Patch Detail
Show a patch.
GET /api/patches/3347/?format=api
{ "id": 3347, "url": "https://patchwork.libcamera.org/api/patches/3347/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3347/", "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": "<20200326225844.4117712-4-niklas.soderlund@ragnatech.se>", "date": "2020-03-26T22:58:40", "name": "[libcamera-devel,v2,3/7] include: drm_fourcc: Add Bayer FourCC and modifiers", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "30ae65045582554f3e085ece001c27eb14cd7177", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3347/mbox/", "series": [ { "id": 785, "url": "https://patchwork.libcamera.org/api/series/785/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=785", "date": "2020-03-26T22:58:37", "name": "libcamera: Add support for a RAW still capture", "version": 2, "mbox": "https://patchwork.libcamera.org/series/785/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3347/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3347/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D49262D31\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Mar 2020 23:58:59 +0100 (CET)", "from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de\n\t[79.202.35.146]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid 5f08face-6fb5-11ea-aeed-005056917f90;\n\tThu, 26 Mar 2020 23:58:56 +0100 (CET)" ], "X-Halon-ID": "5f08face-6fb5-11ea-aeed-005056917f90", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 26 Mar 2020 23:58:40 +0100", "Message-Id": "<20200326225844.4117712-4-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20200326225844.4117712-1-niklas.soderlund@ragnatech.se>", "References": "<20200326225844.4117712-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 3/7] include: drm_fourcc: Add Bayer\n\tFourCC and modifiers", "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>", "X-List-Received-Date": "Thu, 26 Mar 2020 22:59:01 -0000" }, "content": "Add Bayer format and modifiers for patch submitted for upstream\ninclusion. The formats have not been accepted upstream yet but is needed\nto progress with RAW capture support in libcamera.\n\nIntention is to merge this in libcamera and update the header file the\nupstream patch is picked up upstream.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n* Changes since v1\n- Removed DNI label\n---\n include/linux/drm_fourcc.h | 94 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 94 insertions(+)", "diff": "diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\nindex 4bb1bfe93d5f4390..69240dfe1df0df28 100644\n--- a/include/linux/drm_fourcc.h\n+++ b/include/linux/drm_fourcc.h\n@@ -288,6 +288,62 @@ extern \"C\" {\n /* Compressed formats */\n #define DRM_FORMAT_MJPEG\tfourcc_code('M', 'J', 'P', 'G') /* Motion-JPEG */\n \n+/*\n+ * Bayer formats\n+ *\n+ * Bayer formats contain green, red and blue components, with alternating lines\n+ * of red and green, and blue and green pixels in different orders. For each\n+ * block of 2x2 pixels there is one pixel with a red filter, two with a green\n+ * filter, and one with a blue filter. The filters can be arranged in different\n+ * patterns.\n+ *\n+ * For example, RGGB:\n+ *\trow0: RGRGRGRG...\n+ *\trow1: GBGBGBGB...\n+ *\trow3: RGRGRGRG...\n+ *\trow4: GBGBGBGB...\n+ *\t...\n+ *\n+ * Vendors have different methods to pack the sampling formats to increase data\n+ * density. For this reason the fourcc only describes pixel sample size and the\n+ * filter pattern for each block of 2x2 pixels. A modifier is needed to\n+ * describe the memory layout.\n+ *\n+ * In addition to vendor modifiers for memory layout DRM_FORMAT_MOD_LINEAR may\n+ * be used to describe a layout where all samples are placed consecutively in\n+ * memory. If the sample does not fit inside a single byte, the sample storage\n+ * is extended to the minimum number of (little endian) bytes that can hold the\n+ * sample and any unused most-significant bits are defined as padding.\n+ *\n+ * For example, SRGGB10:\n+ * Each 10-bit sample is contained in 2 consecutive little endian bytes, where\n+ * the 6 most-significant bits are unused.\n+ */\n+\n+/* 8-bit Bayer formats */\n+#define DRM_FORMAT_SRGGB8\tfourcc_code('R', 'G', 'G', 'B')\n+#define DRM_FORMAT_SGRBG8\tfourcc_code('G', 'R', 'B', 'G')\n+#define DRM_FORMAT_SGBRG8\tfourcc_code('G', 'B', 'R', 'G')\n+#define DRM_FORMAT_SBGGR8\tfourcc_code('B', 'A', '8', '1')\n+\n+/* 10-bit Bayer formats */\n+#define DRM_FORMAT_SRGGB10\tfourcc_code('R', 'G', '1', '0')\n+#define DRM_FORMAT_SGRBG10\tfourcc_code('B', 'A', '1', '0')\n+#define DRM_FORMAT_SGBRG10\tfourcc_code('G', 'B', '1', '0')\n+#define DRM_FORMAT_SBGGR10\tfourcc_code('B', 'G', '1', '0')\n+\n+/* 12-bit Bayer formats */\n+#define DRM_FORMAT_SRGGB12\tfourcc_code('R', 'G', '1', '2')\n+#define DRM_FORMAT_SGRBG12\tfourcc_code('B', 'A', '1', '2')\n+#define DRM_FORMAT_SGBRG12\tfourcc_code('G', 'B', '1', '2')\n+#define DRM_FORMAT_SBGGR12\tfourcc_code('B', 'G', '1', '2')\n+\n+/* 14-bit Bayer formats */\n+#define DRM_FORMAT_SRGGB14\tfourcc_code('R', 'G', '1', '4')\n+#define DRM_FORMAT_SGRBG14\tfourcc_code('B', 'A', '1', '4')\n+#define DRM_FORMAT_SGBRG14\tfourcc_code('G', 'B', '1', '4')\n+#define DRM_FORMAT_SBGGR14\tfourcc_code('B', 'G', '1', '4')\n+\n /*\n * Format Modifiers:\n *\n@@ -311,6 +367,7 @@ extern \"C\" {\n #define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07\n #define DRM_FORMAT_MOD_VENDOR_ARM 0x08\n #define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09\n+#define DRM_FORMAT_MOD_VENDOR_MIPI 0x0a\n \n /* add more to the end as needed */\n \n@@ -412,6 +469,16 @@ extern \"C\" {\n #define I915_FORMAT_MOD_Y_TILED_CCS\tfourcc_mod_code(INTEL, 4)\n #define I915_FORMAT_MOD_Yf_TILED_CCS\tfourcc_mod_code(INTEL, 5)\n \n+/*\n+ * IPU3 Bayer packing layout\n+ *\n+ * The IPU3 raw Bayer formats use a custom packing layout where there are no\n+ * gaps between each 10-bit sample. It packs 25 pixels into 32 bytes leaving\n+ * the 6 most significant bits in the last byte unused. The format is little\n+ * endian.\n+ */\n+#define IPU3_FORMAT_MOD_PACKED fourcc_mod_code(INTEL, 8)\n+\n /*\n * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks\n *\n@@ -758,6 +825,33 @@ extern \"C\" {\n */\n #define DRM_FORMAT_MOD_ALLWINNER_TILED fourcc_mod_code(ALLWINNER, 1)\n \n+/* Mobile Industry Processor Interface (MIPI) modifiers */\n+\n+/*\n+ * MIPI CSI-2 packing layout\n+ *\n+ * The CSI-2 RAW formats (for example Bayer) use a different packing layout\n+ * depenindg on the sample size.\n+ *\n+ * - 10-bits per sample\n+ * Every four consecutive samples are packed into 5 bytes. Each of the first 4\n+ * bytes contain the 8 high order bits of the pixels, and the 5th byte\n+ * contains the 2 least-significant bits of each pixel, in the same order.\n+ *\n+ * - 12-bits per sample\n+ * Every two consecutive samples are packed into three bytes. Each of the\n+ * first two bytes contain the 8 high order bits of the pixels, and the third\n+ * byte contains the four least-significant bits of each pixel, in the same\n+ * order.\n+ *\n+ * - 14-bits per sample\n+ * Every four consecutive samples are packed into seven bytes. Each of the\n+ * first four bytes contain the eight high order bits of the pixels, and the\n+ * three following bytes contains the six least-significant bits of each\n+ * pixel, in the same order.\n+ */\n+#define MIPI_FORMAT_MOD_CSI2_PACKED fourcc_mod_code(MIPI, 1)\n+\n #if defined(__cplusplus)\n }\n #endif\n", "prefixes": [ "libcamera-devel", "v2", "3/7" ] }