[libcamera-devel,v1,1/2] Fixes: libcamera: Fix the V4L2 pixel format for formats::XBGR8888
diff mbox series

Message ID 20210702120850.457492-1-vedantparanjape160201@gmail.com
State Superseded
Headers show
Series
  • [libcamera-devel,v1,1/2] Fixes: libcamera: Fix the V4L2 pixel format for formats::XBGR8888
Related show

Commit Message

Vedant Paranjape July 2, 2021, 12:08 p.m. UTC
This patch fixes V4L2 pixel format for formats::XBGR8888 by updating
the existing matching to V4L2_PIX_FMT_RGBX32

Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
---
 src/libcamera/formats.cpp          | 2 +-
 src/libcamera/v4l2_pixelformat.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Paul Elder July 6, 2021, 10:03 a.m. UTC | #1
Hi Vedant,

"Fixes: " doesn't go in the subject.

I sent you this as an example :/

https://git.linuxtv.org/libcamera.git/commit/?id=1684c3f930b2a27884037bc38856477b80cddd50

On Fri, Jul 02, 2021 at 05:38:49PM +0530, Vedant Paranjape wrote:
> This patch fixes V4L2 pixel format for formats::XBGR8888 by updating
> the existing matching to V4L2_PIX_FMT_RGBX32
> 

$ git blame src/libcamera/formats.cpp | grep XRGB32
4fd6bb332 (Niklas Sölund 2020-09-30 16:10:07 +0200 201) .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),
$ git show 4fd6bb332 --oneline | head -n 1
4fd6bb33 libcamera: Add support for XRGB8888 and XBGR8888

So right here,

Fixes: 4fd6bb33 ("libcamera: Add support for XRGB8888 and XBGR8888")

> Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>

Other than that, looks good.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/libcamera/formats.cpp          | 2 +-
>  src/libcamera/v4l2_pixelformat.cpp | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> index 59a34853..578ac4af 100644
> --- a/src/libcamera/formats.cpp
> +++ b/src/libcamera/formats.cpp
> @@ -198,7 +198,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
>  	{ formats::XBGR8888, {
>  		.name = "XBGR8888",
>  		.format = formats::XBGR8888,
> -		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),
> +		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),
>  		.bitsPerPixel = 32,
>  		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
>  		.packed = false,
> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
> index 87d728fe..59a01e02 100644
> --- a/src/libcamera/v4l2_pixelformat.cpp
> +++ b/src/libcamera/v4l2_pixelformat.cpp
> @@ -52,7 +52,7 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), formats::XRGB8888 },
> -	{ V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::XBGR8888 },
> +	{ V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), formats::XBGR8888 },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), formats::ARGB8888 },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_ARGB32), formats::BGRA8888 },
> -- 
> 2.25.1
>
Laurent Pinchart July 13, 2021, 1:10 a.m. UTC | #2
Hi Vedant,

Thank you for the patch.

On Tue, Jul 06, 2021 at 07:03:46PM +0900, paul.elder@ideasonboard.com wrote:
> Hi Vedant,
> 
> "Fixes: " doesn't go in the subject.
> 
> I sent you this as an example :/
> 
> https://git.linuxtv.org/libcamera.git/commit/?id=1684c3f930b2a27884037bc38856477b80cddd50
> 
> On Fri, Jul 02, 2021 at 05:38:49PM +0530, Vedant Paranjape wrote:
> > This patch fixes V4L2 pixel format for formats::XBGR8888 by updating
> > the existing matching to V4L2_PIX_FMT_RGBX32
> 
> $ git blame src/libcamera/formats.cpp | grep XRGB32
> 4fd6bb332 (Niklas Sölund 2020-09-30 16:10:07 +0200 201) .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),
> $ git show 4fd6bb332 --oneline | head -n 1
> 4fd6bb33 libcamera: Add support for XRGB8888 and XBGR8888

Tip: Add the following to you ~/.gitconfig

[pretty]
	fixes = Fixes: %h (\"%s\")

which can also be done with

git config --global --add pretty.fixes 'Fixes: %h ("%s")'

You can then run

git show --pretty=fixes -s 4fd6bb332

With a bit more shell scripting, adding

gpf() {
	git show --pretty=fixes -s ${1:-HEAD} | xclip -selection clipboard
}

to your .bashrc, you can then type

gpf 4fd6bb332

and you'll get the Fixes: line in your clipboard, ready to be pasted.

> So right here,
> 
> Fixes: 4fd6bb33 ("libcamera: Add support for XRGB8888 and XBGR8888")
> 
> > Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
> 
> Other than that, looks good.
> 
> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

With the above fixed,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > ---
> >  src/libcamera/formats.cpp          | 2 +-
> >  src/libcamera/v4l2_pixelformat.cpp | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> > index 59a34853..578ac4af 100644
> > --- a/src/libcamera/formats.cpp
> > +++ b/src/libcamera/formats.cpp
> > @@ -198,7 +198,7 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
> >  	{ formats::XBGR8888, {
> >  		.name = "XBGR8888",
> >  		.format = formats::XBGR8888,
> > -		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),
> > +		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),
> >  		.bitsPerPixel = 32,
> >  		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> >  		.packed = false,
> > diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
> > index 87d728fe..59a01e02 100644
> > --- a/src/libcamera/v4l2_pixelformat.cpp
> > +++ b/src/libcamera/v4l2_pixelformat.cpp
> > @@ -52,7 +52,7 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
> >  	{ V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 },
> >  	{ V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 },
> >  	{ V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), formats::XRGB8888 },
> > -	{ V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::XBGR8888 },
> > +	{ V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), formats::XBGR8888 },
> >  	{ V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 },
> >  	{ V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), formats::ARGB8888 },
> >  	{ V4L2PixelFormat(V4L2_PIX_FMT_ARGB32), formats::BGRA8888 },
Vedant Paranjape July 13, 2021, 5:28 a.m. UTC | #3
Awesome, thanks!

On Tue, 13 Jul, 2021, 06:41 Laurent Pinchart, <
laurent.pinchart@ideasonboard.com> wrote:

> Hi Vedant,
>
> Thank you for the patch.
>
> On Tue, Jul 06, 2021 at 07:03:46PM +0900, paul.elder@ideasonboard.com
> wrote:
> > Hi Vedant,
> >
> > "Fixes: " doesn't go in the subject.
> >
> > I sent you this as an example :/
> >
> >
> https://git.linuxtv.org/libcamera.git/commit/?id=1684c3f930b2a27884037bc38856477b80cddd50
> >
> > On Fri, Jul 02, 2021 at 05:38:49PM +0530, Vedant Paranjape wrote:
> > > This patch fixes V4L2 pixel format for formats::XBGR8888 by updating
> > > the existing matching to V4L2_PIX_FMT_RGBX32
> >
> > $ git blame src/libcamera/formats.cpp | grep XRGB32
> > 4fd6bb332 (Niklas Sölund 2020-09-30 16:10:07 +0200 201) .v4l2Format =
> V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),
> > $ git show 4fd6bb332 --oneline | head -n 1
> > 4fd6bb33 libcamera: Add support for XRGB8888 and XBGR8888
>
> Tip: Add the following to you ~/.gitconfig
>
> [pretty]
>         fixes = Fixes: %h (\"%s\")
>
> which can also be done with
>
> git config --global --add pretty.fixes 'Fixes: %h ("%s")'
>
> You can then run
>
> git show --pretty=fixes -s 4fd6bb332
>
> With a bit more shell scripting, adding
>
> gpf() {
>         git show --pretty=fixes -s ${1:-HEAD} | xclip -selection clipboard
> }
>
> to your .bashrc, you can then type
>
> gpf 4fd6bb332
>
> and you'll get the Fixes: line in your clipboard, ready to be pasted.
>
> > So right here,
> >
> > Fixes: 4fd6bb33 ("libcamera: Add support for XRGB8888 and XBGR8888")
> >
> > > Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
> >
> > Other than that, looks good.
> >
> > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
>
> With the above fixed,
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> > > ---
> > >  src/libcamera/formats.cpp          | 2 +-
> > >  src/libcamera/v4l2_pixelformat.cpp | 2 +-
> > >  2 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> > > index 59a34853..578ac4af 100644
> > > --- a/src/libcamera/formats.cpp
> > > +++ b/src/libcamera/formats.cpp
> > > @@ -198,7 +198,7 @@ const std::map<PixelFormat, PixelFormatInfo>
> pixelFormatInfo{
> > >     { formats::XBGR8888, {
> > >             .name = "XBGR8888",
> > >             .format = formats::XBGR8888,
> > > -           .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),
> > > +           .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),
> > >             .bitsPerPixel = 32,
> > >             .colourEncoding = PixelFormatInfo::ColourEncodingRGB,
> > >             .packed = false,
> > > diff --git a/src/libcamera/v4l2_pixelformat.cpp
> b/src/libcamera/v4l2_pixelformat.cpp
> > > index 87d728fe..59a01e02 100644
> > > --- a/src/libcamera/v4l2_pixelformat.cpp
> > > +++ b/src/libcamera/v4l2_pixelformat.cpp
> > > @@ -52,7 +52,7 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
> > >     { V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 },
> > >     { V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 },
> > >     { V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), formats::XRGB8888 },
> > > -   { V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::XBGR8888 },
> > > +   { V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), formats::XBGR8888 },
> > >     { V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 },
> > >     { V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), formats::ARGB8888 },
> > >     { V4L2PixelFormat(V4L2_PIX_FMT_ARGB32), formats::BGRA8888 },
>
> --
> Regards,
>
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index 59a34853..578ac4af 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -198,7 +198,7 @@  const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
 	{ formats::XBGR8888, {
 		.name = "XBGR8888",
 		.format = formats::XBGR8888,
-		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),
+		.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),
 		.bitsPerPixel = 32,
 		.colourEncoding = PixelFormatInfo::ColourEncodingRGB,
 		.packed = false,
diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
index 87d728fe..59a01e02 100644
--- a/src/libcamera/v4l2_pixelformat.cpp
+++ b/src/libcamera/v4l2_pixelformat.cpp
@@ -52,7 +52,7 @@  const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
 	{ V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), formats::XRGB8888 },
-	{ V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::XBGR8888 },
+	{ V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), formats::XBGR8888 },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), formats::ARGB8888 },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_ARGB32), formats::BGRA8888 },