[{"id":28604,"web_url":"https://patchwork.libcamera.org/comment/28604/","msgid":"<20240123144900.GH10679@pendragon.ideasonboard.com>","date":"2024-01-23T14:49:00","subject":"Re: [PATCH v2 4/4] libcamera: v4l2subdev: Organise the formatInfoMap","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Jan 23, 2024 at 02:35:35PM +0000, Kieran Bingham wrote:\n> The formatInfoMap is large, cluttered and not sorted.\n\nIt's sorted in the same order as the formats in media-bus-format.h. We\ncan depart from that given a good reason.\n\n> Organise the table into groups, and move the mono formats to their own\n> grouping, as they are currently added in arbitrary points in the table.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n> v2: new patch\n> \n>  src/libcamera/v4l2_subdevice.cpp | 14 +++++++++++---\n>  1 file changed, 11 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index 265240dbd405..d5605c7c8ac5 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -57,6 +57,7 @@ struct V4L2SubdeviceFormatInfo {\n>   * bus codes\n>   */\n>  const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> +\t/* RGB */\n>  \t{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { 16, \"RGB444_2X8_PADHI_BE\", PixelFormatInfo::ColourEncodingRGB } },\n>  \t{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { 16, \"RGB444_2X8_PADHI_LE\", PixelFormatInfo::ColourEncodingRGB } },\n>  \t{ MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, { 16, \"RGB555_2X8_PADHI_BE\", PixelFormatInfo::ColourEncodingRGB } },\n> @@ -72,7 +73,14 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n>  \t{ MEDIA_BUS_FMT_RGB888_2X12_BE, { 24, \"RGB888_2X12_BE\", PixelFormatInfo::ColourEncodingRGB } },\n>  \t{ MEDIA_BUS_FMT_RGB888_2X12_LE, { 24, \"RGB888_2X12_LE\", PixelFormatInfo::ColourEncodingRGB } },\n>  \t{ MEDIA_BUS_FMT_ARGB8888_1X32, { 32, \"ARGB8888_1X32\", PixelFormatInfo::ColourEncodingRGB } },\n> +\n> +\t/* Mono */\n>  \t{ MEDIA_BUS_FMT_Y8_1X8, { 8, \"Y8_1X8\", PixelFormatInfo::ColourEncodingYUV } },\n> +\t{ MEDIA_BUS_FMT_Y10_1X10, { 10, \"Y10_1X10\", PixelFormatInfo::ColourEncodingYUV } },\n> +\t{ MEDIA_BUS_FMT_Y12_1X12, { 12, \"Y12_1X12\", PixelFormatInfo::ColourEncodingYUV } },\n> +\t{ MEDIA_BUS_FMT_Y16_1X16, { 16, \"Y16_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> +\n> +\t/* YUV */\n>  \t{ MEDIA_BUS_FMT_UV8_1X8, { 8, \"UV8_1X8\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_UYVY8_1_5X8, { 12, \"UYVY8_1_5X8\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_VYUY8_1_5X8, { 12, \"VYUY8_1_5X8\", PixelFormatInfo::ColourEncodingYUV } },\n> @@ -82,13 +90,10 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n>  \t{ MEDIA_BUS_FMT_VYUY8_2X8, { 16, \"VYUY8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_YUYV8_2X8, { 16, \"YUYV8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_YVYU8_2X8, { 16, \"YVYU8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n> -\t{ MEDIA_BUS_FMT_Y10_1X10, { 10, \"Y10_1X10\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_UYVY10_2X10, { 20, \"UYVY10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_VYUY10_2X10, { 20, \"VYUY10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_YUYV10_2X10, { 20, \"YUYV10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_YVYU10_2X10, { 20, \"YVYU10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> -\t{ MEDIA_BUS_FMT_Y12_1X12, { 12, \"Y12_1X12\", PixelFormatInfo::ColourEncodingYUV } },\n> -\t{ MEDIA_BUS_FMT_Y16_1X16, { 16, \"Y16_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_UYVY8_1X16, { 16, \"UYVY8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_VYUY8_1X16, { 16, \"VYUY8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_YUYV8_1X16, { 16, \"YUYV8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> @@ -109,6 +114,8 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n>  \t{ MEDIA_BUS_FMT_VYUY12_1X24, { 24, \"VYUY12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_YUYV12_1X24, { 24, \"YUYV12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n>  \t{ MEDIA_BUS_FMT_YVYU12_1X24, { 24, \"YVYU12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n> +\n> +\t/* Raw Bayer */\n>  \t{ MEDIA_BUS_FMT_SBGGR8_1X8, { 8, \"SBGGR8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n>  \t{ MEDIA_BUS_FMT_SGBRG8_1X8, { 8, \"SGBRG8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n>  \t{ MEDIA_BUS_FMT_SGRBG8_1X8, { 8, \"SGRBG8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n> @@ -133,6 +140,7 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n>  \t{ MEDIA_BUS_FMT_SGBRG12_1X12, { 12, \"SGBRG12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n>  \t{ MEDIA_BUS_FMT_SGRBG12_1X12, { 12, \"SGRBG12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n>  \t{ MEDIA_BUS_FMT_SRGGB12_1X12, { 12, \"SRGGB12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n> +\n>  \t/* \\todo Clarify colour encoding for HSV formats */\n>  \t{ MEDIA_BUS_FMT_AHSV8888_1X32, { 32, \"AHSV8888_1X32\", PixelFormatInfo::ColourEncodingRGB } },\n>  \t{ MEDIA_BUS_FMT_JPEG_1X8, { 8, \"JPEG_1X8\", PixelFormatInfo::ColourEncodingYUV } },","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 CB76BC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Jan 2024 14:49:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 45CE762946;\n\tTue, 23 Jan 2024 15:49:04 +0100 (CET)","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 CA49E628E9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Jan 2024 15:49:02 +0100 (CET)","from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0DC841890;\n\tTue, 23 Jan 2024 15:47:48 +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=\"H6Mi1Dfr\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1706021269;\n\tbh=7md/vgM5dhZ4A66zkz73qu6MUr2snXN/pdeMYJdz+D0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=H6Mi1DfrcZI/txC6ugwpu5AshKtZP68wZHWgQkOVbmB7Q0Bu6InYp0Svs53jJhaQ2\n\tgCeXuNjTCiYL8a3nvHFHnjAdpBlwD0iqXPtfNd2kPgAgeXgwLAbo9MDIcfCuGqFNSl\n\t0+QYusUZvAWgAjnufnRX/BXYB4A7VQy/QworqJ8U=","Date":"Tue, 23 Jan 2024 16:49:00 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v2 4/4] libcamera: v4l2subdev: Organise the formatInfoMap","Message-ID":"<20240123144900.GH10679@pendragon.ideasonboard.com>","References":"<20240123143535.52255-1-kieran.bingham@ideasonboard.com>\n\t<20240123143535.52255-5-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240123143535.52255-5-kieran.bingham@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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28607,"web_url":"https://patchwork.libcamera.org/comment/28607/","msgid":"<170602203779.3044059.5282564173327602779@ping.linuxembedded.co.uk>","date":"2024-01-23T15:00:37","subject":"Re: [PATCH v2 4/4] libcamera: v4l2subdev: Organise the formatInfoMap","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-01-23 14:49:00)\n> On Tue, Jan 23, 2024 at 02:35:35PM +0000, Kieran Bingham wrote:\n> > The formatInfoMap is large, cluttered and not sorted.\n> \n> It's sorted in the same order as the formats in media-bus-format.h. We\n> can depart from that given a good reason.\n\nAha, that wasn't clear.\n\nI can either drop this patch or replace it with a comment stating to\nmatch the sort order in media-bus-format.h if you prefer?\n\nPersonally I like the groups so that the mono/greyscale formats are\nclearer ... but I don't really care either way.\n\n--\nKieran\n\n\n> \n> > Organise the table into groups, and move the mono formats to their own\n> > grouping, as they are currently added in arbitrary points in the table.\n> > \n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> > v2: new patch\n> > \n> >  src/libcamera/v4l2_subdevice.cpp | 14 +++++++++++---\n> >  1 file changed, 11 insertions(+), 3 deletions(-)\n> > \n> > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> > index 265240dbd405..d5605c7c8ac5 100644\n> > --- a/src/libcamera/v4l2_subdevice.cpp\n> > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > @@ -57,6 +57,7 @@ struct V4L2SubdeviceFormatInfo {\n> >   * bus codes\n> >   */\n> >  const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > +     /* RGB */\n> >       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { 16, \"RGB444_2X8_PADHI_BE\", PixelFormatInfo::ColourEncodingRGB } },\n> >       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { 16, \"RGB444_2X8_PADHI_LE\", PixelFormatInfo::ColourEncodingRGB } },\n> >       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, { 16, \"RGB555_2X8_PADHI_BE\", PixelFormatInfo::ColourEncodingRGB } },\n> > @@ -72,7 +73,14 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> >       { MEDIA_BUS_FMT_RGB888_2X12_BE, { 24, \"RGB888_2X12_BE\", PixelFormatInfo::ColourEncodingRGB } },\n> >       { MEDIA_BUS_FMT_RGB888_2X12_LE, { 24, \"RGB888_2X12_LE\", PixelFormatInfo::ColourEncodingRGB } },\n> >       { MEDIA_BUS_FMT_ARGB8888_1X32, { 32, \"ARGB8888_1X32\", PixelFormatInfo::ColourEncodingRGB } },\n> > +\n> > +     /* Mono */\n> >       { MEDIA_BUS_FMT_Y8_1X8, { 8, \"Y8_1X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > +     { MEDIA_BUS_FMT_Y10_1X10, { 10, \"Y10_1X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > +     { MEDIA_BUS_FMT_Y12_1X12, { 12, \"Y12_1X12\", PixelFormatInfo::ColourEncodingYUV } },\n> > +     { MEDIA_BUS_FMT_Y16_1X16, { 16, \"Y16_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > +\n> > +     /* YUV */\n> >       { MEDIA_BUS_FMT_UV8_1X8, { 8, \"UV8_1X8\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_UYVY8_1_5X8, { 12, \"UYVY8_1_5X8\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_VYUY8_1_5X8, { 12, \"VYUY8_1_5X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > @@ -82,13 +90,10 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> >       { MEDIA_BUS_FMT_VYUY8_2X8, { 16, \"VYUY8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_YUYV8_2X8, { 16, \"YUYV8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_YVYU8_2X8, { 16, \"YVYU8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > -     { MEDIA_BUS_FMT_Y10_1X10, { 10, \"Y10_1X10\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_UYVY10_2X10, { 20, \"UYVY10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_VYUY10_2X10, { 20, \"VYUY10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_YUYV10_2X10, { 20, \"YUYV10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_YVYU10_2X10, { 20, \"YVYU10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > -     { MEDIA_BUS_FMT_Y12_1X12, { 12, \"Y12_1X12\", PixelFormatInfo::ColourEncodingYUV } },\n> > -     { MEDIA_BUS_FMT_Y16_1X16, { 16, \"Y16_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_UYVY8_1X16, { 16, \"UYVY8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_VYUY8_1X16, { 16, \"VYUY8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_YUYV8_1X16, { 16, \"YUYV8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > @@ -109,6 +114,8 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> >       { MEDIA_BUS_FMT_VYUY12_1X24, { 24, \"VYUY12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_YUYV12_1X24, { 24, \"YUYV12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n> >       { MEDIA_BUS_FMT_YVYU12_1X24, { 24, \"YVYU12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n> > +\n> > +     /* Raw Bayer */\n> >       { MEDIA_BUS_FMT_SBGGR8_1X8, { 8, \"SBGGR8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n> >       { MEDIA_BUS_FMT_SGBRG8_1X8, { 8, \"SGBRG8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n> >       { MEDIA_BUS_FMT_SGRBG8_1X8, { 8, \"SGRBG8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n> > @@ -133,6 +140,7 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> >       { MEDIA_BUS_FMT_SGBRG12_1X12, { 12, \"SGBRG12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n> >       { MEDIA_BUS_FMT_SGRBG12_1X12, { 12, \"SGRBG12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n> >       { MEDIA_BUS_FMT_SRGGB12_1X12, { 12, \"SRGGB12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n> > +\n> >       /* \\todo Clarify colour encoding for HSV formats */\n> >       { MEDIA_BUS_FMT_AHSV8888_1X32, { 32, \"AHSV8888_1X32\", PixelFormatInfo::ColourEncodingRGB } },\n> >       { MEDIA_BUS_FMT_JPEG_1X8, { 8, \"JPEG_1X8\", PixelFormatInfo::ColourEncodingYUV } },\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 479BBBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Jan 2024 15:00:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8F98B62916;\n\tTue, 23 Jan 2024 16:00:41 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3714A628E9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Jan 2024 16:00:40 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6BD891890;\n\tTue, 23 Jan 2024 15:59:26 +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=\"NUG+a9ga\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1706021966;\n\tbh=0s8kSP4yxuSl/wx7udBmkgqKvgNVPh+AJOJFDFeadRc=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=NUG+a9gaXg5D4+nrsU7Rf5mGFlakUILI37C/gxiWPkeN1Yg3U4vxhb6mfDHT7C0/e\n\tWgZ2GRm2xLi6FwObX8Grx6fDiJYjz9m+sT0PcMXl0EHr8vBjkeTlj6Cjix1RJvxBAE\n\t6iP40ida/AS2KTdl46MmgdZsi4sdqmcH9LPWRIcU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240123144900.GH10679@pendragon.ideasonboard.com>","References":"<20240123143535.52255-1-kieran.bingham@ideasonboard.com>\n\t<20240123143535.52255-5-kieran.bingham@ideasonboard.com>\n\t<20240123144900.GH10679@pendragon.ideasonboard.com>","Subject":"Re: [PATCH v2 4/4] libcamera: v4l2subdev: Organise the formatInfoMap","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Tue, 23 Jan 2024 15:00:37 +0000","Message-ID":"<170602203779.3044059.5282564173327602779@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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28608,"web_url":"https://patchwork.libcamera.org/comment/28608/","msgid":"<20240123150655.GK10679@pendragon.ideasonboard.com>","date":"2024-01-23T15:06:55","subject":"Re: [PATCH v2 4/4] libcamera: v4l2subdev: Organise the formatInfoMap","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Jan 23, 2024 at 03:00:37PM +0000, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2024-01-23 14:49:00)\n> > On Tue, Jan 23, 2024 at 02:35:35PM +0000, Kieran Bingham wrote:\n> > > The formatInfoMap is large, cluttered and not sorted.\n> > \n> > It's sorted in the same order as the formats in media-bus-format.h. We\n> > can depart from that given a good reason.\n> \n> Aha, that wasn't clear.\n> \n> I can either drop this patch or replace it with a comment stating to\n> match the sort order in media-bus-format.h if you prefer?\n> \n> Personally I like the groups so that the mono/greyscale formats are\n> clearer ... but I don't really care either way.\n\nA comment would be good indeed if we keep the current order. I think I\nhave a slight preference for that, as it should make it easier to\ncompile this map and the media-bus-format.h header to find missing\nformats, but I'm OK if you prefer changing the order. I think ordering\nbus formats is difficult as the names are a bit cryptic sometimes,\nneither alphabetical nor numerical ordering makes real sense, and then\nwe get into endless bikeshedding to find a good order :-) The one in the\nkernel header file may or may not be good, but it has the advantage of\nfreeing us from thinking about the issue.\n\n> > > Organise the table into groups, and move the mono formats to their own\n> > > grouping, as they are currently added in arbitrary points in the table.\n> > > \n> > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > ---\n> > > v2: new patch\n> > > \n> > >  src/libcamera/v4l2_subdevice.cpp | 14 +++++++++++---\n> > >  1 file changed, 11 insertions(+), 3 deletions(-)\n> > > \n> > > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> > > index 265240dbd405..d5605c7c8ac5 100644\n> > > --- a/src/libcamera/v4l2_subdevice.cpp\n> > > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > > @@ -57,6 +57,7 @@ struct V4L2SubdeviceFormatInfo {\n> > >   * bus codes\n> > >   */\n> > >  const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > > +     /* RGB */\n> > >       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { 16, \"RGB444_2X8_PADHI_BE\", PixelFormatInfo::ColourEncodingRGB } },\n> > >       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { 16, \"RGB444_2X8_PADHI_LE\", PixelFormatInfo::ColourEncodingRGB } },\n> > >       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, { 16, \"RGB555_2X8_PADHI_BE\", PixelFormatInfo::ColourEncodingRGB } },\n> > > @@ -72,7 +73,14 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > >       { MEDIA_BUS_FMT_RGB888_2X12_BE, { 24, \"RGB888_2X12_BE\", PixelFormatInfo::ColourEncodingRGB } },\n> > >       { MEDIA_BUS_FMT_RGB888_2X12_LE, { 24, \"RGB888_2X12_LE\", PixelFormatInfo::ColourEncodingRGB } },\n> > >       { MEDIA_BUS_FMT_ARGB8888_1X32, { 32, \"ARGB8888_1X32\", PixelFormatInfo::ColourEncodingRGB } },\n> > > +\n> > > +     /* Mono */\n> > >       { MEDIA_BUS_FMT_Y8_1X8, { 8, \"Y8_1X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > > +     { MEDIA_BUS_FMT_Y10_1X10, { 10, \"Y10_1X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > > +     { MEDIA_BUS_FMT_Y12_1X12, { 12, \"Y12_1X12\", PixelFormatInfo::ColourEncodingYUV } },\n> > > +     { MEDIA_BUS_FMT_Y16_1X16, { 16, \"Y16_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > > +\n> > > +     /* YUV */\n> > >       { MEDIA_BUS_FMT_UV8_1X8, { 8, \"UV8_1X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_UYVY8_1_5X8, { 12, \"UYVY8_1_5X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_VYUY8_1_5X8, { 12, \"VYUY8_1_5X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > > @@ -82,13 +90,10 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > >       { MEDIA_BUS_FMT_VYUY8_2X8, { 16, \"VYUY8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_YUYV8_2X8, { 16, \"YUYV8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_YVYU8_2X8, { 16, \"YVYU8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > > -     { MEDIA_BUS_FMT_Y10_1X10, { 10, \"Y10_1X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_UYVY10_2X10, { 20, \"UYVY10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_VYUY10_2X10, { 20, \"VYUY10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_YUYV10_2X10, { 20, \"YUYV10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_YVYU10_2X10, { 20, \"YVYU10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > > -     { MEDIA_BUS_FMT_Y12_1X12, { 12, \"Y12_1X12\", PixelFormatInfo::ColourEncodingYUV } },\n> > > -     { MEDIA_BUS_FMT_Y16_1X16, { 16, \"Y16_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_UYVY8_1X16, { 16, \"UYVY8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_VYUY8_1X16, { 16, \"VYUY8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_YUYV8_1X16, { 16, \"YUYV8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > > @@ -109,6 +114,8 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > >       { MEDIA_BUS_FMT_VYUY12_1X24, { 24, \"VYUY12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_YUYV12_1X24, { 24, \"YUYV12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n> > >       { MEDIA_BUS_FMT_YVYU12_1X24, { 24, \"YVYU12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n> > > +\n> > > +     /* Raw Bayer */\n> > >       { MEDIA_BUS_FMT_SBGGR8_1X8, { 8, \"SBGGR8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n> > >       { MEDIA_BUS_FMT_SGBRG8_1X8, { 8, \"SGBRG8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n> > >       { MEDIA_BUS_FMT_SGRBG8_1X8, { 8, \"SGRBG8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n> > > @@ -133,6 +140,7 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > >       { MEDIA_BUS_FMT_SGBRG12_1X12, { 12, \"SGBRG12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n> > >       { MEDIA_BUS_FMT_SGRBG12_1X12, { 12, \"SGRBG12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n> > >       { MEDIA_BUS_FMT_SRGGB12_1X12, { 12, \"SRGGB12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n> > > +\n> > >       /* \\todo Clarify colour encoding for HSV formats */\n> > >       { MEDIA_BUS_FMT_AHSV8888_1X32, { 32, \"AHSV8888_1X32\", PixelFormatInfo::ColourEncodingRGB } },\n> > >       { MEDIA_BUS_FMT_JPEG_1X8, { 8, \"JPEG_1X8\", PixelFormatInfo::ColourEncodingYUV } },","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 86394C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Jan 2024 15:07:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 860B962916;\n\tTue, 23 Jan 2024 16:06:59 +0100 (CET)","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 E03B3628E9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Jan 2024 16:06:57 +0100 (CET)","from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 04E471571;\n\tTue, 23 Jan 2024 16:05:43 +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=\"MBo0R+EU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1706022344;\n\tbh=ADeIxnfoBBi/h+Hl1+u0rbmibwltAgffNsDPNm6R6gU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=MBo0R+EUwSxRVF4Yynb5b/DZuvKrciAC5q3ahclqbLURtu3ExIb3B+LDElwgH7u6N\n\tEJEKmOVLSU7IENKvYiO/NjOfPYjiKuF1KHwQb/oRJKjidfWemfuY1aKDCrFctwVdFv\n\tA3kF3sn5ahXm+075yccnSLMNqfCMkYkO1YQZ9TSg=","Date":"Tue, 23 Jan 2024 17:06:55 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v2 4/4] libcamera: v4l2subdev: Organise the formatInfoMap","Message-ID":"<20240123150655.GK10679@pendragon.ideasonboard.com>","References":"<20240123143535.52255-1-kieran.bingham@ideasonboard.com>\n\t<20240123143535.52255-5-kieran.bingham@ideasonboard.com>\n\t<20240123144900.GH10679@pendragon.ideasonboard.com>\n\t<170602203779.3044059.5282564173327602779@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<170602203779.3044059.5282564173327602779@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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28609,"web_url":"https://patchwork.libcamera.org/comment/28609/","msgid":"<170602278912.1676185.11135487104172020927@ping.linuxembedded.co.uk>","date":"2024-01-23T15:13:09","subject":"Re: [PATCH v2 4/4] libcamera: v4l2subdev: Organise the formatInfoMap","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-01-23 15:06:55)\n> On Tue, Jan 23, 2024 at 03:00:37PM +0000, Kieran Bingham wrote:\n> > Quoting Laurent Pinchart (2024-01-23 14:49:00)\n> > > On Tue, Jan 23, 2024 at 02:35:35PM +0000, Kieran Bingham wrote:\n> > > > The formatInfoMap is large, cluttered and not sorted.\n> > > \n> > > It's sorted in the same order as the formats in media-bus-format.h. We\n> > > can depart from that given a good reason.\n> > \n> > Aha, that wasn't clear.\n> > \n> > I can either drop this patch or replace it with a comment stating to\n> > match the sort order in media-bus-format.h if you prefer?\n> > \n> > Personally I like the groups so that the mono/greyscale formats are\n> > clearer ... but I don't really care either way.\n> \n> A comment would be good indeed if we keep the current order. I think I\n> have a slight preference for that, as it should make it easier to\n> compile this map and the media-bus-format.h header to find missing\n> formats, but I'm OK if you prefer changing the order. I think ordering\n> bus formats is difficult as the names are a bit cryptic sometimes,\n> neither alphabetical nor numerical ordering makes real sense, and then\n> we get into endless bikeshedding to find a good order :-) The one in the\n\nWell the only good order is one that helps a human find out if something\nis missing. The only better order is one that a computer can do that for\nus and prevent us needing to in the first place. So for now I'll just\nadd a comment saying we match the sort order of media-bus-format.h.\n\n> kernel header file may or may not be good, but it has the advantage of\n> freeing us from thinking about the issue.\n> \n> > > > Organise the table into groups, and move the mono formats to their own\n> > > > grouping, as they are currently added in arbitrary points in the table.\n> > > > \n> > > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > > ---\n> > > > v2: new patch\n> > > > \n> > > >  src/libcamera/v4l2_subdevice.cpp | 14 +++++++++++---\n> > > >  1 file changed, 11 insertions(+), 3 deletions(-)\n> > > > \n> > > > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> > > > index 265240dbd405..d5605c7c8ac5 100644\n> > > > --- a/src/libcamera/v4l2_subdevice.cpp\n> > > > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > > > @@ -57,6 +57,7 @@ struct V4L2SubdeviceFormatInfo {\n> > > >   * bus codes\n> > > >   */\n> > > >  const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > > > +     /* RGB */\n> > > >       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { 16, \"RGB444_2X8_PADHI_BE\", PixelFormatInfo::ColourEncodingRGB } },\n> > > >       { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { 16, \"RGB444_2X8_PADHI_LE\", PixelFormatInfo::ColourEncodingRGB } },\n> > > >       { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, { 16, \"RGB555_2X8_PADHI_BE\", PixelFormatInfo::ColourEncodingRGB } },\n> > > > @@ -72,7 +73,14 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > > >       { MEDIA_BUS_FMT_RGB888_2X12_BE, { 24, \"RGB888_2X12_BE\", PixelFormatInfo::ColourEncodingRGB } },\n> > > >       { MEDIA_BUS_FMT_RGB888_2X12_LE, { 24, \"RGB888_2X12_LE\", PixelFormatInfo::ColourEncodingRGB } },\n> > > >       { MEDIA_BUS_FMT_ARGB8888_1X32, { 32, \"ARGB8888_1X32\", PixelFormatInfo::ColourEncodingRGB } },\n> > > > +\n> > > > +     /* Mono */\n> > > >       { MEDIA_BUS_FMT_Y8_1X8, { 8, \"Y8_1X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > > > +     { MEDIA_BUS_FMT_Y10_1X10, { 10, \"Y10_1X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > > > +     { MEDIA_BUS_FMT_Y12_1X12, { 12, \"Y12_1X12\", PixelFormatInfo::ColourEncodingYUV } },\n> > > > +     { MEDIA_BUS_FMT_Y16_1X16, { 16, \"Y16_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > > > +\n> > > > +     /* YUV */\n> > > >       { MEDIA_BUS_FMT_UV8_1X8, { 8, \"UV8_1X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_UYVY8_1_5X8, { 12, \"UYVY8_1_5X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_VYUY8_1_5X8, { 12, \"VYUY8_1_5X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > > > @@ -82,13 +90,10 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > > >       { MEDIA_BUS_FMT_VYUY8_2X8, { 16, \"VYUY8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_YUYV8_2X8, { 16, \"YUYV8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_YVYU8_2X8, { 16, \"YVYU8_2X8\", PixelFormatInfo::ColourEncodingYUV } },\n> > > > -     { MEDIA_BUS_FMT_Y10_1X10, { 10, \"Y10_1X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_UYVY10_2X10, { 20, \"UYVY10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_VYUY10_2X10, { 20, \"VYUY10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_YUYV10_2X10, { 20, \"YUYV10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_YVYU10_2X10, { 20, \"YVYU10_2X10\", PixelFormatInfo::ColourEncodingYUV } },\n> > > > -     { MEDIA_BUS_FMT_Y12_1X12, { 12, \"Y12_1X12\", PixelFormatInfo::ColourEncodingYUV } },\n> > > > -     { MEDIA_BUS_FMT_Y16_1X16, { 16, \"Y16_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_UYVY8_1X16, { 16, \"UYVY8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_VYUY8_1X16, { 16, \"VYUY8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_YUYV8_1X16, { 16, \"YUYV8_1X16\", PixelFormatInfo::ColourEncodingYUV } },\n> > > > @@ -109,6 +114,8 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > > >       { MEDIA_BUS_FMT_VYUY12_1X24, { 24, \"VYUY12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_YUYV12_1X24, { 24, \"YUYV12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n> > > >       { MEDIA_BUS_FMT_YVYU12_1X24, { 24, \"YVYU12_1X24\", PixelFormatInfo::ColourEncodingYUV } },\n> > > > +\n> > > > +     /* Raw Bayer */\n> > > >       { MEDIA_BUS_FMT_SBGGR8_1X8, { 8, \"SBGGR8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n> > > >       { MEDIA_BUS_FMT_SGBRG8_1X8, { 8, \"SGBRG8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n> > > >       { MEDIA_BUS_FMT_SGRBG8_1X8, { 8, \"SGRBG8_1X8\", PixelFormatInfo::ColourEncodingRAW } },\n> > > > @@ -133,6 +140,7 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n> > > >       { MEDIA_BUS_FMT_SGBRG12_1X12, { 12, \"SGBRG12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n> > > >       { MEDIA_BUS_FMT_SGRBG12_1X12, { 12, \"SGRBG12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n> > > >       { MEDIA_BUS_FMT_SRGGB12_1X12, { 12, \"SRGGB12_1X12\", PixelFormatInfo::ColourEncodingRAW } },\n> > > > +\n> > > >       /* \\todo Clarify colour encoding for HSV formats */\n> > > >       { MEDIA_BUS_FMT_AHSV8888_1X32, { 32, \"AHSV8888_1X32\", PixelFormatInfo::ColourEncodingRGB } },\n> > > >       { MEDIA_BUS_FMT_JPEG_1X8, { 8, \"JPEG_1X8\", PixelFormatInfo::ColourEncodingYUV } },\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 87013BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Jan 2024 15:13:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 68AF462944;\n\tTue, 23 Jan 2024 16:13:13 +0100 (CET)","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 0A622628E9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Jan 2024 16:13:12 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3B7791B9A;\n\tTue, 23 Jan 2024 16:11:58 +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=\"c9aX8H/I\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1706022718;\n\tbh=zZCcBebE7pEsIll8NvRD1/qn65jRluY6DrAK/LxVNx0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=c9aX8H/I3Jq++QdjzdBvw9UAJbfO7CwXHw5QdHlt5L03iNqMPE4K825CeLQz4wjp6\n\t+zXKoTC83d7V+JiqX6MKKoWBaRRp3H0LIKW1SZ41lepCOAv4T1yUO2IDl0icStYiV2\n\tx/iL1f49t4SkEcr4D3TPJFkDjAt9OPkDalHbqmEE=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240123150655.GK10679@pendragon.ideasonboard.com>","References":"<20240123143535.52255-1-kieran.bingham@ideasonboard.com>\n\t<20240123143535.52255-5-kieran.bingham@ideasonboard.com>\n\t<20240123144900.GH10679@pendragon.ideasonboard.com>\n\t<170602203779.3044059.5282564173327602779@ping.linuxembedded.co.uk>\n\t<20240123150655.GK10679@pendragon.ideasonboard.com>","Subject":"Re: [PATCH v2 4/4] libcamera: v4l2subdev: Organise the formatInfoMap","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Tue, 23 Jan 2024 15:13:09 +0000","Message-ID":"<170602278912.1676185.11135487104172020927@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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]