<div dir="ltr"><div>Hi Paul,</div><div><br></div><div>Ok, will do that. <br></div><div><br></div><div>Regards,</div><div>Vedant Paranjape<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 22, 2021 at 9:56 AM <<a href="mailto:paul.elder@ideasonboard.com">paul.elder@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">Hi Vedant,<br>
<br>
On Sat, Jun 19, 2021 at 01:32:46AM +0530, Vedant Paranjape wrote:<br>
> Fixed the mismatch of V4L2 and Libcamera pixelformats.<br>
> <br>
> Matched V4L2_PIX_FMT_XRGB32 with formats::BGRX8888. Additionally, fixes<br>
> mapping of V4L2_PIX_FMT_RGBX32 to formats::XBGR8888 in formats.cpp<br>
<br>
The points that you did in this series are:<br>
- add the BGRX8888 format<br>
- fix the mapping of XRGB32 to BGRX8888<br>
- fix the mapping of RGBX32 to XBGR8888<br>
<br>
The last two you mention, but I think you should mention the first as<br>
well.<br>
<br>
> <br>
> Signed-off-by: Vedant Paranjape <<a href="mailto:vedantparanjape160201@gmail.com" target="_blank">vedantparanjape160201@gmail.com</a>><br>
> ---<br>
>  src/libcamera/formats.cpp          | 12 +++++++++++-<br>
>  src/libcamera/v4l2_pixelformat.cpp |  2 +-<br>
>  2 files changed, 12 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp<br>
> index 55822f4c..e41bfc05 100644<br>
> --- a/src/libcamera/formats.cpp<br>
> +++ b/src/libcamera/formats.cpp<br>
> @@ -198,13 +198,23 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{<br>
>       { formats::XBGR8888, {<br>
>               .name = "XBGR8888",<br>
>               .format = formats::XBGR8888,<br>
> -             .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),<br>
> +             .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),<br>
>               .bitsPerPixel = 32,<br>
>               .colourEncoding = PixelFormatInfo::ColourEncodingRGB,<br>
>               .packed = false,<br>
>               .pixelsPerGroup = 1,<br>
>               .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},<br>
>       } },<br>
> +     { formats::BGRX8888, {<br>
> +             .name = "BGRX8888",<br>
> +             .format = formats::BGRX8888,<br>
> +             .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),<br>
<br>
Hm, maybe this is too intertwined. Here you add BGRX8888 = XRGB32, which<br>
means that you have to fix the mapping above to RGBX32, but the<br>
corresponding mapping in the v4l2 pixel format map is only added later<br>
in 2/2.<br>
<br>
I think it's okay to squash 2/2 into this.<br>
<br>
<br>
Paul<br>
<br>
> +             .bitsPerPixel = 32,<br>
> +             .colourEncoding = PixelFormatInfo::ColourEncodingRGB,<br>
> +             .packed = false,<br>
> +             .pixelsPerGroup = 1,<br>
> +             .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},<br>
> +     } },    <br>
>       { formats::ABGR8888, {<br>
>               .name = "ABGR8888",<br>
>               .format = formats::ABGR8888,<br>
> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp<br>
> index 166d93cf..950cbda4 100644<br>
> --- a/src/libcamera/v4l2_pixelformat.cpp<br>
> +++ b/src/libcamera/v4l2_pixelformat.cpp<br>
> @@ -51,7 +51,7 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{<br>
>       { V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 },<br>
>       { V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 },<br>
>       { V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), formats::XRGB8888 },<br>
> -     { V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::XBGR8888 },<br>
> +     { V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::BGRX8888 },<br>
>       { V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 },<br>
>       { V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), formats::ARGB8888 },<br>
>       { V4L2PixelFormat(V4L2_PIX_FMT_ARGB32), formats::BGRA8888 },<br>
> -- <br>
> 2.25.1<br>
> <br>
</blockquote></div>