[libcamera-devel,1/2] include: drm_fourcc: Add 16-bit Bayer FourCC

Message ID 20200724085550.496484-2-niklas.soderlund@ragnatech.se
State Superseded
Headers show
Series
  • libcamera: Add support for 16-bit Bayer formats
Related show

Commit Message

Niklas Söderlund July 24, 2020, 8:55 a.m. UTC
The patch trying to upstream Bayer formats to the DRM FourCC header file
in Linux left out the 16-bit formats, add them. This addition will be
included in the next version of the DRM Bayer patch sent out.

Intention is to merge this in libcamera and update the header file once
the upstream patch is picked up.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 include/linux/drm_fourcc.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Laurent Pinchart July 24, 2020, 11:38 a.m. UTC | #1
Hi Niklas,

Thank you for the patch.

On Fri, Jul 24, 2020 at 10:55:49AM +0200, Niklas Söderlund wrote:
> The patch trying to upstream Bayer formats to the DRM FourCC header file
> in Linux left out the 16-bit formats, add them. This addition will be
> included in the next version of the DRM Bayer patch sent out.
> 
> Intention is to merge this in libcamera and update the header file once
> the upstream patch is picked up.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> ---
>  include/linux/drm_fourcc.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h
> index 69240dfe1df0df28..baa3faecdf1575c7 100644
> --- a/include/linux/drm_fourcc.h
> +++ b/include/linux/drm_fourcc.h
> @@ -344,6 +344,12 @@ extern "C" {
>  #define DRM_FORMAT_SGBRG14	fourcc_code('G', 'B', '1', '4')
>  #define DRM_FORMAT_SBGGR14	fourcc_code('B', 'G', '1', '4')
>  
> +/* 16-bit Bayer formats */
> +#define DRM_FORMAT_SRGGB16	fourcc_code('R', 'G', '1', '6')

This conflicts with DRM_FORMAT_RGB565.

> +#define DRM_FORMAT_SGRBG16	fourcc_code('G', 'R', '1', '6')
> +#define DRM_FORMAT_SGBRG16	fourcc_code('G', 'B', '1', '6')
> +#define DRM_FORMAT_SBGGR16	fourcc_code('B', 'Y', 'R', '2')
> +
>  /*
>   * Format Modifiers:
>   *
Niklas Söderlund July 24, 2020, 11:56 a.m. UTC | #2
Hi Laurent,

Thanks for your feedback.

On 2020-07-24 14:38:39 +0300, Laurent Pinchart wrote:
> Hi Niklas,
> 
> Thank you for the patch.
> 
> On Fri, Jul 24, 2020 at 10:55:49AM +0200, Niklas Söderlund wrote:
> > The patch trying to upstream Bayer formats to the DRM FourCC header file
> > in Linux left out the 16-bit formats, add them. This addition will be
> > included in the next version of the DRM Bayer patch sent out.
> > 
> > Intention is to merge this in libcamera and update the header file once
> > the upstream patch is picked up.
> > 
> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> > ---
> >  include/linux/drm_fourcc.h | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h
> > index 69240dfe1df0df28..baa3faecdf1575c7 100644
> > --- a/include/linux/drm_fourcc.h
> > +++ b/include/linux/drm_fourcc.h
> > @@ -344,6 +344,12 @@ extern "C" {
> >  #define DRM_FORMAT_SGBRG14	fourcc_code('G', 'B', '1', '4')
> >  #define DRM_FORMAT_SBGGR14	fourcc_code('B', 'G', '1', '4')
> >  
> > +/* 16-bit Bayer formats */
> > +#define DRM_FORMAT_SRGGB16	fourcc_code('R', 'G', '1', '6')
> 
> This conflicts with DRM_FORMAT_RGB565.

Crap, how did I miss that? I will make this

#define DRM_FORMAT_SRGGB16      fourcc_code('R', 'G', 'B', '6')

in v2.

> 
> > +#define DRM_FORMAT_SGRBG16	fourcc_code('G', 'R', '1', '6')
> > +#define DRM_FORMAT_SGBRG16	fourcc_code('G', 'B', '1', '6')
> > +#define DRM_FORMAT_SBGGR16	fourcc_code('B', 'Y', 'R', '2')
> > +
> >  /*
> >   * Format Modifiers:
> >   *
> 
> -- 
> Regards,
> 
> Laurent Pinchart

Patch

diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h
index 69240dfe1df0df28..baa3faecdf1575c7 100644
--- a/include/linux/drm_fourcc.h
+++ b/include/linux/drm_fourcc.h
@@ -344,6 +344,12 @@  extern "C" {
 #define DRM_FORMAT_SGBRG14	fourcc_code('G', 'B', '1', '4')
 #define DRM_FORMAT_SBGGR14	fourcc_code('B', 'G', '1', '4')
 
+/* 16-bit Bayer formats */
+#define DRM_FORMAT_SRGGB16	fourcc_code('R', 'G', '1', '6')
+#define DRM_FORMAT_SGRBG16	fourcc_code('G', 'R', '1', '6')
+#define DRM_FORMAT_SGBRG16	fourcc_code('G', 'B', '1', '6')
+#define DRM_FORMAT_SBGGR16	fourcc_code('B', 'Y', 'R', '2')
+
 /*
  * Format Modifiers:
  *