[libcamera-devel] libcamera: v4l2_pixelformat: Fix V4L2_PIX_FMT_SBGGR10P format

Message ID 20200430140149.785-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 81ac45ba6855f5a4a9a71bbda615770c1b2046b5
Headers show
Series
  • [libcamera-devel] libcamera: v4l2_pixelformat: Fix V4L2_PIX_FMT_SBGGR10P format
Related show

Commit Message

Laurent Pinchart April 30, 2020, 2:01 p.m. UTC
The V4L2_PIX_FMT_SBGGR10P format was misspecified as
V4L2_PIX_FMT_SBGGR10. Fix it.

Fixes: 00d639d951e7 ("libcamera: formats: Add support for 8-, 10- and 12-bit Bayer formats")
Reported-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/v4l2_pixelformat.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Niklas Söderlund April 30, 2020, 2:16 p.m. UTC | #1
Hi Laurent,

Thanks for your work.

On 2020-04-30 17:01:49 +0300, Laurent Pinchart wrote:
> The V4L2_PIX_FMT_SBGGR10P format was misspecified as
> V4L2_PIX_FMT_SBGGR10. Fix it.
> 
> Fixes: 00d639d951e7 ("libcamera: formats: Add support for 8-, 10- and 12-bit Bayer formats")
> Reported-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

This solves my issue,

Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/v4l2_pixelformat.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
> index fd7e2d286f3f..561f9327780a 100644
> --- a/src/libcamera/v4l2_pixelformat.cpp
> +++ b/src/libcamera/v4l2_pixelformat.cpp
> @@ -77,7 +77,7 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10), PixelFormat(DRM_FORMAT_SGBRG10) },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10), PixelFormat(DRM_FORMAT_SGRBG10) },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10), PixelFormat(DRM_FORMAT_SRGGB10) },
> -	{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10),
> +	{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P),
>  	  PixelFormat(DRM_FORMAT_SBGGR10, MIPI_FORMAT_MOD_CSI2_PACKED) },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P),
>  	  PixelFormat(DRM_FORMAT_SGBRG10, MIPI_FORMAT_MOD_CSI2_PACKED) },
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Kieran Bingham April 30, 2020, 2:26 p.m. UTC | #2
On 30/04/2020 15:01, Laurent Pinchart wrote:
> The V4L2_PIX_FMT_SBGGR10P format was misspecified as
> V4L2_PIX_FMT_SBGGR10. Fix it.
> 
> Fixes: 00d639d951e7 ("libcamera: formats: Add support for 8-, 10- and 12-bit Bayer formats")
> Reported-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Ooops.

I'm sure I even looked through matching the {SGBR}s in both parts. Must
have missed checking/matching the Ps :-(

<don't say it ... don't say it ...>
  Maybe it would have been more visible in a table as the alignment
would be off ..
<I said don't say it...> :-D

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>


> ---
>  src/libcamera/v4l2_pixelformat.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
> index fd7e2d286f3f..561f9327780a 100644
> --- a/src/libcamera/v4l2_pixelformat.cpp
> +++ b/src/libcamera/v4l2_pixelformat.cpp
> @@ -77,7 +77,7 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10), PixelFormat(DRM_FORMAT_SGBRG10) },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10), PixelFormat(DRM_FORMAT_SGRBG10) },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10), PixelFormat(DRM_FORMAT_SRGGB10) },
> -	{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10),
> +	{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P),
>  	  PixelFormat(DRM_FORMAT_SBGGR10, MIPI_FORMAT_MOD_CSI2_PACKED) },
>  	{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P),
>  	  PixelFormat(DRM_FORMAT_SGBRG10, MIPI_FORMAT_MOD_CSI2_PACKED) },
>
Niklas Söderlund April 30, 2020, 2:27 p.m. UTC | #3
On 2020-04-30 16:16:24 +0200, Niklas Söderlund wrote:
> Hi Laurent,
> 
> Thanks for your work.
> 
> On 2020-04-30 17:01:49 +0300, Laurent Pinchart wrote:
> > The V4L2_PIX_FMT_SBGGR10P format was misspecified as
> > V4L2_PIX_FMT_SBGGR10. Fix it.
> > 
> > Fixes: 00d639d951e7 ("libcamera: formats: Add support for 8-, 10- and 12-bit Bayer formats")
> > Reported-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> This solves my issue,
> 
> Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> 
> > ---
> >  src/libcamera/v4l2_pixelformat.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
> > index fd7e2d286f3f..561f9327780a 100644
> > --- a/src/libcamera/v4l2_pixelformat.cpp
> > +++ b/src/libcamera/v4l2_pixelformat.cpp
> > @@ -77,7 +77,7 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
> >  	{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10), PixelFormat(DRM_FORMAT_SGBRG10) },
> >  	{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10), PixelFormat(DRM_FORMAT_SGRBG10) },
> >  	{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10), PixelFormat(DRM_FORMAT_SRGGB10) },
> > -	{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10),
> > +	{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P),
> >  	  PixelFormat(DRM_FORMAT_SBGGR10, MIPI_FORMAT_MOD_CSI2_PACKED) },
> >  	{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P),
> >  	  PixelFormat(DRM_FORMAT_SGBRG10, MIPI_FORMAT_MOD_CSI2_PACKED) },
> > -- 
> > Regards,
> > 
> > Laurent Pinchart
> > 
> > _______________________________________________
> > libcamera-devel mailing list
> > libcamera-devel@lists.libcamera.org
> > https://lists.libcamera.org/listinfo/libcamera-devel
> 
> -- 
> Regards,
> Niklas Söderlund

Patch

diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
index fd7e2d286f3f..561f9327780a 100644
--- a/src/libcamera/v4l2_pixelformat.cpp
+++ b/src/libcamera/v4l2_pixelformat.cpp
@@ -77,7 +77,7 @@  const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{
 	{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10), PixelFormat(DRM_FORMAT_SGBRG10) },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10), PixelFormat(DRM_FORMAT_SGRBG10) },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10), PixelFormat(DRM_FORMAT_SRGGB10) },
-	{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10),
+	{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P),
 	  PixelFormat(DRM_FORMAT_SBGGR10, MIPI_FORMAT_MOD_CSI2_PACKED) },
 	{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P),
 	  PixelFormat(DRM_FORMAT_SGBRG10, MIPI_FORMAT_MOD_CSI2_PACKED) },