[{"id":35077,"web_url":"https://patchwork.libcamera.org/comment/35077/","msgid":"<175334350806.560048.14058924065330706755@ping.linuxembedded.co.uk>","date":"2025-07-24T07:51:48","subject":"Re: [PATCH 02/10] include: linux: Add RAWnn to drm_fourcc.h","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Daniel Scally (2025-07-24 07:52:48)\n> Add entries to drm_fourcc.h for bayer order agnostic RAW formats at\n> 10, 12, 14 and 20 bits. Add a modifier for the CRU format packing.\n> These will need to be applied upstream, at which stage the script\n> can maintain their presence here.\n> \n\nIs there any upstream reference yet? Or are these not posted yet ?\n\n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> ---\n>  include/linux/drm_fourcc.h | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n> \n> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> index db679877..7257f623 100644\n> --- a/include/linux/drm_fourcc.h\n> +++ b/include/linux/drm_fourcc.h\n> @@ -447,18 +447,21 @@ extern \"C\" {\n>  #define DRM_FORMAT_SGRBG10     fourcc_code('B', 'A', '1', '0')\n>  #define DRM_FORMAT_SGBRG10     fourcc_code('G', 'B', '1', '0')\n>  #define DRM_FORMAT_SBGGR10     fourcc_code('B', 'G', '1', '0')\n> +#define DRM_FORMAT_RAW10       fourcc_code('R', 'W', '1', '0')\n>  \n>  /* 12-bit Bayer formats */\n>  #define DRM_FORMAT_SRGGB12     fourcc_code('R', 'G', '1', '2')\n>  #define DRM_FORMAT_SGRBG12     fourcc_code('B', 'A', '1', '2')\n>  #define DRM_FORMAT_SGBRG12     fourcc_code('G', 'B', '1', '2')\n>  #define DRM_FORMAT_SBGGR12     fourcc_code('B', 'G', '1', '2')\n> +#define DRM_FORMAT_RAW12       fourcc_code('R', 'W', '1', '2')\n>  \n>  /* 14-bit Bayer formats */\n>  #define DRM_FORMAT_SRGGB14     fourcc_code('R', 'G', '1', '4')\n>  #define DRM_FORMAT_SGRBG14     fourcc_code('B', 'A', '1', '4')\n>  #define DRM_FORMAT_SGBRG14     fourcc_code('G', 'B', '1', '4')\n>  #define DRM_FORMAT_SBGGR14     fourcc_code('B', 'G', '1', '4')\n> +#define DRM_FORMAT_RAW14       fourcc_code('R', 'W', '1', '4')\n>  \n>  /* 16-bit Bayer formats */\n>  #define DRM_FORMAT_SRGGB16     fourcc_code('R', 'G', 'B', '6')\n> @@ -466,6 +469,9 @@ extern \"C\" {\n>  #define DRM_FORMAT_SGBRG16     fourcc_code('G', 'B', '1', '6')\n>  #define DRM_FORMAT_SBGGR16     fourcc_code('B', 'Y', 'R', '2')\n>  \n> +/* 20-bit Bayer formats */\n> +#define DRM_FORMAT_RAW20       fourcc_code('R', 'W', '2', '0')\n> +\n>  /*\n>   * Format Modifiers:\n>   *\n> @@ -491,6 +497,7 @@ extern \"C\" {\n>  #define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a\n>  #define DRM_FORMAT_MOD_VENDOR_MIPI 0x0b\n>  #define DRM_FORMAT_MOD_VENDOR_RPI 0x0c\n> +#define DRM_FORMAT_MOD_VENDOR_RENESAS 0x0d\n>  \n>  /* add more to the end as needed */\n>  \n> @@ -1692,6 +1699,8 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>  #define PISP_FORMAT_MOD_COMPRESS_MODE1 fourcc_mod_code(RPI, 1)\n>  #define PISP_FORMAT_MOD_COMPRESS_MODE2 fourcc_mod_code(RPI, 2)\n>  \n> +#define RENESAS_CRU_FORMAT_MOD_PACKED fourcc_mod_code(RENESAS, 1)\n> +\n>  #if defined(__cplusplus)\n>  }\n>  #endif\n> -- \n> 2.30.2\n>","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 7EEAEBDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Jul 2025 07:51:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2054D690A9;\n\tThu, 24 Jul 2025 09:51:52 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B18BA69098\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jul 2025 09:51:50 +0200 (CEST)","from pendragon.ideasonboard.com\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 D0C8BC79;\n\tThu, 24 Jul 2025 09:51:11 +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=\"tVDP1kNJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753343471;\n\tbh=cYGSx/c1opA4sXyiqTXxyiGxVa1K7NBM6oITC6pq+ZY=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=tVDP1kNJgCyIaW4+N99j8YHPYnVTLIzaO4uR/sUs6hInaG0xF51jRYP7pS7t+w1vg\n\tWEMM1y7ppBvNZGvCw2NCuU3AqTzk0arkMGn4cByHf1MxDhBUBzABM5wxVE9bI1B+L4\n\tcwBejmWUWqWfp8djTAm4+oKjBiBiiynG2WeoYKwk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250724065256.75175-3-dan.scally@ideasonboard.com>","References":"<20250724065256.75175-1-dan.scally@ideasonboard.com>\n\t<20250724065256.75175-3-dan.scally@ideasonboard.com>","Subject":"Re: [PATCH 02/10] include: linux: Add RAWnn to drm_fourcc.h","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Daniel Scally <dan.scally@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 24 Jul 2025 08:51:48 +0100","Message-ID":"<175334350806.560048.14058924065330706755@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}},{"id":36549,"web_url":"https://patchwork.libcamera.org/comment/36549/","msgid":"<6ka52rezss74hv2sibyh6d4rxczkqtmprqfpieisj42nqcohjq@6iqe22cvmjkb>","date":"2025-10-30T11:31:37","subject":"Re: [PATCH 02/10] include: linux: Add RAWnn to drm_fourcc.h","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Dan\n\nOn Thu, Jul 24, 2025 at 07:52:48AM +0100, Daniel Scally wrote:\n> Add entries to drm_fourcc.h for bayer order agnostic RAW formats at\n> 10, 12, 14 and 20 bits. Add a modifier for the CRU format packing.\n> These will need to be applied upstream, at which stage the script\n> can maintain their presence here.\n\nThis does depend on Sakari's series that introduces generic RAW\nformats in Linux.\n\nDo you need any of these to support CRU in the mali pipeline ?\n\n>\n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> ---\n>  include/linux/drm_fourcc.h | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n>\n> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> index db679877..7257f623 100644\n> --- a/include/linux/drm_fourcc.h\n> +++ b/include/linux/drm_fourcc.h\n> @@ -447,18 +447,21 @@ extern \"C\" {\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> +#define DRM_FORMAT_RAW10\tfourcc_code('R', 'W', '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> +#define DRM_FORMAT_RAW12\tfourcc_code('R', 'W', '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> +#define DRM_FORMAT_RAW14\tfourcc_code('R', 'W', '1', '4')\n>\n>  /* 16-bit Bayer formats */\n>  #define DRM_FORMAT_SRGGB16\tfourcc_code('R', 'G', 'B', '6')\n> @@ -466,6 +469,9 @@ extern \"C\" {\n>  #define DRM_FORMAT_SGBRG16\tfourcc_code('G', 'B', '1', '6')\n>  #define DRM_FORMAT_SBGGR16\tfourcc_code('B', 'Y', 'R', '2')\n>\n> +/* 20-bit Bayer formats */\n> +#define DRM_FORMAT_RAW20\tfourcc_code('R', 'W', '2', '0')\n> +\n>  /*\n>   * Format Modifiers:\n>   *\n> @@ -491,6 +497,7 @@ extern \"C\" {\n>  #define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a\n>  #define DRM_FORMAT_MOD_VENDOR_MIPI 0x0b\n>  #define DRM_FORMAT_MOD_VENDOR_RPI 0x0c\n> +#define DRM_FORMAT_MOD_VENDOR_RENESAS 0x0d\n>\n>  /* add more to the end as needed */\n>\n> @@ -1692,6 +1699,8 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>  #define PISP_FORMAT_MOD_COMPRESS_MODE1 fourcc_mod_code(RPI, 1)\n>  #define PISP_FORMAT_MOD_COMPRESS_MODE2 fourcc_mod_code(RPI, 2)\n>\n> +#define RENESAS_CRU_FORMAT_MOD_PACKED fourcc_mod_code(RENESAS, 1)\n> +\n>  #if defined(__cplusplus)\n>  }\n>  #endif\n> --\n> 2.30.2\n>","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 1F053BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 30 Oct 2025 11:31:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 223FC60896;\n\tThu, 30 Oct 2025 12:31:44 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 76FA6603ED\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Oct 2025 12:31:42 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F063716A8;\n\tThu, 30 Oct 2025 12:29:50 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"b8ZvyeeP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761823791;\n\tbh=P9bZijJ89UwE/TV75aFOUm4U4cX4D+ZNAohkqnFrMGM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=b8ZvyeeP+8nI7oCWoMLRi2OjuM4+uo7CbB7EPwEr4GoA6UBErKzMn6dQkedwmnHBA\n\tpfJPgKHiQ9KrYCvvQz6pe+mnz9MpzHTcGAwhW/XR1x6eqnPZhkPqDBXCaitSDZFT/B\n\tB5uHaPT+a/13eWm0ShcS2NQQUw6upleMcGu4bXNw=","Date":"Thu, 30 Oct 2025 12:31:37 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 02/10] include: linux: Add RAWnn to drm_fourcc.h","Message-ID":"<6ka52rezss74hv2sibyh6d4rxczkqtmprqfpieisj42nqcohjq@6iqe22cvmjkb>","References":"<20250724065256.75175-1-dan.scally@ideasonboard.com>\n\t<20250724065256.75175-3-dan.scally@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20250724065256.75175-3-dan.scally@ideasonboard.com>","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>"}}]