<div dir="ltr"><div dir="ltr">Hi Kieran,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 28 Oct 2021 at 13:15, Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com">kieran.bingham@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Quoting Naushir Patuck (2021-10-28 09:46:39)<br>
> This new formats corresponds to the V4L2 V4L2_PIX_FMT_Y10P format, and is a<br>
> CSI2-packed version of the DRM_FORMAT_R10 format.<br>
> <br>
<br>
Relating to your question in the cover letter, I think it's better to<br>
keep this separate.<br>
<br>
> Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
> ---<br>
> src/libcamera/formats.cpp | 13 +++++++++++++<br>
>Â src/libcamera/formats.yaml |Â 4 ++++<br>
>Â 2 files changed, 17 insertions(+)<br>
> <br>
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp<br>
> index d4781dfb3874..9b6ccdca0663 100644<br>
> --- a/src/libcamera/formats.cpp<br>
> +++ b/src/libcamera/formats.cpp<br>
> @@ -510,6 +510,19 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{<br>
>Â Â Â Â Â Â Â Â Â .pixelsPerGroup = 1,<br>
>Â Â Â Â Â Â Â Â Â .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},<br>
>Â Â Â Â Â } },<br>
> +Â Â Â Â { formats::R10_CSI2P, {<br>
> +Â Â Â Â Â Â Â Â .name = "R10_CSI2P",<br>
> +Â Â Â Â Â Â Â Â .format = formats::R10,<br>
> +Â Â Â Â Â Â Â Â .v4l2Formats = {<br>
> +Â Â Â Â Â Â Â Â Â Â Â Â .single = V4L2PixelFormat(V4L2_PIX_FMT_Y10P),<br>
> +Â Â Â Â Â Â Â Â Â Â Â Â .multi = V4L2PixelFormat(),<br>
> +Â Â Â Â Â Â Â Â },<br>
> +Â Â Â Â Â Â Â Â .bitsPerPixel = 10,<br>
> +Â Â Â Â Â Â Â Â .colourEncoding = PixelFormatInfo::ColourEncodingYUV,<br>
> +Â Â Â Â Â Â Â Â .packed = true,<br>
> +Â Â Â Â Â Â Â Â .pixelsPerGroup = 1,<br>
<br>
Is this correct for a packed format?<br>
<br>
Shouldn't this be pixelsPerGroup = 4; bytesPerGroup = 5; ?<br>
<br>
<a href="https://01.org/linuxgraphics/gfx-docs/drm/media/uapi/v4l/pixfmt-y10p.html" rel="noreferrer" target="_blank">https://01.org/linuxgraphics/gfx-docs/drm/media/uapi/v4l/pixfmt-y10p.html</a><br>
states:<br>
<br>
"""<br>
This is a packed grey-scale image format with a depth of 10 bits per<br>
pixel. Every four consecutive pixels are packed into 5 bytes. Each of<br>
the first 4 bytes contain the 8 high order bits of the pixels, and the<br>
5th byte contains the 2 least significants bits of each pixel, in the<br>
same order.<br>
"""<br>
<br>
<br>
<br>
> +Â Â Â Â Â Â Â Â .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},<br>
<br>
And therefore I'd expect this to be { 5, 1 }, instead of { 2, 1 } ...<br></blockquote><div><br></div><div>Ugh, good catch! That was a copy-paste error on my part. I meant to update</div><div>the planes but forgot :-(</div><div><br></div><div>Naush</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> +Â Â Â Â } },<br>
>Â <br>
>Â Â Â Â Â /* Bayer formats. */<br>
>Â Â Â Â Â { formats::SBGGR8, {<br>
> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml<br>
> index 22a8e473a183..1f3f043302c3 100644<br>
> --- a/src/libcamera/formats.yaml<br>
> +++ b/src/libcamera/formats.yaml<br>
> @@ -109,6 +109,10 @@ formats:<br>
>Â Â - SBGGR16:<br>
>Â Â Â Â fourcc: DRM_FORMAT_SBGGR16<br>
>Â <br>
> +Â - R10_CSI2P:<br>
> +Â Â Â fourcc: DRM_FORMAT_R10<br>
> +Â Â Â mod: MIPI_FORMAT_MOD_CSI2_PACKED<br>
> +<br>
>Â Â - SRGGB10_CSI2P:<br>
>Â Â Â Â fourcc: DRM_FORMAT_SRGGB10<br>
>Â Â Â Â mod: MIPI_FORMAT_MOD_CSI2_PACKED<br>
> -- <br>
> 2.25.1<br>
><br>
</blockquote></div></div>