[{"id":29468,"web_url":"https://patchwork.libcamera.org/comment/29468/","msgid":"<dvn4rgw4embkdt63xpoqgbiykm5xpknfz7cnn7hbvf7elsprrz@nxgt76sywxil>","date":"2024-05-09T09:46:49","subject":"Re: [PATCH v2 1/6] libcamera: formats: Add RGB48 formats","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Wed, May 08, 2024 at 09:03:56AM GMT, Naushir Patuck wrote:\n> Add support for 16-bps (48-bpp) RGB output formats. These new formats\n> are define for the RGB and BGR ordering.\n\ns/define/defined\n\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n>  include/linux/drm_fourcc.h         |  4 ++++\n>  include/linux/videodev2.h          |  2 ++\n>  src/libcamera/formats.cpp          | 20 ++++++++++++++++++++\n>  src/libcamera/formats.yaml         |  5 +++++\n>  src/libcamera/v4l2_pixelformat.cpp |  4 ++++\n>  5 files changed, 35 insertions(+)\n>\n> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> index d6c83d9c49f4..5133a6551a34 100644\n> --- a/include/linux/drm_fourcc.h\n> +++ b/include/linux/drm_fourcc.h\n> @@ -210,6 +210,10 @@ extern \"C\" {\n>  #define DRM_FORMAT_RGBA1010102\tfourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */\n>  #define DRM_FORMAT_BGRA1010102\tfourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */\n>\n> +/* 48 bpp RGB */\n> +#define DRM_FORMAT_RGB161616 fourcc_code('R', 'G', '4', '8') /* [47:0] R:G:B 16:16:16 little endian */\n> +#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [47:0] B:G:R 16:16:16 little endian */\n> +\n>  /* 64 bpp RGB */\n>  #define DRM_FORMAT_XRGB16161616\tfourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */\n>  #define DRM_FORMAT_XBGR16161616\tfourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */\n> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n> index 7e556911c9e1..4fdd91494041 100644\n> --- a/include/linux/videodev2.h\n> +++ b/include/linux/videodev2.h\n> @@ -555,6 +555,8 @@ struct v4l2_pix_format {\n>\n>  /* RGB formats (6 or 8 bytes per pixel) */\n>  #define V4L2_PIX_FMT_BGR48_12    v4l2_fourcc('B', '3', '1', '2') /* 48  BGR 12-bit per component */\n> +#define V4L2_PIX_FMT_BGR48       v4l2_fourcc('B', 'G', 'R', '6') /* 48  BGR 16-bit per component */\n> +#define V4L2_PIX_FMT_RGB48       v4l2_fourcc('R', 'G', 'B', '6') /* 48  RGB 16-bit per component */\n>  #define V4L2_PIX_FMT_ABGR64_12   v4l2_fourcc('B', '4', '1', '2') /* 64  BGRA 12-bit per component */\n>\n>  /* Grey formats */\n> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> index 955c3fba8b8d..21a7719e84c4 100644\n> --- a/src/libcamera/formats.cpp\n> +++ b/src/libcamera/formats.cpp\n> @@ -270,6 +270,26 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.pixelsPerGroup = 1,\n>  \t\t.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n>  \t} },\n> +\t{ formats::BGR161616, {\n> +\t\t.name = \"BGR161616\",\n> +\t\t.format = formats::BGR161616,\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RGB48), },\n> +\t\t.bitsPerPixel = 48,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> +\t\t.packed = false,\n> +\t\t.pixelsPerGroup = 1,\n> +\t\t.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},\n> +\t} },\n> +\t{ formats::RGB161616, {\n> +\t\t.name = \"RGB161616\",\n> +\t\t.format = formats::RGB161616,\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_BGR48), },\n> +\t\t.bitsPerPixel = 48,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> +\t\t.packed = false,\n> +\t\t.pixelsPerGroup = 1,\n> +\t\t.planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},\n> +\t} },\n>\n>  \t/* YUV packed formats. */\n>  \t{ formats::YUYV, {\n> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> index d8a379923b56..bde2cc803b98 100644\n> --- a/src/libcamera/formats.yaml\n> +++ b/src/libcamera/formats.yaml\n> @@ -43,6 +43,11 @@ formats:\n>    - BGRA8888:\n>        fourcc: DRM_FORMAT_BGRA8888\n>\n> +  - RGB161616:\n> +      fourcc: DRM_FORMAT_RGB161616\n> +  - BGR161616:\n> +      fourcc: DRM_FORMAT_BGR161616\n> +\n>    - YUYV:\n>        fourcc: DRM_FORMAT_YUYV\n>    - YVYU:\n> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\n> index 731dc10f1d73..efb6f2940235 100644\n> --- a/src/libcamera/v4l2_pixelformat.cpp\n> +++ b/src/libcamera/v4l2_pixelformat.cpp\n> @@ -71,6 +71,10 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{\n>  \t\t{ formats::BGRA8888, \"32-bit ARGB 8-8-8-8\" } },\n>  \t{ V4L2PixelFormat(V4L2_PIX_FMT_BGRA32),\n>  \t\t{ formats::RGBA8888, \"32-bit ABGR 8-8-8-8\" } },\n> +\t{ V4L2PixelFormat(V4L2_PIX_FMT_RGB48),\n> +\t\t{ formats::BGR161616, \"48-bit RGB 16-16-16\" } },\n> +\t{ V4L2PixelFormat(V4L2_PIX_FMT_BGR48),\n> +\t\t{ formats::RGB161616, \"48-bit BGR 16-16-16\" } },\n>\n>  \t/* YUV packed formats. */\n>  \t{ V4L2PixelFormat(V4L2_PIX_FMT_YUYV),\n> --\n> 2.34.1\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 6D997BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 May 2024 09:46:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 37BE963461;\n\tThu,  9 May 2024 11:46:54 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9A4DB633FA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 May 2024 11:46:52 +0200 (CEST)","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 19968524;\n\tThu,  9 May 2024 11:46:49 +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=\"wnptPrxR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1715248009;\n\tbh=eohs3AIJ7cHWoDpURsIe/BSQ7E88lrK7w+Qs9Fvc50Q=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=wnptPrxRaTeayj5IVxAlBF9ip1AVc6Q9/a2fjMtJYSiaSBB5r4qPf1xL/8NVVtxRs\n\tYIlW9crzDeBU3pFgJ0jPoN4oRDpWA6BchF3Agq7Vrmi0r5IZc4jAiCz1Uk7OWOqpNU\n\tJARuzrsk9yq9kdJcPuULf5vWubaXvCyXHTGKQaZI=","Date":"Thu, 9 May 2024 11:46:49 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 1/6] libcamera: formats: Add RGB48 formats","Message-ID":"<dvn4rgw4embkdt63xpoqgbiykm5xpknfz7cnn7hbvf7elsprrz@nxgt76sywxil>","References":"<20240508080401.14850-1-naush@raspberrypi.com>\n\t<20240508080401.14850-2-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240508080401.14850-2-naush@raspberrypi.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>"}},{"id":29482,"web_url":"https://patchwork.libcamera.org/comment/29482/","msgid":"<171525294987.1857112.6238848697251414950@ping.linuxembedded.co.uk>","date":"2024-05-09T11:09:09","subject":"Re: [PATCH v2 1/6] libcamera: formats: Add RGB48 formats","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck (2024-05-08 09:03:56)\n> Add support for 16-bps (48-bpp) RGB output formats. These new formats\n> are define for the RGB and BGR ordering.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  include/linux/drm_fourcc.h         |  4 ++++\n>  include/linux/videodev2.h          |  2 ++\n>  src/libcamera/formats.cpp          | 20 ++++++++++++++++++++\n>  src/libcamera/formats.yaml         |  5 +++++\n>  src/libcamera/v4l2_pixelformat.cpp |  4 ++++\n>  5 files changed, 35 insertions(+)\n> \n> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> index d6c83d9c49f4..5133a6551a34 100644\n> --- a/include/linux/drm_fourcc.h\n> +++ b/include/linux/drm_fourcc.h\n> @@ -210,6 +210,10 @@ extern \"C\" {\n>  #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */\n>  #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */\n>  \n> +/* 48 bpp RGB */\n> +#define DRM_FORMAT_RGB161616 fourcc_code('R', 'G', '4', '8') /* [47:0] R:G:B 16:16:16 little endian */\n> +#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [47:0] B:G:R 16:16:16 little endian */\n> +\n\nLooks like we're working out who can push the corresponding change for this upstream, so I think this is fine with me.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>  /* 64 bpp RGB */\n>  #define DRM_FORMAT_XRGB16161616        fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */\n>  #define DRM_FORMAT_XBGR16161616        fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */\n> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n> index 7e556911c9e1..4fdd91494041 100644\n> --- a/include/linux/videodev2.h\n> +++ b/include/linux/videodev2.h\n> @@ -555,6 +555,8 @@ struct v4l2_pix_format {\n>  \n>  /* RGB formats (6 or 8 bytes per pixel) */\n>  #define V4L2_PIX_FMT_BGR48_12    v4l2_fourcc('B', '3', '1', '2') /* 48  BGR 12-bit per component */\n> +#define V4L2_PIX_FMT_BGR48       v4l2_fourcc('B', 'G', 'R', '6') /* 48  BGR 16-bit per component */\n> +#define V4L2_PIX_FMT_RGB48       v4l2_fourcc('R', 'G', 'B', '6') /* 48  RGB 16-bit per component */\n>  #define V4L2_PIX_FMT_ABGR64_12   v4l2_fourcc('B', '4', '1', '2') /* 64  BGRA 12-bit per component */\n>  \n>  /* Grey formats */\n> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> index 955c3fba8b8d..21a7719e84c4 100644\n> --- a/src/libcamera/formats.cpp\n> +++ b/src/libcamera/formats.cpp\n> @@ -270,6 +270,26 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>                 .pixelsPerGroup = 1,\n>                 .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n>         } },\n> +       { formats::BGR161616, {\n> +               .name = \"BGR161616\",\n> +               .format = formats::BGR161616,\n> +               .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RGB48), },\n> +               .bitsPerPixel = 48,\n> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> +               .packed = false,\n> +               .pixelsPerGroup = 1,\n> +               .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},\n> +       } },\n> +       { formats::RGB161616, {\n> +               .name = \"RGB161616\",\n> +               .format = formats::RGB161616,\n> +               .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_BGR48), },\n> +               .bitsPerPixel = 48,\n> +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> +               .packed = false,\n> +               .pixelsPerGroup = 1,\n> +               .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},\n> +       } },\n>  \n>         /* YUV packed formats. */\n>         { formats::YUYV, {\n> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> index d8a379923b56..bde2cc803b98 100644\n> --- a/src/libcamera/formats.yaml\n> +++ b/src/libcamera/formats.yaml\n> @@ -43,6 +43,11 @@ formats:\n>    - BGRA8888:\n>        fourcc: DRM_FORMAT_BGRA8888\n>  \n> +  - RGB161616:\n> +      fourcc: DRM_FORMAT_RGB161616\n> +  - BGR161616:\n> +      fourcc: DRM_FORMAT_BGR161616\n> +\n>    - YUYV:\n>        fourcc: DRM_FORMAT_YUYV\n>    - YVYU:\n> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\n> index 731dc10f1d73..efb6f2940235 100644\n> --- a/src/libcamera/v4l2_pixelformat.cpp\n> +++ b/src/libcamera/v4l2_pixelformat.cpp\n> @@ -71,6 +71,10 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{\n>                 { formats::BGRA8888, \"32-bit ARGB 8-8-8-8\" } },\n>         { V4L2PixelFormat(V4L2_PIX_FMT_BGRA32),\n>                 { formats::RGBA8888, \"32-bit ABGR 8-8-8-8\" } },\n> +       { V4L2PixelFormat(V4L2_PIX_FMT_RGB48),\n> +               { formats::BGR161616, \"48-bit RGB 16-16-16\" } },\n> +       { V4L2PixelFormat(V4L2_PIX_FMT_BGR48),\n> +               { formats::RGB161616, \"48-bit BGR 16-16-16\" } },\n>  \n>         /* YUV packed formats. */\n>         { V4L2PixelFormat(V4L2_PIX_FMT_YUYV),\n> -- \n> 2.34.1\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 04464BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 May 2024 11:09:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8FB3663465;\n\tThu,  9 May 2024 13:09:13 +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 A3E2263433\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 May 2024 13:09:12 +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 31771904;\n\tThu,  9 May 2024 13:09:09 +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=\"URSy++sm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1715252949;\n\tbh=4QQgEF/QeLbWskDmuPJF/OcwJvQ1di/7TPGIEH28nMQ=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=URSy++sm6t2/pYxl3Vim7GlXEcplluRz5dQjfDBZqMcX0OSEUCCJD3XyjC4wS3rHh\n\tFG68fBviRh0WA1MzyeypcMOndaSEkGdbG25HWBFZS2g8mhZoDpaaYUtVocxyQ5KNCd\n\tiJpnOMB484X86NXGJIT5zO/hlA2cT2D8YyZtQQBk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240508080401.14850-2-naush@raspberrypi.com>","References":"<20240508080401.14850-1-naush@raspberrypi.com>\n\t<20240508080401.14850-2-naush@raspberrypi.com>","Subject":"Re: [PATCH v2 1/6] libcamera: formats: Add RGB48 formats","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Naushir Patuck <naush@raspberrypi.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 09 May 2024 12:09:09 +0100","Message-ID":"<171525294987.1857112.6238848697251414950@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":29488,"web_url":"https://patchwork.libcamera.org/comment/29488/","msgid":"<20240509111824.GG14520@pendragon.ideasonboard.com>","date":"2024-05-09T11:18:24","subject":"Re: [PATCH v2 1/6] libcamera: formats: Add RGB48 formats","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, May 09, 2024 at 12:09:09PM +0100, Kieran Bingham wrote:\n> Quoting Naushir Patuck (2024-05-08 09:03:56)\n> > Add support for 16-bps (48-bpp) RGB output formats. These new formats\n> > are define for the RGB and BGR ordering.\n> > \n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  include/linux/drm_fourcc.h         |  4 ++++\n> >  include/linux/videodev2.h          |  2 ++\n> >  src/libcamera/formats.cpp          | 20 ++++++++++++++++++++\n> >  src/libcamera/formats.yaml         |  5 +++++\n> >  src/libcamera/v4l2_pixelformat.cpp |  4 ++++\n> >  5 files changed, 35 insertions(+)\n> > \n> > diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> > index d6c83d9c49f4..5133a6551a34 100644\n> > --- a/include/linux/drm_fourcc.h\n> > +++ b/include/linux/drm_fourcc.h\n> > @@ -210,6 +210,10 @@ extern \"C\" {\n> >  #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */\n> >  #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */\n> >  \n> > +/* 48 bpp RGB */\n> > +#define DRM_FORMAT_RGB161616 fourcc_code('R', 'G', '4', '8') /* [47:0] R:G:B 16:16:16 little endian */\n> > +#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [47:0] B:G:R 16:16:16 little endian */\n> > +\n> \n> Looks like we're working out who can push the corresponding change for\n> this upstream, so I think this is fine with me.\n\nLikewise, but I'd like to split the changes to include/linux/ to a\nseparate patch.\n\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> >  /* 64 bpp RGB */\n> >  #define DRM_FORMAT_XRGB16161616        fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */\n> >  #define DRM_FORMAT_XBGR16161616        fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */\n> > diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n> > index 7e556911c9e1..4fdd91494041 100644\n> > --- a/include/linux/videodev2.h\n> > +++ b/include/linux/videodev2.h\n> > @@ -555,6 +555,8 @@ struct v4l2_pix_format {\n> >  \n> >  /* RGB formats (6 or 8 bytes per pixel) */\n> >  #define V4L2_PIX_FMT_BGR48_12    v4l2_fourcc('B', '3', '1', '2') /* 48  BGR 12-bit per component */\n> > +#define V4L2_PIX_FMT_BGR48       v4l2_fourcc('B', 'G', 'R', '6') /* 48  BGR 16-bit per component */\n> > +#define V4L2_PIX_FMT_RGB48       v4l2_fourcc('R', 'G', 'B', '6') /* 48  RGB 16-bit per component */\n> >  #define V4L2_PIX_FMT_ABGR64_12   v4l2_fourcc('B', '4', '1', '2') /* 64  BGRA 12-bit per component */\n> >  \n> >  /* Grey formats */\n> > diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> > index 955c3fba8b8d..21a7719e84c4 100644\n> > --- a/src/libcamera/formats.cpp\n> > +++ b/src/libcamera/formats.cpp\n> > @@ -270,6 +270,26 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n> >                 .pixelsPerGroup = 1,\n> >                 .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n> >         } },\n> > +       { formats::BGR161616, {\n> > +               .name = \"BGR161616\",\n> > +               .format = formats::BGR161616,\n> > +               .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RGB48), },\n> > +               .bitsPerPixel = 48,\n> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> > +               .packed = false,\n> > +               .pixelsPerGroup = 1,\n> > +               .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},\n> > +       } },\n> > +       { formats::RGB161616, {\n> > +               .name = \"RGB161616\",\n> > +               .format = formats::RGB161616,\n> > +               .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_BGR48), },\n> > +               .bitsPerPixel = 48,\n> > +               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n> > +               .packed = false,\n> > +               .pixelsPerGroup = 1,\n> > +               .planes = {{ { 3, 1 }, { 0, 0 }, { 0, 0 } }},\n> > +       } },\n> >  \n> >         /* YUV packed formats. */\n> >         { formats::YUYV, {\n> > diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> > index d8a379923b56..bde2cc803b98 100644\n> > --- a/src/libcamera/formats.yaml\n> > +++ b/src/libcamera/formats.yaml\n> > @@ -43,6 +43,11 @@ formats:\n> >    - BGRA8888:\n> >        fourcc: DRM_FORMAT_BGRA8888\n> >  \n> > +  - RGB161616:\n> > +      fourcc: DRM_FORMAT_RGB161616\n> > +  - BGR161616:\n> > +      fourcc: DRM_FORMAT_BGR161616\n> > +\n> >    - YUYV:\n> >        fourcc: DRM_FORMAT_YUYV\n> >    - YVYU:\n> > diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\n> > index 731dc10f1d73..efb6f2940235 100644\n> > --- a/src/libcamera/v4l2_pixelformat.cpp\n> > +++ b/src/libcamera/v4l2_pixelformat.cpp\n> > @@ -71,6 +71,10 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{\n> >                 { formats::BGRA8888, \"32-bit ARGB 8-8-8-8\" } },\n> >         { V4L2PixelFormat(V4L2_PIX_FMT_BGRA32),\n> >                 { formats::RGBA8888, \"32-bit ABGR 8-8-8-8\" } },\n> > +       { V4L2PixelFormat(V4L2_PIX_FMT_RGB48),\n> > +               { formats::BGR161616, \"48-bit RGB 16-16-16\" } },\n> > +       { V4L2PixelFormat(V4L2_PIX_FMT_BGR48),\n> > +               { formats::RGB161616, \"48-bit BGR 16-16-16\" } },\n> >  \n> >         /* YUV packed formats. */\n> >         { V4L2PixelFormat(V4L2_PIX_FMT_YUYV),","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 1FBBEBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 May 2024 11:18:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7BB336345F;\n\tThu,  9 May 2024 13:18:35 +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 13FED633FA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 May 2024 13:18:34 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4942C904;\n\tThu,  9 May 2024 13:18:30 +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=\"Vu8cPzsJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1715253510;\n\tbh=Mu9bDa3li1glPDoUby4vhQeGZ9uOBlAIDLUsRnhoTmw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Vu8cPzsJxXOUNCgsJSm4bdXiQhfehlEYPtQmY14AheBNa8vsh1l15hon7ct0UWlrQ\n\tWZ6Dn+VvsnsHEo93FKITZUmUMkxuHKbIT08CZZORIc6Q5EuE8+XnwpCPOfSiscA2r2\n\tIzpVHhcFXTbwqd+8XT+wzYmMgc+D2Qo2rxD4DUn4=","Date":"Thu, 9 May 2024 14:18:24 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 1/6] libcamera: formats: Add RGB48 formats","Message-ID":"<20240509111824.GG14520@pendragon.ideasonboard.com>","References":"<20240508080401.14850-1-naush@raspberrypi.com>\n\t<20240508080401.14850-2-naush@raspberrypi.com>\n\t<171525294987.1857112.6238848697251414950@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<171525294987.1857112.6238848697251414950@ping.linuxembedded.co.uk>","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>"}}]