[{"id":28681,"web_url":"https://patchwork.libcamera.org/comment/28681/","msgid":"<6jdljjetxrs4ygv67vku3l2wbkdajgx4ajxrhc4tphmuzi7w4l@ksupk2ib2sqg>","date":"2024-02-16T11:35:11","subject":"Re: [PATCH v1 1/2] 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 Thu, Feb 15, 2024 at 01:27:09PM +0000, 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>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  include/linux/drm_fourcc.h         |  4 ++++\n>  include/linux/videodev2.h          |  4 ++++\n>  src/libcamera/formats.cpp          | 20 ++++++++++++++++++++\n>  src/libcamera/formats.yaml         |  5 +++++\n>  src/libcamera/v4l2_pixelformat.cpp |  4 ++++\n>  5 files changed, 37 insertions(+)\n>\n> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> index d6c83d9c49f4..4ee421b95730 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\tfourcc_code('R', 'G', '4', '8') /* [48:0] R:G:B 16:16:16 little endian */\n> +#define DRM_FORMAT_BGR161616\tfourcc_code('B', 'G', '4', '8') /* [48:0] R:G:B 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..ba48d2c89726 100644\n> --- a/include/linux/videodev2.h\n> +++ b/include/linux/videodev2.h\n> @@ -557,6 +557,10 @@ struct v4l2_pix_format {\n>  #define V4L2_PIX_FMT_BGR48_12    v4l2_fourcc('B', '3', '1', '2') /* 48  BGR 12-bit per component */\n>  #define V4L2_PIX_FMT_ABGR64_12   v4l2_fourcc('B', '4', '1', '2') /* 64  BGRA 12-bit per component */\n>\n> +/* RGB formats (6 bytes per pixel) */\n> +#define V4L2_PIX_FMT_BGR48 v4l2_fourcc('B', 'G', 'R', '6') /* 16  BGR-16-16-16 */\n> +#define V4L2_PIX_FMT_RGB48 v4l2_fourcc('R', 'G', 'B', '6') /* 16  RGB-16-16-16 */\n> +\n>  /* Grey formats */\n>  #define V4L2_PIX_FMT_GREY    v4l2_fourcc('G', 'R', 'E', 'Y') /*  8  Greyscale     */\n>  #define V4L2_PIX_FMT_Y4      v4l2_fourcc('Y', '0', '4', ' ') /*  4  Greyscale     */\n> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> index 8a606a7c37f1..a674f4179cc8 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 = 24,\n\nShouldn't this be 48 as well ?\n\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 E54D7BDE17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Feb 2024 11:35:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 22D4862805;\n\tFri, 16 Feb 2024 12:35:16 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 34C2E61CAE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Feb 2024 12:35:14 +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 B8E32564;\n\tFri, 16 Feb 2024 12:35:09 +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=\"ZqWvjGSz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1708083309;\n\tbh=9jt2IJVCVWo1vnp/AUxfwwR0pdSp1qUi5at5iV9XNVI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ZqWvjGSzpU/gNTd6RRVHp7MWCQeyJqOHjHy4JqxnBCZQs5KC95JTs0pH1xmiDjbHi\n\ttRer6UKXWV8epYI/nPDtn1ofgx6GCEiS5dRYtUekjSUf0uXO4l3YJkOiyCeZ5D87dc\n\t7n/OFmdBCtRi2I7h7wkkav9AfUXWMkbVO4F+IAPg=","Date":"Fri, 16 Feb 2024 12:35:11 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Subject":"Re: [PATCH v1 1/2] libcamera: formats: Add RGB48 formats","Message-ID":"<6jdljjetxrs4ygv67vku3l2wbkdajgx4ajxrhc4tphmuzi7w4l@ksupk2ib2sqg>","References":"<20240215132710.810-1-naush@raspberrypi.com>\n\t<20240215132710.810-2-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240215132710.810-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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28684,"web_url":"https://patchwork.libcamera.org/comment/28684/","msgid":"<CAEmqJPqzzScjjZgXnp3PmdfFZwxxSXx-9C8U-AD=fQ53zyCGZQ@mail.gmail.com>","date":"2024-02-16T12:16:38","subject":"Re: [PATCH v1 1/2] libcamera: formats: Add RGB48 formats","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"On Fri, 16 Feb 2024 at 11:35, Jacopo Mondi\n<jacopo.mondi@ideasonboard.com> wrote:\n>\n> Hi Naush\n>\n> On Thu, Feb 15, 2024 at 01:27:09PM +0000, 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> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  include/linux/drm_fourcc.h         |  4 ++++\n> >  include/linux/videodev2.h          |  4 ++++\n> >  src/libcamera/formats.cpp          | 20 ++++++++++++++++++++\n> >  src/libcamera/formats.yaml         |  5 +++++\n> >  src/libcamera/v4l2_pixelformat.cpp |  4 ++++\n> >  5 files changed, 37 insertions(+)\n> >\n> > diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> > index d6c83d9c49f4..4ee421b95730 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') /* [48:0] R:G:B 16:16:16 little endian */\n> > +#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [48:0] R:G:B 16:16:16 little endian */\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..ba48d2c89726 100644\n> > --- a/include/linux/videodev2.h\n> > +++ b/include/linux/videodev2.h\n> > @@ -557,6 +557,10 @@ struct v4l2_pix_format {\n> >  #define V4L2_PIX_FMT_BGR48_12    v4l2_fourcc('B', '3', '1', '2') /* 48  BGR 12-bit per component */\n> >  #define V4L2_PIX_FMT_ABGR64_12   v4l2_fourcc('B', '4', '1', '2') /* 64  BGRA 12-bit per component */\n> >\n> > +/* RGB formats (6 bytes per pixel) */\n> > +#define V4L2_PIX_FMT_BGR48 v4l2_fourcc('B', 'G', 'R', '6') /* 16  BGR-16-16-16 */\n> > +#define V4L2_PIX_FMT_RGB48 v4l2_fourcc('R', 'G', 'B', '6') /* 16  RGB-16-16-16 */\n> > +\n> >  /* Grey formats */\n> >  #define V4L2_PIX_FMT_GREY    v4l2_fourcc('G', 'R', 'E', 'Y') /*  8  Greyscale     */\n> >  #define V4L2_PIX_FMT_Y4      v4l2_fourcc('Y', '0', '4', ' ') /*  4  Greyscale     */\n> > diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> > index 8a606a7c37f1..a674f4179cc8 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 = 24,\n>\n> Shouldn't this be 48 as well ?\n\nYes it should! Will fix this.\n\n>\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 ABA10C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Feb 2024 12:22:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 57E3561CAE;\n\tFri, 16 Feb 2024 13:22:19 +0100 (CET)","from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com\n\t[IPv6:2607:f8b0:4864:20::1034])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 553A861CAE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Feb 2024 13:22:17 +0100 (CET)","by mail-pj1-x1034.google.com with SMTP id\n\t98e67ed59e1d1-2906773c7e9so1472329a91.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Feb 2024 04:22:17 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"sIfzlYOR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1708086136; x=1708690936;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=KAZ6pATguF7z2g0npnzK7VbMcQ/pdyYHNc/7chtxAw8=;\n\tb=sIfzlYORTrdv1POOlV3R9zjnIWqmGIomd7tMTGLDQ5ubZKVctLEppvG4jOs7sumVIW\n\tM1ejloo+57SLKdxev47/xHk90A48si1EpMYp2R0PSIc6xseUQZQxa25DLw7Fxo+Ey3Yg\n\tcU8peWh3xrF23r62V8aiPPL49ymuSxnE3HdzKP8RRd+zWvJZG0F+MGoPufoqLc47M2Cz\n\tvZuUO6hqaz5e8TlglQqEl64OpnZcCHuzqyA2cE1Ju4K58VTOaEydv8tZ63tcH0IfZJ1Z\n\thq/yBM7BNLaVPFUTJaONRxii5DYWMVD77iB/sWeaT5fjoxCfBDI/hqdc6dkNteuO90dC\n\tzDSw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1708086136; x=1708690936;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=KAZ6pATguF7z2g0npnzK7VbMcQ/pdyYHNc/7chtxAw8=;\n\tb=ii9tEsnWmgkx9LZW6NLSJAnXGMYm5iXmy5NFdWUEvuc3A6kt7rIJNct7JWW6KFQvV0\n\tIHB++SATWVErvus7Yk7e3BzmQ19HQuseGzZ6qI05vCGFmZoEiII6msksQXDRJJiJt4CC\n\tGOyxbNbn8CZ/qpF6vfpwiZZa+8HdqJ6bN139CT6Dfd+BRBV7MG79gqpZJZ2TXBVFpnXb\n\tiyA1jKvyJumATJVWhzWNEadKNNRyoDcXFOcDViLZ8b7JRuDhkp800FpbqFvpC7H041l3\n\tTcRwH0PnIA6BKWcsaeaJJ7x7zQvzUU++1uNvNVnQ5O+o4cxNeh0Crri0WVagPJKt1NDF\n\tJFFg==","X-Gm-Message-State":"AOJu0YzCcogY3Mu2HcSeMjVAkpnHO4H4wdug4lPmMC6GLFLApsNwgdus\n\t9rOHnU42DGBeIwj0lBrSOEh1VHOM90zIYIMlGVtPg/Hzf/pwxYiGdq2npKZDBkhkb6XNFkCdlSL\n\toKE/fSyuuqYPXbS7mq/Akbze8Xb8SOxHq1W3xGcpHhEUeawOn","X-Google-Smtp-Source":"AGHT+IHh6iuosr8H1ErJNdapZIVZpa/ZZYJijOugo6oqWSavMy7kVWC1+SB41xExc10e/lBGNcjNss22vakynBF+opA=","X-Received":"by 2002:a25:bfc9:0:b0:dc7:497e:cddf with SMTP id\n\tq9-20020a25bfc9000000b00dc7497ecddfmr4562025ybm.33.1708085833942;\n\tFri, 16 Feb 2024 04:17:13 -0800 (PST)","MIME-Version":"1.0","References":"<20240215132710.810-1-naush@raspberrypi.com>\n\t<20240215132710.810-2-naush@raspberrypi.com>\n\t<6jdljjetxrs4ygv67vku3l2wbkdajgx4ajxrhc4tphmuzi7w4l@ksupk2ib2sqg>","In-Reply-To":"<6jdljjetxrs4ygv67vku3l2wbkdajgx4ajxrhc4tphmuzi7w4l@ksupk2ib2sqg>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Fri, 16 Feb 2024 12:16:38 +0000","Message-ID":"<CAEmqJPqzzScjjZgXnp3PmdfFZwxxSXx-9C8U-AD=fQ53zyCGZQ@mail.gmail.com>","Subject":"Re: [PATCH v1 1/2] libcamera: formats: Add RGB48 formats","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","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@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28714,"web_url":"https://patchwork.libcamera.org/comment/28714/","msgid":"<wx2jqxftr3jlyibdlgiqkjyz2cp2wywkgtstlbhrtaquh55ved@wxqnk65d6yd3>","date":"2024-02-23T08:44:22","subject":"Re: [PATCH v1 1/2] 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  I was about to propose I could take this one in and fix the above\n16/48 typo when applying, but then I wondered\n\nOn Fri, Feb 16, 2024 at 12:16:38PM +0000, Naushir Patuck wrote:\n> On Fri, 16 Feb 2024 at 11:35, Jacopo Mondi\n> <jacopo.mondi@ideasonboard.com> wrote:\n> >\n> > Hi Naush\n> >\n> > On Thu, Feb 15, 2024 at 01:27:09PM +0000, 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> > >\n> > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > ---\n> > >  include/linux/drm_fourcc.h         |  4 ++++\n> > >  include/linux/videodev2.h          |  4 ++++\n> > >  src/libcamera/formats.cpp          | 20 ++++++++++++++++++++\n> > >  src/libcamera/formats.yaml         |  5 +++++\n> > >  src/libcamera/v4l2_pixelformat.cpp |  4 ++++\n> > >  5 files changed, 37 insertions(+)\n> > >\n> > > diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> > > index d6c83d9c49f4..4ee421b95730 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') /* [48:0] R:G:B 16:16:16 little endian */\n> > > +#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [48:0] R:G:B 16:16:16 little endian */\n                                                                              B:G:R ?\n> > > +\n\nShould this be sent to DRM first ?\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..ba48d2c89726 100644\n> > > --- a/include/linux/videodev2.h\n> > > +++ b/include/linux/videodev2.h\n> > > @@ -557,6 +557,10 @@ struct v4l2_pix_format {\n> > >  #define V4L2_PIX_FMT_BGR48_12    v4l2_fourcc('B', '3', '1', '2') /* 48  BGR 12-bit per component */\n> > >  #define V4L2_PIX_FMT_ABGR64_12   v4l2_fourcc('B', '4', '1', '2') /* 64  BGRA 12-bit per component */\n> > >\n> > > +/* RGB formats (6 bytes per pixel) */\n> > > +#define V4L2_PIX_FMT_BGR48 v4l2_fourcc('B', 'G', 'R', '6') /* 16  BGR-16-16-16 */\n> > > +#define V4L2_PIX_FMT_RGB48 v4l2_fourcc('R', 'G', 'B', '6') /* 16  RGB-16-16-16 */\n> > > +\n> > >  /* Grey formats */\n> > >  #define V4L2_PIX_FMT_GREY    v4l2_fourcc('G', 'R', 'E', 'Y') /*  8  Greyscale     */\n> > >  #define V4L2_PIX_FMT_Y4      v4l2_fourcc('Y', '0', '4', ' ') /*  4  Greyscale     */\n> > > diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> > > index 8a606a7c37f1..a674f4179cc8 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 = 24,\n> >\n> > Shouldn't this be 48 as well ?\n>\n> Yes it should! Will fix this.\n>\n> >\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 6C7D8BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 23 Feb 2024 08:44:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9665C62805;\n\tFri, 23 Feb 2024 09:44:27 +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 B9A80627FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 Feb 2024 09:44:25 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2001:b07:5d2e:52c9:cc1e:e404:491f:e6ea])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7E5022E7;\n\tFri, 23 Feb 2024 09:44:16 +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=\"SuK6RxtB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1708677856;\n\tbh=tP5ZkjyhSXR92vv1nfbInRMn7Dl097vzv63wLjQcB/E=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=SuK6RxtBclT47bECRx+YBa8Fq0TPjKCh48uahByVS4QDRzQ12OtQHYhz+4A2EThCT\n\tQAXwTIyciiXQybqCFriVqVfckBheYiOiDts8op65ieeVv8KYMQBk10Yz/v9AxGYSEW\n\t9LKYZRbiMErJ9eWoAl+EGjwniunczP67i+ap5SMI=","Date":"Fri, 23 Feb 2024 09:44:22 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Subject":"Re: [PATCH v1 1/2] libcamera: formats: Add RGB48 formats","Message-ID":"<wx2jqxftr3jlyibdlgiqkjyz2cp2wywkgtstlbhrtaquh55ved@wxqnk65d6yd3>","References":"<20240215132710.810-1-naush@raspberrypi.com>\n\t<20240215132710.810-2-naush@raspberrypi.com>\n\t<6jdljjetxrs4ygv67vku3l2wbkdajgx4ajxrhc4tphmuzi7w4l@ksupk2ib2sqg>\n\t<CAEmqJPqzzScjjZgXnp3PmdfFZwxxSXx-9C8U-AD=fQ53zyCGZQ@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAEmqJPqzzScjjZgXnp3PmdfFZwxxSXx-9C8U-AD=fQ53zyCGZQ@mail.gmail.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":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28715,"web_url":"https://patchwork.libcamera.org/comment/28715/","msgid":"<20240223104841.GL31348@pendragon.ideasonboard.com>","date":"2024-02-23T10:48:41","subject":"Re: [PATCH v1 1/2] 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 Fri, Feb 23, 2024 at 09:44:22AM +0100, Jacopo Mondi wrote:\n> Hi Naush\n>   I was about to propose I could take this one in and fix the above\n> 16/48 typo when applying, but then I wondered\n> \n> On Fri, Feb 16, 2024 at 12:16:38PM +0000, Naushir Patuck wrote:\n> > On Fri, 16 Feb 2024 at 11:35, Jacopo Mondi wrote:\n> > > On Thu, Feb 15, 2024 at 01:27:09PM +0000, 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> > > >\n> > > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > > ---\n> > > >  include/linux/drm_fourcc.h         |  4 ++++\n> > > >  include/linux/videodev2.h          |  4 ++++\n> > > >  src/libcamera/formats.cpp          | 20 ++++++++++++++++++++\n> > > >  src/libcamera/formats.yaml         |  5 +++++\n> > > >  src/libcamera/v4l2_pixelformat.cpp |  4 ++++\n> > > >  5 files changed, 37 insertions(+)\n> > > >\n> > > > diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> > > > index d6c83d9c49f4..4ee421b95730 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') /* [48:0] R:G:B 16:16:16 little endian */\n> > > > +#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [48:0] R:G:B 16:16:16 little endian */\n>                                                                               B:G:R ?\n> > > > +\n> \n> Should this be sent to DRM first ?\n\nYes please :-) We don't want to depart more than we have already from\ndrm_fourcc.h (and the existing diff will need to be handled at some\npoint).\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..ba48d2c89726 100644\n> > > > --- a/include/linux/videodev2.h\n> > > > +++ b/include/linux/videodev2.h\n> > > > @@ -557,6 +557,10 @@ struct v4l2_pix_format {\n> > > >  #define V4L2_PIX_FMT_BGR48_12    v4l2_fourcc('B', '3', '1', '2') /* 48  BGR 12-bit per component */\n> > > >  #define V4L2_PIX_FMT_ABGR64_12   v4l2_fourcc('B', '4', '1', '2') /* 64  BGRA 12-bit per component */\n> > > >\n> > > > +/* RGB formats (6 bytes per pixel) */\n> > > > +#define V4L2_PIX_FMT_BGR48 v4l2_fourcc('B', 'G', 'R', '6') /* 16  BGR-16-16-16 */\n> > > > +#define V4L2_PIX_FMT_RGB48 v4l2_fourcc('R', 'G', 'B', '6') /* 16  RGB-16-16-16 */\n> > > > +\n> > > >  /* Grey formats */\n> > > >  #define V4L2_PIX_FMT_GREY    v4l2_fourcc('G', 'R', 'E', 'Y') /*  8  Greyscale     */\n> > > >  #define V4L2_PIX_FMT_Y4      v4l2_fourcc('Y', '0', '4', ' ') /*  4  Greyscale     */\n> > > > diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> > > > index 8a606a7c37f1..a674f4179cc8 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 = 24,\n> > >\n> > > Shouldn't this be 48 as well ?\n> >\n> > Yes it should! Will fix this.\n> >\n> > >\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 07AADC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 23 Feb 2024 10:48:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 31E6362805;\n\tFri, 23 Feb 2024 11:48:40 +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 86200627FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 Feb 2024 11:48:38 +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 0C38E2E7;\n\tFri, 23 Feb 2024 11:48:28 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"szdSPvm5\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1708685309;\n\tbh=qP3+zjiczwf21TigRD2FYqnJCDynww4EoVRL8AJNctc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=szdSPvm5upFCCMXr1I+uaJhYBHFMzfk0eyVo0V6W/DTqw45P+XmTyFy44ANHazfVS\n\tnrKHoD8VggVCjPw+q2+IA0TtkMWhnrJ1ISOcHC0RZGgbu60M5fJ9iiuX2dPtiq5vUd\n\t65bJW5XWODDzgf8cQfWirv6KL0T/g5RrNiIUIm6k=","Date":"Fri, 23 Feb 2024 12:48:41 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Subject":"Re: [PATCH v1 1/2] libcamera: formats: Add RGB48 formats","Message-ID":"<20240223104841.GL31348@pendragon.ideasonboard.com>","References":"<20240215132710.810-1-naush@raspberrypi.com>\n\t<20240215132710.810-2-naush@raspberrypi.com>\n\t<6jdljjetxrs4ygv67vku3l2wbkdajgx4ajxrhc4tphmuzi7w4l@ksupk2ib2sqg>\n\t<CAEmqJPqzzScjjZgXnp3PmdfFZwxxSXx-9C8U-AD=fQ53zyCGZQ@mail.gmail.com>\n\t<wx2jqxftr3jlyibdlgiqkjyz2cp2wywkgtstlbhrtaquh55ved@wxqnk65d6yd3>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<wx2jqxftr3jlyibdlgiqkjyz2cp2wywkgtstlbhrtaquh55ved@wxqnk65d6yd3>","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@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28728,"web_url":"https://patchwork.libcamera.org/comment/28728/","msgid":"<CAEmqJPqK7MavGqUd9KStiqu8g6k1HV2nDgHVr_yvk=1O232YuA@mail.gmail.com>","date":"2024-02-26T09:09:50","subject":"Re: [PATCH v1 1/2] libcamera: formats: Add RGB48 formats","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"On Fri, 23 Feb 2024 at 10:48, Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> On Fri, Feb 23, 2024 at 09:44:22AM +0100, Jacopo Mondi wrote:\n> > Hi Naush\n> >   I was about to propose I could take this one in and fix the above\n> > 16/48 typo when applying, but then I wondered\n> >\n> > On Fri, Feb 16, 2024 at 12:16:38PM +0000, Naushir Patuck wrote:\n> > > On Fri, 16 Feb 2024 at 11:35, Jacopo Mondi wrote:\n> > > > On Thu, Feb 15, 2024 at 01:27:09PM +0000, 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> > > > >\n> > > > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > > > ---\n> > > > >  include/linux/drm_fourcc.h         |  4 ++++\n> > > > >  include/linux/videodev2.h          |  4 ++++\n> > > > >  src/libcamera/formats.cpp          | 20 ++++++++++++++++++++\n> > > > >  src/libcamera/formats.yaml         |  5 +++++\n> > > > >  src/libcamera/v4l2_pixelformat.cpp |  4 ++++\n> > > > >  5 files changed, 37 insertions(+)\n> > > > >\n> > > > > diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> > > > > index d6c83d9c49f4..4ee421b95730 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') /* [48:0] R:G:B 16:16:16 little endian */\n> > > > > +#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [48:0] R:G:B 16:16:16 little endian */\n> >                                                                               B:G:R ?\n> > > > > +\n> >\n> > Should this be sent to DRM first ?\n>\n> Yes please :-) We don't want to depart more than we have already from\n> drm_fourcc.h (and the existing diff will need to be handled at some\n> point).\n\nOops, sorry, I thought this had already been done!\nYes, this should wait until the changes are sent to the DRM ML first.\n\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..ba48d2c89726 100644\n> > > > > --- a/include/linux/videodev2.h\n> > > > > +++ b/include/linux/videodev2.h\n> > > > > @@ -557,6 +557,10 @@ struct v4l2_pix_format {\n> > > > >  #define V4L2_PIX_FMT_BGR48_12    v4l2_fourcc('B', '3', '1', '2') /* 48  BGR 12-bit per component */\n> > > > >  #define V4L2_PIX_FMT_ABGR64_12   v4l2_fourcc('B', '4', '1', '2') /* 64  BGRA 12-bit per component */\n> > > > >\n> > > > > +/* RGB formats (6 bytes per pixel) */\n> > > > > +#define V4L2_PIX_FMT_BGR48 v4l2_fourcc('B', 'G', 'R', '6') /* 16  BGR-16-16-16 */\n> > > > > +#define V4L2_PIX_FMT_RGB48 v4l2_fourcc('R', 'G', 'B', '6') /* 16  RGB-16-16-16 */\n> > > > > +\n> > > > >  /* Grey formats */\n> > > > >  #define V4L2_PIX_FMT_GREY    v4l2_fourcc('G', 'R', 'E', 'Y') /*  8  Greyscale     */\n> > > > >  #define V4L2_PIX_FMT_Y4      v4l2_fourcc('Y', '0', '4', ' ') /*  4  Greyscale     */\n> > > > > diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> > > > > index 8a606a7c37f1..a674f4179cc8 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 = 24,\n> > > >\n> > > > Shouldn't this be 48 as well ?\n> > >\n> > > Yes it should! Will fix this.\n> > >\n> > > >\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> --\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 C8F26BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Feb 2024 09:10:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0D7DF62867;\n\tMon, 26 Feb 2024 10:10:30 +0100 (CET)","from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com\n\t[IPv6:2607:f8b0:4864:20::112e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B175361C9A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Feb 2024 10:10:27 +0100 (CET)","by mail-yw1-x112e.google.com with SMTP id\n\t00721157ae682-607c5679842so27923477b3.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Feb 2024 01:10:27 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"TiTZNO19\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1708938626; x=1709543426;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=2aVlmUmPY9Okzg4oi6fNyoYokCHDu7TFzKMq/1iSRik=;\n\tb=TiTZNO19O+nA7DqL96UfJAFgyLv2QkSTWb3UUkwKMSgIw1rqIULGhU40FjmSi61VJf\n\tSUbLO9BBJrtIx9BRXzDea+UvbF6290osQVr/j83a6jlLCaokgLF7Gim2LbDg77qWkw7W\n\tG1QYZh6iaMBVTFvOvI9t4BBOX9TmHt4Fmm6mwirEoZcFfhNknSSgYiV+2T874Wij7sK7\n\tS4wRy5bw9QQNrIcGOqvhW8JV9GADJ2qSNOrnxn3MMuiM4CoupFh9aGhhwOMlBfL/vz5O\n\tMLbXdoZM7mQx+VBPrR/mvduwnDWXUHg3eViCuN8+9CixXM5ozt4zw0/Nib6kqfyRsVY+\n\tlGiQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1708938626; x=1709543426;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=2aVlmUmPY9Okzg4oi6fNyoYokCHDu7TFzKMq/1iSRik=;\n\tb=uCURzYpDABlE99zittZXLkQCokz62ASmxP2T/ea41Cn8B4vsACbPbXIynpmF67N/sG\n\ttD/NUxttYZTPykutu3yoG3nQJxPYK9fXwYpNh1FesPI3QNe0HGUSgeXr42PvOe261is+\n\tliHn8UF3DOQN0z0alwOkLnED8H4NENp1NCrOD+ycXsyZCrAuJJcHrZ9YzsvVSvizoYn0\n\trOR+OVX9WUjLXabxi+q2zu5kKb/76ICMXJoMWam7aSre5qNbjKvXYEdHXaky7rwGjCDa\n\tcq6IapSnNMvMW0Pz4/HteERD9mb2nVG9tbKGkjzOKl0FHWB2SLA+jmQXQBP7VhEPQXos\n\t3LNw==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCVOZ3YtfZPvph+qqKBlTh/PJh74fwIplOHsBrmIvgwyXSzlQkZb794aMJMeiH2hSNbhVo9qgOjOoa1IhlE03MHajkoxdsja+DAlTIFl6oN6OWSHaw==","X-Gm-Message-State":"AOJu0YxNit7Yjhn4SdaAiVGAqUF3cXBGmI+6mYZrYBSfAdsEd+IKmnjY\n\tMCYdkjFeDNsmSEB9UjXgBBWL/vQkJQvyjZYjuwnbWkc9JF1OYLEWdxSQCtZHIKDONLtvZ+CYxZz\n\trx6Z84PH5KF3H6PdPSulzzuKjl6191qCTZuURMg==","X-Google-Smtp-Source":"AGHT+IHlU3xBoKgusQhAZt3VN6kF7bz7d+/yS+d6mOCaL6oWDySzep3A4iNqnT77qQWA4Psq+kzp0YVGdtxqANWYjgE=","X-Received":"by 2002:a81:4f87:0:b0:608:edec:e76b with SMTP id\n\td129-20020a814f87000000b00608edece76bmr2259536ywb.33.1708938626377;\n\tMon, 26 Feb 2024 01:10:26 -0800 (PST)","MIME-Version":"1.0","References":"<20240215132710.810-1-naush@raspberrypi.com>\n\t<20240215132710.810-2-naush@raspberrypi.com>\n\t<6jdljjetxrs4ygv67vku3l2wbkdajgx4ajxrhc4tphmuzi7w4l@ksupk2ib2sqg>\n\t<CAEmqJPqzzScjjZgXnp3PmdfFZwxxSXx-9C8U-AD=fQ53zyCGZQ@mail.gmail.com>\n\t<wx2jqxftr3jlyibdlgiqkjyz2cp2wywkgtstlbhrtaquh55ved@wxqnk65d6yd3>\n\t<20240223104841.GL31348@pendragon.ideasonboard.com>","In-Reply-To":"<20240223104841.GL31348@pendragon.ideasonboard.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Mon, 26 Feb 2024 09:09:50 +0000","Message-ID":"<CAEmqJPqK7MavGqUd9KStiqu8g6k1HV2nDgHVr_yvk=1O232YuA@mail.gmail.com>","Subject":"Re: [PATCH v1 1/2] libcamera: formats: Add RGB48 formats","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","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":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]