[{"id":29381,"web_url":"https://patchwork.libcamera.org/comment/29381/","msgid":"<owdtnqo5l3mtbiwi2lsqgflvjsjixwp6nqejoy6y2rkpint634@qla5afmcwsum>","date":"2024-05-02T09:38:16","subject":"Re: [PATCH v1 2/5] libcamera: formats: Add PiSP specific image and\n\tconfig buffer 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, May 02, 2024 at 09:09:22AM GMT, Naushir Patuck wrote:\n> Add the Raspberry Pi 5 PiSP specific verification format:\n> - V4L2_PIX_FMT_RPI_BE\n>\n> Add the Raspberry Pi 5 PiSP specific compressed Bayer format types 1/2:\n> - V4L2_PIX_FMT_PISP_COMP1_xxx\n> - V4L2_PIX_FMT_PISP_COMP2_xxx\n>\n> Add the Raspberry Pi 5 PiSP Frontend and Backend config formats:\n> - V4L2_META_FMT_RPI_FE_CFG\n> - V4L2_META_FMT_RPI_BE_CFG\n>\n> Add the Raspberry Pi 5 PiSP Frontend statistics format:\n> - V4L2_META_FMT_RPI_FE_STATS\n>\n> Add 16-bit Bayer formats:\n> - MEDIA_BUS_FMT_Sxxx16_1X16\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  include/libcamera/internal/bayer_format.h |  2 +\n>  include/linux/drm_fourcc.h                |  5 +++\n>  include/linux/videodev2.h                 | 21 ++++++++++\n>  src/libcamera/bayer_format.cpp            | 14 +++++++\n>  src/libcamera/formats.cpp                 | 51 ++++++++++++++++++++++-\n>  src/libcamera/formats.yaml                | 16 +++++++\n>  src/libcamera/v4l2_pixelformat.cpp        | 10 +++++\n>  src/libcamera/v4l2_subdevice.cpp          | 28 +++++++++++++\n>  8 files changed, 146 insertions(+), 1 deletion(-)\n>\n> diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h\n> index 78ba3969913d..164743f7e9f6 100644\n> --- a/include/libcamera/internal/bayer_format.h\n> +++ b/include/libcamera/internal/bayer_format.h\n> @@ -34,6 +34,8 @@ public:\n>  \t\tNone = 0,\n>  \t\tCSI2 = 1,\n>  \t\tIPU3 = 2,\n> +\t\tPISP1 = 3,\n> +\t\tPISP2 = 4,\n>  \t};\n>\n>  \tconstexpr BayerFormat()\n> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> index 4ee421b95730..322563763cbc 100644\n> --- a/include/linux/drm_fourcc.h\n> +++ b/include/linux/drm_fourcc.h\n> @@ -490,6 +490,7 @@ extern \"C\" {\n>  #define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09\n>  #define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a\n>  #define DRM_FORMAT_MOD_VENDOR_MIPI 0x0b\n> +#define DRM_FORMAT_MOD_VENDOR_RPI 0x0c\n>\n>  /* add more to the end as needed */\n>\n> @@ -1670,6 +1671,10 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n>   */\n>  #define MIPI_FORMAT_MOD_CSI2_PACKED fourcc_mod_code(MIPI, 1)\n>\n> +#define PISP_FORMAT_MOD_COMPRESS_MODE1 fourcc_mod_code(RPI, 1)\n> +#define PISP_FORMAT_MOD_COMPRESS_MODE2 fourcc_mod_code(RPI, 2)\n> +#define PISP_FORMAT_MOD_VERIFICATION fourcc_mod_code(RPI, 3)\n> +\n\nIdeally, this should have been resolved upstream\nhttps://www.spinics.net/lists/dri-devel/msg435203.html\n\nbut this hasn't progressed much, as we got stuck at\nhttps://www.spinics.net/lists/dri-devel/msg435537.html\n\nas we would need to uptream the DRM Bayer format first, but not in the\nform they are today.\n\nSo I guess is fine keeping this downstream for the moment ?\n\n>  #if defined(__cplusplus)\n>  }\n>  #endif\n> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n> index ba48d2c89726..226665b59d58 100644\n> --- a/include/linux/videodev2.h\n> +++ b/include/linux/videodev2.h\n> @@ -789,6 +789,18 @@ struct v4l2_pix_format {\n>  #define V4L2_PIX_FMT_IPU3_SGRBG10\tv4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */\n>  #define V4L2_PIX_FMT_IPU3_SRGGB10\tv4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */\n>\n> +/* Raspberry Pi PiSP compressed formats. */\n> +#define V4L2_PIX_FMT_PISP_COMP1_RGGB\tv4l2_fourcc('P', 'C', '1', 'R') /* PiSP 8-bit mode 1 compressed RGGB bayer */\n> +#define V4L2_PIX_FMT_PISP_COMP1_GRBG\tv4l2_fourcc('P', 'C', '1', 'G') /* PiSP 8-bit mode 1 compressed GRBG bayer */\n> +#define V4L2_PIX_FMT_PISP_COMP1_GBRG\tv4l2_fourcc('P', 'C', '1', 'g') /* PiSP 8-bit mode 1 compressed GBRG bayer */\n> +#define V4L2_PIX_FMT_PISP_COMP1_BGGR\tv4l2_fourcc('P', 'C', '1', 'B') /* PiSP 8-bit mode 1 compressed BGGR bayer */\n> +#define V4L2_PIX_FMT_PISP_COMP1_MONO\tv4l2_fourcc('P', 'C', '1', 'M') /* PiSP 8-bit mode 1 compressed monochrome */\n> +#define V4L2_PIX_FMT_PISP_COMP2_RGGB\tv4l2_fourcc('P', 'C', '2', 'R') /* PiSP 8-bit mode 2 compressed RGGB bayer */\n> +#define V4L2_PIX_FMT_PISP_COMP2_GRBG\tv4l2_fourcc('P', 'C', '2', 'G') /* PiSP 8-bit mode 2 compressed GRBG bayer */\n> +#define V4L2_PIX_FMT_PISP_COMP2_GBRG\tv4l2_fourcc('P', 'C', '2', 'g') /* PiSP 8-bit mode 2 compressed GBRG bayer */\n> +#define V4L2_PIX_FMT_PISP_COMP2_BGGR\tv4l2_fourcc('P', 'C', '2', 'B') /* PiSP 8-bit mode 2 compressed BGGR bayer */\n> +#define V4L2_PIX_FMT_PISP_COMP2_MONO\tv4l2_fourcc('P', 'C', '2', 'M') /* PiSP 8-bit mode 2 compressed monochrome */\n> +\n\nAck\n\n>  /* SDR formats - used only for Software Defined Radio devices */\n>  #define V4L2_SDR_FMT_CU8          v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */\n>  #define V4L2_SDR_FMT_CU16LE       v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */\n> @@ -818,6 +830,15 @@ struct v4l2_pix_format {\n>  #define V4L2_META_FMT_RK_ISP1_PARAMS\tv4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */\n>  #define V4L2_META_FMT_RK_ISP1_STAT_3A\tv4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */\n>\n> +/* The metadata format identifier for BE configuration buffers. */\n> +#define V4L2_META_FMT_RPI_BE_CFG v4l2_fourcc('R', 'P', 'B', 'C')\n> +\n> +/* The metadata format identifier for FE configuration buffers. */\n> +#define V4L2_META_FMT_RPI_FE_CFG v4l2_fourcc('R', 'P', 'F', 'C')\n> +\n> +/* The metadata format identifier for FE stats buffers. */\n> +#define V4L2_META_FMT_RPI_FE_STATS v4l2_fourcc('R', 'P', 'F', 'S')\n> +\n\nThe comments and ordering might end up being different as BE and FE\nare being upstreamed separately. I guess it's fine!\n\n>  /* priv field value to indicates that subsequent fields are valid. */\n>  #define V4L2_PIX_FMT_PRIV_MAGIC\t\t0xfeedcafe\n>\n> diff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp\n> index 20aedfa6d925..ed6f7d62a7a3 100644\n> --- a/src/libcamera/bayer_format.cpp\n> +++ b/src/libcamera/bayer_format.cpp\n> @@ -164,6 +164,14 @@ const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{\n>  \t\t{ formats::SGRBG16, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16) } },\n>  \t{ { BayerFormat::RGGB, 16, BayerFormat::Packing::None },\n>  \t\t{ formats::SRGGB16, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16) } },\n> +\t{ { BayerFormat::BGGR, 16, BayerFormat::Packing::PISP1 },\n> +\t\t{ formats::BGGR_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_BGGR) } },\n> +\t{ { BayerFormat::GBRG, 16, BayerFormat::Packing::PISP1 },\n> +\t\t{ formats::GBRG_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GBRG) } },\n> +\t{ { BayerFormat::GRBG, 16, BayerFormat::Packing::PISP1 },\n> +\t\t{ formats::GRBG_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GRBG) } },\n> +\t{ { BayerFormat::RGGB, 16, BayerFormat::Packing::PISP1 },\n> +\t\t{ formats::RGGB_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_RGGB) } },\n>  \t{ { BayerFormat::MONO, 8, BayerFormat::Packing::None },\n>  \t\t{ formats::R8, V4L2PixelFormat(V4L2_PIX_FMT_GREY) } },\n>  \t{ { BayerFormat::MONO, 10, BayerFormat::Packing::None },\n> @@ -174,6 +182,8 @@ const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{\n>  \t\t{ formats::R12, V4L2PixelFormat(V4L2_PIX_FMT_Y12) } },\n>  \t{ { BayerFormat::MONO, 16, BayerFormat::Packing::None },\n>  \t\t{ formats::R16, V4L2PixelFormat(V4L2_PIX_FMT_Y16) } },\n> +\t{ { BayerFormat::MONO, 16, BayerFormat::Packing::PISP1 },\n> +\t\t{ formats::MONO_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_MONO) } },\n>  };\n>\n>  const std::unordered_map<unsigned int, BayerFormat> mbusCodeToBayer{\n> @@ -303,6 +313,10 @@ std::ostream &operator<<(std::ostream &out, const BayerFormat &f)\n>  \t\tout << \"-CSI2P\";\n>  \telse if (f.packing == BayerFormat::Packing::IPU3)\n>  \t\tout << \"-IPU3P\";\n> +\telse if (f.packing == BayerFormat::Packing::PISP1)\n> +\t\tout << \"-PISP1\";\n> +\telse if (f.packing == BayerFormat::Packing::PISP2)\n> +\t\tout << \"-PISP2\";\n>\n>  \treturn out;\n>  }\n> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> index 21a7719e84c4..855c5f98d378 100644\n> --- a/src/libcamera/formats.cpp\n> +++ b/src/libcamera/formats.cpp\n> @@ -547,6 +547,16 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.pixelsPerGroup = 1,\n>  \t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n>  \t} },\n> +\t{ formats::MONO_PISP_COMP1, {\n> +\t\t.name = \"MONO_PISP_COMP1\",\n> +\t\t.format = formats::MONO_PISP_COMP1,\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_MONO), },\n> +\t\t.bitsPerPixel = 8,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> +\t\t.packed = true,\n> +\t\t.pixelsPerGroup = 1,\n> +\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n\nBeing this 1 byte per pixel and 1 pixel per group , shouldn't this be { 1, 1} ?\n\n> +\t} },\n>\n>  \t/* Bayer formats. */\n>  \t{ formats::SBGGR8, {\n> @@ -910,7 +920,46 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n>  \t\t.pixelsPerGroup = 25,\n>  \t\t.planes = {{ { 32, 1 }, { 0, 0 }, { 0, 0 } }},\n>  \t} },\n> -\n> +\t{ formats::BGGR_PISP_COMP1, {\n> +\t\t.name = \"BGGR_PISP_COMP1\",\n> +\t\t.format = formats::BGGR_PISP_COMP1,\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_BGGR), },\n> +\t\t.bitsPerPixel = 8,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t\t.packed = true,\n> +\t\t.pixelsPerGroup = 2,\n> +\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n> +\t} },\n> +\t{ formats::GBRG_PISP_COMP1, {\n> +\t\t.name = \"GBRG_PISP_COMP1\",\n> +\t\t.format = formats::GBRG_PISP_COMP1,\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GBRG), },\n> +\t\t.bitsPerPixel = 8,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t\t.packed = true,\n> +\t\t.pixelsPerGroup = 2,\n> +\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n> +\t} },\n> +\t{ formats::GRBG_PISP_COMP1, {\n> +\t\t.name = \"GRBG_PISP_COMP1\",\n> +\t\t.format = formats::GRBG_PISP_COMP1,\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GRBG), },\n> +\t\t.bitsPerPixel = 8,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t\t.packed = true,\n> +\t\t.pixelsPerGroup = 2,\n> +\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n> +\t} },\n> +\t{ formats::RGGB_PISP_COMP1, {\n> +\t\t.name = \"RGGB_PISP_COMP1\",\n> +\t\t.format = formats::RGGB_PISP_COMP1,\n> +\t\t.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_RGGB), },\n> +\t\t.bitsPerPixel = 8,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t\t.packed = true,\n> +\t\t.pixelsPerGroup = 2,\n> +\t\t.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n> +\t} },\n\nAck!\n\n>  \t/* Compressed formats. */\n>  \t{ formats::MJPEG, {\n>  \t\t.name = \"MJPEG\",\n> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> index bde2cc803b98..fe027a7cce70 100644\n> --- a/src/libcamera/formats.yaml\n> +++ b/src/libcamera/formats.yaml\n> @@ -190,4 +190,20 @@ formats:\n>    - SBGGR10_IPU3:\n>        fourcc: DRM_FORMAT_SBGGR10\n>        mod: IPU3_FORMAT_MOD_PACKED\n> +\n> +  - RGGB_PISP_COMP1:\n> +      fourcc: DRM_FORMAT_SRGGB16\n> +      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n> +  - GRBG_PISP_COMP1:\n> +      fourcc: DRM_FORMAT_SGRBG16\n> +      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n> +  - GBRG_PISP_COMP1:\n> +      fourcc: DRM_FORMAT_SGBRG16\n> +      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n> +  - BGGR_PISP_COMP1:\n> +      fourcc: DRM_FORMAT_SBGGR16\n> +      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n> +  - MONO_PISP_COMP1:\n> +      fourcc: DRM_FORMAT_R16\n> +      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n>  ...\n> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\n> index efb6f2940235..977ae5834017 100644\n> --- a/src/libcamera/v4l2_pixelformat.cpp\n> +++ b/src/libcamera/v4l2_pixelformat.cpp\n> @@ -207,6 +207,16 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{\n>  \t\t{ formats::SGRBG16, \"16-bit Bayer GRGR/BGBG\" } },\n>  \t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16),\n>  \t\t{ formats::SRGGB16, \"16-bit Bayer RGRG/GBGB\" } },\n> +\t{ V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_BGGR),\n> +\t\t{ formats::BGGR_PISP_COMP1, \"16-bit Bayer BGBG/GRGR PiSP Compress Mode 1\" } },\n> +\t{ V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GBRG),\n> +\t\t{ formats::GBRG_PISP_COMP1, \"16-bit Bayer GBGB/RGRG PiSP Compress Mode 1\" } },\n> +\t{ V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GRBG),\n> +\t\t{ formats::GRBG_PISP_COMP1, \"16-bit Bayer GRGR/BGBG PiSP Compress Mode 1\" } },\n> +\t{ V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_RGGB),\n> +\t\t{ formats::RGGB_PISP_COMP1, \"16-bit Bayer RGRG/GBGB PiSP Compress Mode 1\" } },\n> +\t{ V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_MONO),\n> +\t\t{ formats::MONO_PISP_COMP1, \"16-bit Mono PiSP Compress Mode 1\" } },\n>\n>  \t/* Compressed formats. */\n>  \t{ V4L2PixelFormat(V4L2_PIX_FMT_MJPEG),\n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index 1076b7006b0b..60852efee6b4 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -651,6 +651,34 @@ const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{\n>  \t\t.bitsPerPixel = 14,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n> +\t{ MEDIA_BUS_FMT_SBGGR16_1X16, {\n> +\t\t.name = \"SBGGR16_1x16\",\n\nIt seems to me the other format names use capital 'X'\n\n> +\t\t.code = MEDIA_BUS_FMT_SBGGR16_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n> +\t\t.bitsPerPixel = 16,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_SGBRG16_1X16, {\n> +\t\t.name = \"SGBRG16_1x16\",\n> +\t\t.code = MEDIA_BUS_FMT_SGBRG16_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n> +\t\t.bitsPerPixel = 16,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_SGRBG16_1X16, {\n> +\t\t.name = \"SGRBG16_1x16\",\n> +\t\t.code = MEDIA_BUS_FMT_SGRBG16_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n> +\t\t.bitsPerPixel = 16,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_SRGGB16_1X16, {\n> +\t\t.name = \"SRGGB16_1x16\",\n> +\t\t.code = MEDIA_BUS_FMT_SRGGB16_1X16,\n> +\t\t.type = MediaBusFormatInfo::Type::Image,\n> +\t\t.bitsPerPixel = 16,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW\n> +\t} },\n\nThese are unrelated to the PiSP formats, right ? (just for my\nunderstanding). I think it's anyway good to have them here (if\nunrelared, possibily in a separate patch ?)\n\nNit on the here above formats name ('x' vs 'X') apart, the rest looks\ngood\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n>  \t/* \\todo Clarify colour encoding for HSV formats */\n>  \t{ MEDIA_BUS_FMT_AHSV8888_1X32, {\n>  \t\t.name = \"AHSV8888_1X32\",\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 2BD51BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 May 2024 09:38:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4C3BF61A89;\n\tThu,  2 May 2024 11:38:22 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BE29661A89\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 May 2024 11:38:19 +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 33EBEBC8;\n\tThu,  2 May 2024 11:37:22 +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=\"ffsXIJwP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714642642;\n\tbh=aLL18gs/zdoGTwXayBJOrx36V/Se0MgeLv7SlJMhTwU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ffsXIJwP0r+5k3oK3nlXZOWxfshv253MpYfEYg0KtU1oQswGzgr0CTiFVARZ9cCTa\n\tMgkxDnONangI19EFXuxnd8yfIKVou3e9waljH50YKc6KFiF4SOnE/xMLfTRMlrDc7z\n\toQP9Ev2NEN2Guob9kS6M94dw57dMIfOTzC3lvU10=","Date":"Thu, 2 May 2024 11:38:16 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tDavid Plowman <david.plowman@raspberrypi.com>","Subject":"Re: [PATCH v1 2/5] libcamera: formats: Add PiSP specific image and\n\tconfig buffer formats","Message-ID":"<owdtnqo5l3mtbiwi2lsqgflvjsjixwp6nqejoy6y2rkpint634@qla5afmcwsum>","References":"<20240502080925.31730-1-naush@raspberrypi.com>\n\t<20240502080925.31730-3-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240502080925.31730-3-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":29388,"web_url":"https://patchwork.libcamera.org/comment/29388/","msgid":"<CAEmqJPpoV+MAvYhUwVF5mkFtVS=tTn83rWjUNqyuSPuVMPyiDQ@mail.gmail.com>","date":"2024-05-02T12:42:16","subject":"Re: [PATCH v1 2/5] libcamera: formats: Add PiSP specific image and\n\tconfig buffer formats","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Jacopo,\n\nThanks for the feedback!\n\nOn Thu, 2 May 2024 at 10:38, Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote:\n>\n> Hi Naush\n>\n> On Thu, May 02, 2024 at 09:09:22AM GMT, Naushir Patuck wrote:\n> > Add the Raspberry Pi 5 PiSP specific verification format:\n> > - V4L2_PIX_FMT_RPI_BE\n> >\n> > Add the Raspberry Pi 5 PiSP specific compressed Bayer format types 1/2:\n> > - V4L2_PIX_FMT_PISP_COMP1_xxx\n> > - V4L2_PIX_FMT_PISP_COMP2_xxx\n> >\n> > Add the Raspberry Pi 5 PiSP Frontend and Backend config formats:\n> > - V4L2_META_FMT_RPI_FE_CFG\n> > - V4L2_META_FMT_RPI_BE_CFG\n> >\n> > Add the Raspberry Pi 5 PiSP Frontend statistics format:\n> > - V4L2_META_FMT_RPI_FE_STATS\n> >\n> > Add 16-bit Bayer formats:\n> > - MEDIA_BUS_FMT_Sxxx16_1X16\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> > ---\n> >  include/libcamera/internal/bayer_format.h |  2 +\n> >  include/linux/drm_fourcc.h                |  5 +++\n> >  include/linux/videodev2.h                 | 21 ++++++++++\n> >  src/libcamera/bayer_format.cpp            | 14 +++++++\n> >  src/libcamera/formats.cpp                 | 51 ++++++++++++++++++++++-\n> >  src/libcamera/formats.yaml                | 16 +++++++\n> >  src/libcamera/v4l2_pixelformat.cpp        | 10 +++++\n> >  src/libcamera/v4l2_subdevice.cpp          | 28 +++++++++++++\n> >  8 files changed, 146 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h\n> > index 78ba3969913d..164743f7e9f6 100644\n> > --- a/include/libcamera/internal/bayer_format.h\n> > +++ b/include/libcamera/internal/bayer_format.h\n> > @@ -34,6 +34,8 @@ public:\n> >               None = 0,\n> >               CSI2 = 1,\n> >               IPU3 = 2,\n> > +             PISP1 = 3,\n> > +             PISP2 = 4,\n> >       };\n> >\n> >       constexpr BayerFormat()\n> > diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h\n> > index 4ee421b95730..322563763cbc 100644\n> > --- a/include/linux/drm_fourcc.h\n> > +++ b/include/linux/drm_fourcc.h\n> > @@ -490,6 +490,7 @@ extern \"C\" {\n> >  #define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09\n> >  #define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a\n> >  #define DRM_FORMAT_MOD_VENDOR_MIPI 0x0b\n> > +#define DRM_FORMAT_MOD_VENDOR_RPI 0x0c\n> >\n> >  /* add more to the end as needed */\n> >\n> > @@ -1670,6 +1671,10 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)\n> >   */\n> >  #define MIPI_FORMAT_MOD_CSI2_PACKED fourcc_mod_code(MIPI, 1)\n> >\n> > +#define PISP_FORMAT_MOD_COMPRESS_MODE1 fourcc_mod_code(RPI, 1)\n> > +#define PISP_FORMAT_MOD_COMPRESS_MODE2 fourcc_mod_code(RPI, 2)\n> > +#define PISP_FORMAT_MOD_VERIFICATION fourcc_mod_code(RPI, 3)\n> > +\n>\n> Ideally, this should have been resolved upstream\n> https://www.spinics.net/lists/dri-devel/msg435203.html\n>\n> but this hasn't progressed much, as we got stuck at\n> https://www.spinics.net/lists/dri-devel/msg435537.html\n>\n> as we would need to uptream the DRM Bayer format first, but not in the\n> form they are today.\n>\n> So I guess is fine keeping this downstream for the moment ?\n>\n> >  #if defined(__cplusplus)\n> >  }\n> >  #endif\n> > diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\n> > index ba48d2c89726..226665b59d58 100644\n> > --- a/include/linux/videodev2.h\n> > +++ b/include/linux/videodev2.h\n> > @@ -789,6 +789,18 @@ struct v4l2_pix_format {\n> >  #define V4L2_PIX_FMT_IPU3_SGRBG10    v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */\n> >  #define V4L2_PIX_FMT_IPU3_SRGGB10    v4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */\n> >\n> > +/* Raspberry Pi PiSP compressed formats. */\n> > +#define V4L2_PIX_FMT_PISP_COMP1_RGGB v4l2_fourcc('P', 'C', '1', 'R') /* PiSP 8-bit mode 1 compressed RGGB bayer */\n> > +#define V4L2_PIX_FMT_PISP_COMP1_GRBG v4l2_fourcc('P', 'C', '1', 'G') /* PiSP 8-bit mode 1 compressed GRBG bayer */\n> > +#define V4L2_PIX_FMT_PISP_COMP1_GBRG v4l2_fourcc('P', 'C', '1', 'g') /* PiSP 8-bit mode 1 compressed GBRG bayer */\n> > +#define V4L2_PIX_FMT_PISP_COMP1_BGGR v4l2_fourcc('P', 'C', '1', 'B') /* PiSP 8-bit mode 1 compressed BGGR bayer */\n> > +#define V4L2_PIX_FMT_PISP_COMP1_MONO v4l2_fourcc('P', 'C', '1', 'M') /* PiSP 8-bit mode 1 compressed monochrome */\n> > +#define V4L2_PIX_FMT_PISP_COMP2_RGGB v4l2_fourcc('P', 'C', '2', 'R') /* PiSP 8-bit mode 2 compressed RGGB bayer */\n> > +#define V4L2_PIX_FMT_PISP_COMP2_GRBG v4l2_fourcc('P', 'C', '2', 'G') /* PiSP 8-bit mode 2 compressed GRBG bayer */\n> > +#define V4L2_PIX_FMT_PISP_COMP2_GBRG v4l2_fourcc('P', 'C', '2', 'g') /* PiSP 8-bit mode 2 compressed GBRG bayer */\n> > +#define V4L2_PIX_FMT_PISP_COMP2_BGGR v4l2_fourcc('P', 'C', '2', 'B') /* PiSP 8-bit mode 2 compressed BGGR bayer */\n> > +#define V4L2_PIX_FMT_PISP_COMP2_MONO v4l2_fourcc('P', 'C', '2', 'M') /* PiSP 8-bit mode 2 compressed monochrome */\n> > +\n>\n> Ack\n>\n> >  /* SDR formats - used only for Software Defined Radio devices */\n> >  #define V4L2_SDR_FMT_CU8          v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */\n> >  #define V4L2_SDR_FMT_CU16LE       v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */\n> > @@ -818,6 +830,15 @@ struct v4l2_pix_format {\n> >  #define V4L2_META_FMT_RK_ISP1_PARAMS v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */\n> >  #define V4L2_META_FMT_RK_ISP1_STAT_3A        v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */\n> >\n> > +/* The metadata format identifier for BE configuration buffers. */\n> > +#define V4L2_META_FMT_RPI_BE_CFG v4l2_fourcc('R', 'P', 'B', 'C')\n> > +\n> > +/* The metadata format identifier for FE configuration buffers. */\n> > +#define V4L2_META_FMT_RPI_FE_CFG v4l2_fourcc('R', 'P', 'F', 'C')\n> > +\n> > +/* The metadata format identifier for FE stats buffers. */\n> > +#define V4L2_META_FMT_RPI_FE_STATS v4l2_fourcc('R', 'P', 'F', 'S')\n> > +\n>\n> The comments and ordering might end up being different as BE and FE\n> are being upstreamed separately. I guess it's fine!\n>\n> >  /* priv field value to indicates that subsequent fields are valid. */\n> >  #define V4L2_PIX_FMT_PRIV_MAGIC              0xfeedcafe\n> >\n> > diff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp\n> > index 20aedfa6d925..ed6f7d62a7a3 100644\n> > --- a/src/libcamera/bayer_format.cpp\n> > +++ b/src/libcamera/bayer_format.cpp\n> > @@ -164,6 +164,14 @@ const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{\n> >               { formats::SGRBG16, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16) } },\n> >       { { BayerFormat::RGGB, 16, BayerFormat::Packing::None },\n> >               { formats::SRGGB16, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16) } },\n> > +     { { BayerFormat::BGGR, 16, BayerFormat::Packing::PISP1 },\n> > +             { formats::BGGR_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_BGGR) } },\n> > +     { { BayerFormat::GBRG, 16, BayerFormat::Packing::PISP1 },\n> > +             { formats::GBRG_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GBRG) } },\n> > +     { { BayerFormat::GRBG, 16, BayerFormat::Packing::PISP1 },\n> > +             { formats::GRBG_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GRBG) } },\n> > +     { { BayerFormat::RGGB, 16, BayerFormat::Packing::PISP1 },\n> > +             { formats::RGGB_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_RGGB) } },\n> >       { { BayerFormat::MONO, 8, BayerFormat::Packing::None },\n> >               { formats::R8, V4L2PixelFormat(V4L2_PIX_FMT_GREY) } },\n> >       { { BayerFormat::MONO, 10, BayerFormat::Packing::None },\n> > @@ -174,6 +182,8 @@ const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{\n> >               { formats::R12, V4L2PixelFormat(V4L2_PIX_FMT_Y12) } },\n> >       { { BayerFormat::MONO, 16, BayerFormat::Packing::None },\n> >               { formats::R16, V4L2PixelFormat(V4L2_PIX_FMT_Y16) } },\n> > +     { { BayerFormat::MONO, 16, BayerFormat::Packing::PISP1 },\n> > +             { formats::MONO_PISP_COMP1, V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_MONO) } },\n> >  };\n> >\n> >  const std::unordered_map<unsigned int, BayerFormat> mbusCodeToBayer{\n> > @@ -303,6 +313,10 @@ std::ostream &operator<<(std::ostream &out, const BayerFormat &f)\n> >               out << \"-CSI2P\";\n> >       else if (f.packing == BayerFormat::Packing::IPU3)\n> >               out << \"-IPU3P\";\n> > +     else if (f.packing == BayerFormat::Packing::PISP1)\n> > +             out << \"-PISP1\";\n> > +     else if (f.packing == BayerFormat::Packing::PISP2)\n> > +             out << \"-PISP2\";\n> >\n> >       return out;\n> >  }\n> > diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> > index 21a7719e84c4..855c5f98d378 100644\n> > --- a/src/libcamera/formats.cpp\n> > +++ b/src/libcamera/formats.cpp\n> > @@ -547,6 +547,16 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n> >               .pixelsPerGroup = 1,\n> >               .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n> >       } },\n> > +     { formats::MONO_PISP_COMP1, {\n> > +             .name = \"MONO_PISP_COMP1\",\n> > +             .format = formats::MONO_PISP_COMP1,\n> > +             .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_MONO), },\n> > +             .bitsPerPixel = 8,\n> > +             .colourEncoding = PixelFormatInfo::ColourEncodingYUV,\n> > +             .packed = true,\n> > +             .pixelsPerGroup = 1,\n> > +             .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n>\n> Being this 1 byte per pixel and 1 pixel per group , shouldn't this be { 1, 1} ?\n\nAck, will fix for next version.\n\n>\n> > +     } },\n> >\n> >       /* Bayer formats. */\n> >       { formats::SBGGR8, {\n> > @@ -910,7 +920,46 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n> >               .pixelsPerGroup = 25,\n> >               .planes = {{ { 32, 1 }, { 0, 0 }, { 0, 0 } }},\n> >       } },\n> > -\n> > +     { formats::BGGR_PISP_COMP1, {\n> > +             .name = \"BGGR_PISP_COMP1\",\n> > +             .format = formats::BGGR_PISP_COMP1,\n> > +             .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_BGGR), },\n> > +             .bitsPerPixel = 8,\n> > +             .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> > +             .packed = true,\n> > +             .pixelsPerGroup = 2,\n> > +             .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n> > +     } },\n> > +     { formats::GBRG_PISP_COMP1, {\n> > +             .name = \"GBRG_PISP_COMP1\",\n> > +             .format = formats::GBRG_PISP_COMP1,\n> > +             .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GBRG), },\n> > +             .bitsPerPixel = 8,\n> > +             .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> > +             .packed = true,\n> > +             .pixelsPerGroup = 2,\n> > +             .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n> > +     } },\n> > +     { formats::GRBG_PISP_COMP1, {\n> > +             .name = \"GRBG_PISP_COMP1\",\n> > +             .format = formats::GRBG_PISP_COMP1,\n> > +             .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GRBG), },\n> > +             .bitsPerPixel = 8,\n> > +             .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> > +             .packed = true,\n> > +             .pixelsPerGroup = 2,\n> > +             .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n> > +     } },\n> > +     { formats::RGGB_PISP_COMP1, {\n> > +             .name = \"RGGB_PISP_COMP1\",\n> > +             .format = formats::RGGB_PISP_COMP1,\n> > +             .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_RGGB), },\n> > +             .bitsPerPixel = 8,\n> > +             .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> > +             .packed = true,\n> > +             .pixelsPerGroup = 2,\n> > +             .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},\n> > +     } },\n>\n> Ack!\n>\n> >       /* Compressed formats. */\n> >       { formats::MJPEG, {\n> >               .name = \"MJPEG\",\n> > diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> > index bde2cc803b98..fe027a7cce70 100644\n> > --- a/src/libcamera/formats.yaml\n> > +++ b/src/libcamera/formats.yaml\n> > @@ -190,4 +190,20 @@ formats:\n> >    - SBGGR10_IPU3:\n> >        fourcc: DRM_FORMAT_SBGGR10\n> >        mod: IPU3_FORMAT_MOD_PACKED\n> > +\n> > +  - RGGB_PISP_COMP1:\n> > +      fourcc: DRM_FORMAT_SRGGB16\n> > +      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n> > +  - GRBG_PISP_COMP1:\n> > +      fourcc: DRM_FORMAT_SGRBG16\n> > +      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n> > +  - GBRG_PISP_COMP1:\n> > +      fourcc: DRM_FORMAT_SGBRG16\n> > +      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n> > +  - BGGR_PISP_COMP1:\n> > +      fourcc: DRM_FORMAT_SBGGR16\n> > +      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n> > +  - MONO_PISP_COMP1:\n> > +      fourcc: DRM_FORMAT_R16\n> > +      mod: PISP_FORMAT_MOD_COMPRESS_MODE1\n> >  ...\n> > diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\n> > index efb6f2940235..977ae5834017 100644\n> > --- a/src/libcamera/v4l2_pixelformat.cpp\n> > +++ b/src/libcamera/v4l2_pixelformat.cpp\n> > @@ -207,6 +207,16 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{\n> >               { formats::SGRBG16, \"16-bit Bayer GRGR/BGBG\" } },\n> >       { V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16),\n> >               { formats::SRGGB16, \"16-bit Bayer RGRG/GBGB\" } },\n> > +     { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_BGGR),\n> > +             { formats::BGGR_PISP_COMP1, \"16-bit Bayer BGBG/GRGR PiSP Compress Mode 1\" } },\n> > +     { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GBRG),\n> > +             { formats::GBRG_PISP_COMP1, \"16-bit Bayer GBGB/RGRG PiSP Compress Mode 1\" } },\n> > +     { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_GRBG),\n> > +             { formats::GRBG_PISP_COMP1, \"16-bit Bayer GRGR/BGBG PiSP Compress Mode 1\" } },\n> > +     { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_RGGB),\n> > +             { formats::RGGB_PISP_COMP1, \"16-bit Bayer RGRG/GBGB PiSP Compress Mode 1\" } },\n> > +     { V4L2PixelFormat(V4L2_PIX_FMT_PISP_COMP1_MONO),\n> > +             { formats::MONO_PISP_COMP1, \"16-bit Mono PiSP Compress Mode 1\" } },\n> >\n> >       /* Compressed formats. */\n> >       { V4L2PixelFormat(V4L2_PIX_FMT_MJPEG),\n> > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> > index 1076b7006b0b..60852efee6b4 100644\n> > --- a/src/libcamera/v4l2_subdevice.cpp\n> > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > @@ -651,6 +651,34 @@ const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{\n> >               .bitsPerPixel = 14,\n> >               .colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> >       } },\n> > +     { MEDIA_BUS_FMT_SBGGR16_1X16, {\n> > +             .name = \"SBGGR16_1x16\",\n>\n> It seems to me the other format names use capital 'X'\n\nAck.\n\n>\n> > +             .code = MEDIA_BUS_FMT_SBGGR16_1X16,\n> > +             .type = MediaBusFormatInfo::Type::Image,\n> > +             .bitsPerPixel = 16,\n> > +             .colourEncoding = PixelFormatInfo::ColourEncodingRAW\n> > +     } },\n> > +     { MEDIA_BUS_FMT_SGBRG16_1X16, {\n> > +             .name = \"SGBRG16_1x16\",\n> > +             .code = MEDIA_BUS_FMT_SGBRG16_1X16,\n> > +             .type = MediaBusFormatInfo::Type::Image,\n> > +             .bitsPerPixel = 16,\n> > +             .colourEncoding = PixelFormatInfo::ColourEncodingRAW\n> > +     } },\n> > +     { MEDIA_BUS_FMT_SGRBG16_1X16, {\n> > +             .name = \"SGRBG16_1x16\",\n> > +             .code = MEDIA_BUS_FMT_SGRBG16_1X16,\n> > +             .type = MediaBusFormatInfo::Type::Image,\n> > +             .bitsPerPixel = 16,\n> > +             .colourEncoding = PixelFormatInfo::ColourEncodingRAW\n> > +     } },\n> > +     { MEDIA_BUS_FMT_SRGGB16_1X16, {\n> > +             .name = \"SRGGB16_1x16\",\n> > +             .code = MEDIA_BUS_FMT_SRGGB16_1X16,\n> > +             .type = MediaBusFormatInfo::Type::Image,\n> > +             .bitsPerPixel = 16,\n> > +             .colourEncoding = PixelFormatInfo::ColourEncodingRAW\n> > +     } },\n>\n> These are unrelated to the PiSP formats, right ? (just for my\n> understanding). I think it's anyway good to have them here (if\n> unrelared, possibily in a separate patch ?)\n\nCorrect, they are unrelated.  I'll move them to a separate patch.\n\n>\n> Nit on the here above formats name ('x' vs 'X') apart, the rest looks\n> good\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>\n> Thanks\n>   j\n>\n> >       /* \\todo Clarify colour encoding for HSV formats */\n> >       { MEDIA_BUS_FMT_AHSV8888_1X32, {\n> >               .name = \"AHSV8888_1X32\",\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 6B8E5BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 May 2024 12:42:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3CE0163418;\n\tThu,  2 May 2024 14:42:55 +0200 (CEST)","from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com\n\t[IPv6:2607:f8b0:4864:20::b33])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ECB37633EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 May 2024 14:42:53 +0200 (CEST)","by mail-yb1-xb33.google.com with SMTP id\n\t3f1490d57ef6-de8b683f76cso712338276.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 02 May 2024 05:42:53 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"H+UX5W5f\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1714653773; x=1715258573;\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=quzm3n5Z3ReufnRxmyUIpILbGjPQ0WBiYjLvEy3k2QA=;\n\tb=H+UX5W5fm0Rq+lHBTwRmJhhGDteST/BXdQu1I9rxpv+0F921g+qEgq/k1VL659/0jq\n\t3fcRF5DtOjtQcunvxJhzu+SMmTGdIFkVTbxaRe3nzSDVRztZfMpG8FssEeUwbyPSopUq\n\thEIggzOGeBrpTIT/MSYwiJxwDH0tzk1wJqHdvEDmSKahOi8Nxv4mUpl+9mZvJroUqPAw\n\tzi15MhEIQCYY7O82DDIyM5XnDclbHvElRxV7lnD1/ADq+u5e987mq0Dku+Jyc9L1rNun\n\t5MqPEnUkThgc72C9H7usFEcAE42GL1uhIjWSW0sHKMB55tUqWoan3993boKfsJCxyRbW\n\t5O+Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1714653773; x=1715258573;\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=quzm3n5Z3ReufnRxmyUIpILbGjPQ0WBiYjLvEy3k2QA=;\n\tb=ggBkpPRZ1ed9UEAFkYyuZK1m0JVCwCAvRdZZ9bBMITpPL7q45+9PWKM2tinSxN2oOV\n\tMOLoT1PI/VPZQhnVCt1Z0GgKwV3edfo/k5LG9gishROhh4fRNcFFyVVFhLQ31wZFcqO3\n\tmn7iRc3Yb8b4zqPsQbzzT96vYoPN+4T+tY7j+MiY/MGkNqFsimNyxjuObE48fTT7S4OC\n\tvFbgkTVSbUTavXTeTem88xBLQrz6hA1oUOppyqxCiDRWvBvcKl90uoLdsIS9LJ06SX0D\n\tQO4jaU1iIz23rX3ZFnf2kYfIxKTQEDkuwTKyyK3d7Wj3hDR3GrKgOUeLtOESxFiqxPhk\n\tM3Rg==","X-Gm-Message-State":"AOJu0YwpIm9V9iGqpB7Ksjof8gnlVlMXHAU9fYLVxD3wh3xF6ehgkmzv\n\tM9uY4f2YoVFWrI18dASjuxHWaOqYkgpBMxsm5EOsfyNXqdR1pmhn974IRbnUDz6xGoqwbdq/lj/\n\toTNp+EyQaiCc6rGT78HM3ZD1lRgZN6vKgJxIYDw==","X-Google-Smtp-Source":"AGHT+IHmDkFtfvbGG59IejNediET4F9ircQ7BO8oT1Q1Ewmfo9/5gwSZ8+YVOP1mjxOW2IPjZ6EOGo4MyuHmQzYtNOE=","X-Received":"by 2002:a5b:45:0:b0:de5:59cd:9b04 with SMTP id\n\te5-20020a5b0045000000b00de559cd9b04mr1694592ybp.13.1714653772390; \n\tThu, 02 May 2024 05:42:52 -0700 (PDT)","MIME-Version":"1.0","References":"<20240502080925.31730-1-naush@raspberrypi.com>\n\t<20240502080925.31730-3-naush@raspberrypi.com>\n\t<owdtnqo5l3mtbiwi2lsqgflvjsjixwp6nqejoy6y2rkpint634@qla5afmcwsum>","In-Reply-To":"<owdtnqo5l3mtbiwi2lsqgflvjsjixwp6nqejoy6y2rkpint634@qla5afmcwsum>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Thu, 2 May 2024 13:42:16 +0100","Message-ID":"<CAEmqJPpoV+MAvYhUwVF5mkFtVS=tTn83rWjUNqyuSPuVMPyiDQ@mail.gmail.com>","Subject":"Re: [PATCH v1 2/5] libcamera: formats: Add PiSP specific image and\n\tconfig buffer formats","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tDavid Plowman <david.plowman@raspberrypi.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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]