* [PATCH v2 1/2] v4l: Add 12-bit raw bayer linear packed formats @ 2019-07-08 6:02 Edgar Thier 2019-07-08 6:04 ` [PATCH v2 2/2] uvc: " Edgar Thier 2021-03-22 13:29 ` [PATCH v2 1/2] v4l: " Laurent Pinchart 0 siblings, 2 replies; 6+ messages in thread From: Edgar Thier @ 2019-07-08 6:02 UTC (permalink / raw) To: laurent.pinchart, sakari.ailus; +Cc: Edgar Thier, Linux Media Mailing List These formats are compressed 12-bit raw bayer formats with four different pixel orders. The pixel follow one another without any padding, thus are packed in a 'linear' fashion. Signed-off-by: Edgar Thier <info@edgarthier.net> --- Documentation/media/uapi/v4l/pixfmt-rgb.rst | 1 + .../media/uapi/v4l/pixfmt-srggb12lp.rst | 76 +++++++++++++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 4 + include/uapi/linux/videodev2.h | 7 ++ 4 files changed, 88 insertions(+) create mode 100644 Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst diff --git a/Documentation/media/uapi/v4l/pixfmt-rgb.rst b/Documentation/media/uapi/v4l/pixfmt-rgb.rst index 48ab80024835..9efa500c02dc 100644 --- a/Documentation/media/uapi/v4l/pixfmt-rgb.rst +++ b/Documentation/media/uapi/v4l/pixfmt-rgb.rst @@ -26,5 +26,6 @@ RGB Formats pixfmt-srggb10-ipu3 pixfmt-srggb12 pixfmt-srggb12p + pixfmt-srggb12lp pixfmt-srggb14p pixfmt-srggb16 diff --git a/Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst b/Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst new file mode 100644 index 000000000000..08d73cfdc42d --- /dev/null +++ b/Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst @@ -0,0 +1,76 @@ +.. -*- coding: utf-8; mode: rst -*- + +.. _v4l2-pix-fmt-sbggr12lp: +.. _v4l2-pix-fmt-sgbrg12lp: +.. _v4l2-pix-fmt-sgrbg12lp: +.. _v4l2-pix-fmt-srggb12lp: + +********************************************************************************************************************************** +V4L2_PIX_FMT_SBGGR12LP ('BGCp'), V4L2_PIX_FMT_SGBRG12LP ('GBCp'), V4L2_PIX_FMT_SGRBG12LP ('GRCp'), V4L2_PIX_FMT_SRGGB12LP ('RGCp') +********************************************************************************************************************************** + +12-bit Bayer formats + +Description +=========== + +These packed Bayer formats are used by industrial cameras, often in conjunction +with UsbVision (see https://www.visiononline.org/userAssets/aiaUploads/file/USB3_Vision_Specification_v1-0-1.pdf). + +The formats are equal to the Genicam PFNC Bayer12p formats +(see https://www.emva.org/wp-content/uploads/GenICam_PFNC_2_3.pdf). + +They are raw sRGB / Bayer formats with 12 bits +per sample with 3 bytes for every 2 pixels. + +The format is little endian. + +Below is an example of a small image in V4L2_PIX_FMT_SBGGR12LP format. + +**Byte Order.** +Each cell is one byte. + +.. tabularcolumns:: |p{0.8cm}|p{4.0cm}|p{4.0cm}|p{4.0cm}|p{4.0cm}| + +.. flat-table:: + + * - start + 0: + - B\ :sub:`00low` + - G\ :sub:`01low`\ (bits 7--4) + B\ :sub:`00high`\ (bits 0--3) + - G\ :sub:`01high`\ + - B\ :sub:`02low` + - G\ :sub:`03low`\ (bits 7--4) + B\ :sub:`02high`\ (bits 0--3) + - G\ :sub:`03high`\ + + * - start + 6: + - G\ :sub:`10low` + - R\ :sub:`11low`\ (bits 7--4) + G\ :sub:`10high`\ (bits 0--3) + - R\ :sub:`11high` + - G\ :sub:`12low` + - R\ :sub:`13low`\ (bits 7--4) + G\ :sub:`12high`\ (bits 0--3) + - R\ :sub:`13high` + + * - start + 12: + - B\ :sub:`20low` + - G\ :sub:`21low`\ (bits 7--4) + B\ :sub:`20high`\ (bits 0--3) + - G\ :sub:`21high` + - B\ :sub:`22low` + - G\ :sub:`21low`\ (bits 7--4) + B\ :sub:`22high`\ (bits 0--3) + - G\ :sub:`21high` + + * - start + 18: + - G\ :sub:`30low` + - R\ :sub:`31low`\ (bits 7--4) + G\ :sub:`30high`\ (bits 0--3) + - R\ :sub:`31high` + - G\ :sub:`32low` + - R\ :sub:`33low`\ (bits 7--4) + G\ :sub:`32high`\ (bits 0--3) + - R\ :sub:`33high` + diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index ac87c3e37280..0cef797e4989 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1275,6 +1275,10 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_SGBRG12: descr = "12-bit Bayer GBGB/RGRG"; break; case V4L2_PIX_FMT_SGRBG12: descr = "12-bit Bayer GRGR/BGBG"; break; case V4L2_PIX_FMT_SRGGB12: descr = "12-bit Bayer RGRG/GBGB"; break; + case V4L2_PIX_FMT_SBGGR12LP: descr = "12-bit Bayer BGGR Linear Packed"; break; + case V4L2_PIX_FMT_SGBRG12LP: descr = "12-bit Bayer GBRG Linear Packed"; break; + case V4L2_PIX_FMT_SGRBG12LP: descr = "12-bit Bayer GRBG Linear Packed"; break; + case V4L2_PIX_FMT_SRGGB12LP: descr = "12-bit Bayer RGGB Linear Packed"; break; case V4L2_PIX_FMT_SBGGR12P: descr = "12-bit Bayer BGBG/GRGR Packed"; break; case V4L2_PIX_FMT_SGBRG12P: descr = "12-bit Bayer GBGB/RGRG Packed"; break; case V4L2_PIX_FMT_SGRBG12P: descr = "12-bit Bayer GRGR/BGBG Packed"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 1050a75fb7ef..adee353d5913 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -646,6 +646,13 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */ #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ + + /* 12bit raw bayer linearly packed, 6 bytes for every 4 pixels */ +#define V4L2_PIX_FMT_SBGGR12LP v4l2_fourcc('B', 'G', 'C', 'p') +#define V4L2_PIX_FMT_SGBRG12LP v4l2_fourcc('G', 'B', 'C', 'p') +#define V4L2_PIX_FMT_SGRBG12LP v4l2_fourcc('G', 'R', 'C', 'p') +#define V4L2_PIX_FMT_SRGGB12LP v4l2_fourcc('R', 'G', 'C', 'p') + /* 12bit raw bayer packed, 6 bytes for every 4 pixels */ #define V4L2_PIX_FMT_SBGGR12P v4l2_fourcc('p', 'B', 'C', 'C') #define V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C') -- 2.20.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] uvc: Add 12-bit raw bayer linear packed formats 2019-07-08 6:02 [PATCH v2 1/2] v4l: Add 12-bit raw bayer linear packed formats Edgar Thier @ 2019-07-08 6:04 ` Edgar Thier 2021-03-22 13:31 ` Laurent Pinchart 2021-03-22 13:29 ` [PATCH v2 1/2] v4l: " Laurent Pinchart 1 sibling, 1 reply; 6+ messages in thread From: Edgar Thier @ 2019-07-08 6:04 UTC (permalink / raw) To: laurent.pinchart, sakari.ailus; +Cc: Edgar Thier, Linux Media Mailing List These formats are compressed 12-bit raw bayer formats with four different pixel orders. The pixel follow one another without any padding, thus are packed in a 'linear' fashion. Signed-off-by: Edgar Thier <info@edgarthier.net> --- drivers/media/usb/uvc/uvc_driver.c | 21 ++++++++++++++++++++- drivers/media/usb/uvc/uvcvideo.h | 12 ++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 10cfe8e51626..d12298d18406 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -179,6 +179,26 @@ static struct uvc_format_desc uvc_fmts[] = { .guid = UVC_GUID_FORMAT_RW10, .fcc = V4L2_PIX_FMT_SRGGB10P, }, + { + .name = "Bayer 12-bit linear packed (SBGGR12LP)", + .guid = UVC_GUID_FORMAT_BGCP, + .fcc = V4L2_PIX_FMT_SBGGR12LP, + }, + { + .name = "Bayer 12-bit linear packed (SGBRG12LP)", + .guid = UVC_GUID_FORMAT_GBCP, + .fcc = V4L2_PIX_FMT_SGBRG12LP, + }, + { + .name = "Bayer 12-bit linear packed (SRGGB12LP)", + .guid = UVC_GUID_FORMAT_RGCP, + .fcc = V4L2_PIX_FMT_SRGGB12LP, + }, + { + .name = "Bayer 12-bit linear packed (SGRBG12LP)", + .guid = UVC_GUID_FORMAT_GRCP, + .fcc = V4L2_PIX_FMT_SGRBG12LP, + }, { .name = "Bayer 16-bit (SBGGR16)", .guid = UVC_GUID_FORMAT_BG16, @@ -2924,4 +2944,3 @@ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); MODULE_VERSION(DRIVER_VERSION); - diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index c7c1baa90dea..f5be00fb9a73 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -108,6 +108,18 @@ #define UVC_GUID_FORMAT_RGGB \ { 'R', 'G', 'G', 'B', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_BGCP \ + { 'B', 'G', 'C', 'p', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_GBCP \ + { 'G', 'B', 'C', 'p', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_RGCP \ + { 'R', 'G', 'C', 'p', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_GRCP \ + { 'G', 'R', 'C', 'p', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} #define UVC_GUID_FORMAT_BG16 \ { 'B', 'G', '1', '6', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} -- 2.20.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] uvc: Add 12-bit raw bayer linear packed formats 2019-07-08 6:04 ` [PATCH v2 2/2] uvc: " Edgar Thier @ 2021-03-22 13:31 ` Laurent Pinchart 0 siblings, 0 replies; 6+ messages in thread From: Laurent Pinchart @ 2021-03-22 13:31 UTC (permalink / raw) To: Edgar Thier; +Cc: sakari.ailus, Linux Media Mailing List Hi Edgar, Thank you for the patch. On Mon, Jul 08, 2019 at 08:04:31AM +0200, Edgar Thier wrote: > These formats are compressed 12-bit raw bayer formats with four different > pixel orders. The pixel follow one another without any padding, > thus are packed in a 'linear' fashion. > > Signed-off-by: Edgar Thier <info@edgarthier.net> > --- > drivers/media/usb/uvc/uvc_driver.c | 21 ++++++++++++++++++++- > drivers/media/usb/uvc/uvcvideo.h | 12 ++++++++++++ > 2 files changed, 32 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c > index 10cfe8e51626..d12298d18406 100644 > --- a/drivers/media/usb/uvc/uvc_driver.c > +++ b/drivers/media/usb/uvc/uvc_driver.c > @@ -179,6 +179,26 @@ static struct uvc_format_desc uvc_fmts[] = { > .guid = UVC_GUID_FORMAT_RW10, > .fcc = V4L2_PIX_FMT_SRGGB10P, > }, > + { > + .name = "Bayer 12-bit linear packed (SBGGR12LP)", > + .guid = UVC_GUID_FORMAT_BGCP, > + .fcc = V4L2_PIX_FMT_SBGGR12LP, > + }, > + { > + .name = "Bayer 12-bit linear packed (SGBRG12LP)", > + .guid = UVC_GUID_FORMAT_GBCP, > + .fcc = V4L2_PIX_FMT_SGBRG12LP, > + }, > + { > + .name = "Bayer 12-bit linear packed (SRGGB12LP)", > + .guid = UVC_GUID_FORMAT_RGCP, > + .fcc = V4L2_PIX_FMT_SRGGB12LP, > + }, > + { > + .name = "Bayer 12-bit linear packed (SGRBG12LP)", > + .guid = UVC_GUID_FORMAT_GRCP, > + .fcc = V4L2_PIX_FMT_SGRBG12LP, > + }, > { > .name = "Bayer 16-bit (SBGGR16)", > .guid = UVC_GUID_FORMAT_BG16, > @@ -2924,4 +2944,3 @@ MODULE_AUTHOR(DRIVER_AUTHOR); > MODULE_DESCRIPTION(DRIVER_DESC); > MODULE_LICENSE("GPL"); > MODULE_VERSION(DRIVER_VERSION); > - Unrelated change, but it's a good one, and not worth a separate patch. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h > index c7c1baa90dea..f5be00fb9a73 100644 > --- a/drivers/media/usb/uvc/uvcvideo.h > +++ b/drivers/media/usb/uvc/uvcvideo.h > @@ -108,6 +108,18 @@ > #define UVC_GUID_FORMAT_RGGB \ > { 'R', 'G', 'G', 'B', 0x00, 0x00, 0x10, 0x00, \ > 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} > +#define UVC_GUID_FORMAT_BGCP \ > + { 'B', 'G', 'C', 'p', 0x00, 0x00, 0x10, 0x00, \ > + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} > +#define UVC_GUID_FORMAT_GBCP \ > + { 'G', 'B', 'C', 'p', 0x00, 0x00, 0x10, 0x00, \ > + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} > +#define UVC_GUID_FORMAT_RGCP \ > + { 'R', 'G', 'C', 'p', 0x00, 0x00, 0x10, 0x00, \ > + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} > +#define UVC_GUID_FORMAT_GRCP \ > + { 'G', 'R', 'C', 'p', 0x00, 0x00, 0x10, 0x00, \ > + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} > #define UVC_GUID_FORMAT_BG16 \ > { 'B', 'G', '1', '6', 0x00, 0x00, 0x10, 0x00, \ > 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] v4l: Add 12-bit raw bayer linear packed formats 2019-07-08 6:02 [PATCH v2 1/2] v4l: Add 12-bit raw bayer linear packed formats Edgar Thier 2019-07-08 6:04 ` [PATCH v2 2/2] uvc: " Edgar Thier @ 2021-03-22 13:29 ` Laurent Pinchart 2021-04-09 10:39 ` Sakari Ailus 2021-05-05 6:27 ` Edgar Thier 1 sibling, 2 replies; 6+ messages in thread From: Laurent Pinchart @ 2021-03-22 13:29 UTC (permalink / raw) To: Edgar Thier; +Cc: sakari.ailus, Linux Media Mailing List Hi Edgar, I've just been notified that I had forgotten about this patch series :-S Mea culpa. On Mon, Jul 08, 2019 at 08:02:25AM +0200, Edgar Thier wrote: > These formats are compressed 12-bit raw bayer formats with four different > pixel orders. The pixel follow one another without any padding, s/pixel follow/pixels follow/ > thus are packed in a 'linear' fashion. > > Signed-off-by: Edgar Thier <info@edgarthier.net> > --- > Documentation/media/uapi/v4l/pixfmt-rgb.rst | 1 + > .../media/uapi/v4l/pixfmt-srggb12lp.rst | 76 +++++++++++++++++++ > drivers/media/v4l2-core/v4l2-ioctl.c | 4 + > include/uapi/linux/videodev2.h | 7 ++ > 4 files changed, 88 insertions(+) > create mode 100644 Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst > > diff --git a/Documentation/media/uapi/v4l/pixfmt-rgb.rst b/Documentation/media/uapi/v4l/pixfmt-rgb.rst > index 48ab80024835..9efa500c02dc 100644 > --- a/Documentation/media/uapi/v4l/pixfmt-rgb.rst > +++ b/Documentation/media/uapi/v4l/pixfmt-rgb.rst > @@ -26,5 +26,6 @@ RGB Formats > pixfmt-srggb10-ipu3 > pixfmt-srggb12 > pixfmt-srggb12p > + pixfmt-srggb12lp I'd move this above srggb12p to order them alphabetically. > pixfmt-srggb14p > pixfmt-srggb16 > diff --git a/Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst b/Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst > new file mode 100644 > index 000000000000..08d73cfdc42d > --- /dev/null > +++ b/Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst > @@ -0,0 +1,76 @@ > +.. -*- coding: utf-8; mode: rst -*- > + > +.. _v4l2-pix-fmt-sbggr12lp: > +.. _v4l2-pix-fmt-sgbrg12lp: > +.. _v4l2-pix-fmt-sgrbg12lp: > +.. _v4l2-pix-fmt-srggb12lp: > + > +********************************************************************************************************************************** > +V4L2_PIX_FMT_SBGGR12LP ('BGCp'), V4L2_PIX_FMT_SGBRG12LP ('GBCp'), V4L2_PIX_FMT_SGRBG12LP ('GRCp'), V4L2_PIX_FMT_SRGGB12LP ('RGCp') > +********************************************************************************************************************************** > + > +12-bit Bayer formats This should be 12-bit linear packed Bayer formats ---------------------------------- > + > +Description > +=========== > + > +These packed Bayer formats are used by industrial cameras, often in conjunction > +with UsbVision (see https://www.visiononline.org/userAssets/aiaUploads/file/USB3_Vision_Specification_v1-0-1.pdf). > + > +The formats are equal to the Genicam PFNC Bayer12p formats > +(see https://www.emva.org/wp-content/uploads/GenICam_PFNC_2_3.pdf). > + > +They are raw sRGB / Bayer formats with 12 bits > +per sample with 3 bytes for every 2 pixels. > + > +The format is little endian. I'd drop this line, as there's no real endianess here, is there ? With those small changes, Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> There's no need to resubmit this patch if you agree with the proposed changes, I'll apply them locally. > + > +Below is an example of a small image in V4L2_PIX_FMT_SBGGR12LP format. > + > +**Byte Order.** > +Each cell is one byte. > + > +.. tabularcolumns:: |p{0.8cm}|p{4.0cm}|p{4.0cm}|p{4.0cm}|p{4.0cm}| > + > +.. flat-table:: > + > + * - start + 0: > + - B\ :sub:`00low` > + - G\ :sub:`01low`\ (bits 7--4) > + B\ :sub:`00high`\ (bits 0--3) > + - G\ :sub:`01high`\ > + - B\ :sub:`02low` > + - G\ :sub:`03low`\ (bits 7--4) > + B\ :sub:`02high`\ (bits 0--3) > + - G\ :sub:`03high`\ > + > + * - start + 6: > + - G\ :sub:`10low` > + - R\ :sub:`11low`\ (bits 7--4) > + G\ :sub:`10high`\ (bits 0--3) > + - R\ :sub:`11high` > + - G\ :sub:`12low` > + - R\ :sub:`13low`\ (bits 7--4) > + G\ :sub:`12high`\ (bits 0--3) > + - R\ :sub:`13high` > + > + * - start + 12: > + - B\ :sub:`20low` > + - G\ :sub:`21low`\ (bits 7--4) > + B\ :sub:`20high`\ (bits 0--3) > + - G\ :sub:`21high` > + - B\ :sub:`22low` > + - G\ :sub:`21low`\ (bits 7--4) > + B\ :sub:`22high`\ (bits 0--3) > + - G\ :sub:`21high` > + > + * - start + 18: > + - G\ :sub:`30low` > + - R\ :sub:`31low`\ (bits 7--4) > + G\ :sub:`30high`\ (bits 0--3) > + - R\ :sub:`31high` > + - G\ :sub:`32low` > + - R\ :sub:`33low`\ (bits 7--4) > + G\ :sub:`32high`\ (bits 0--3) > + - R\ :sub:`33high` > + > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c > index ac87c3e37280..0cef797e4989 100644 > --- a/drivers/media/v4l2-core/v4l2-ioctl.c > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c > @@ -1275,6 +1275,10 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) > case V4L2_PIX_FMT_SGBRG12: descr = "12-bit Bayer GBGB/RGRG"; break; > case V4L2_PIX_FMT_SGRBG12: descr = "12-bit Bayer GRGR/BGBG"; break; > case V4L2_PIX_FMT_SRGGB12: descr = "12-bit Bayer RGRG/GBGB"; break; > + case V4L2_PIX_FMT_SBGGR12LP: descr = "12-bit Bayer BGGR Linear Packed"; break; > + case V4L2_PIX_FMT_SGBRG12LP: descr = "12-bit Bayer GBRG Linear Packed"; break; > + case V4L2_PIX_FMT_SGRBG12LP: descr = "12-bit Bayer GRBG Linear Packed"; break; > + case V4L2_PIX_FMT_SRGGB12LP: descr = "12-bit Bayer RGGB Linear Packed"; break; > case V4L2_PIX_FMT_SBGGR12P: descr = "12-bit Bayer BGBG/GRGR Packed"; break; > case V4L2_PIX_FMT_SGBRG12P: descr = "12-bit Bayer GBGB/RGRG Packed"; break; > case V4L2_PIX_FMT_SGRBG12P: descr = "12-bit Bayer GRGR/BGBG Packed"; break; > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > index 1050a75fb7ef..adee353d5913 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -646,6 +646,13 @@ struct v4l2_pix_format { > #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */ > #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ > #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ > + > + /* 12bit raw bayer linearly packed, 6 bytes for every 4 pixels */ > +#define V4L2_PIX_FMT_SBGGR12LP v4l2_fourcc('B', 'G', 'C', 'p') > +#define V4L2_PIX_FMT_SGBRG12LP v4l2_fourcc('G', 'B', 'C', 'p') > +#define V4L2_PIX_FMT_SGRBG12LP v4l2_fourcc('G', 'R', 'C', 'p') > +#define V4L2_PIX_FMT_SRGGB12LP v4l2_fourcc('R', 'G', 'C', 'p') > + > /* 12bit raw bayer packed, 6 bytes for every 4 pixels */ > #define V4L2_PIX_FMT_SBGGR12P v4l2_fourcc('p', 'B', 'C', 'C') > #define V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C') -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] v4l: Add 12-bit raw bayer linear packed formats 2021-03-22 13:29 ` [PATCH v2 1/2] v4l: " Laurent Pinchart @ 2021-04-09 10:39 ` Sakari Ailus 2021-05-05 6:27 ` Edgar Thier 1 sibling, 0 replies; 6+ messages in thread From: Sakari Ailus @ 2021-04-09 10:39 UTC (permalink / raw) To: Laurent Pinchart; +Cc: Edgar Thier, Linux Media Mailing List Hi Laurent, On Mon, Mar 22, 2021 at 03:29:56PM +0200, Laurent Pinchart wrote: > Hi Edgar, > > I've just been notified that I had forgotten about this patch series :-S > Mea culpa. > > On Mon, Jul 08, 2019 at 08:02:25AM +0200, Edgar Thier wrote: > > These formats are compressed 12-bit raw bayer formats with four different > > pixel orders. The pixel follow one another without any padding, > > s/pixel follow/pixels follow/ > > > thus are packed in a 'linear' fashion. > > > > Signed-off-by: Edgar Thier <info@edgarthier.net> > > --- > > Documentation/media/uapi/v4l/pixfmt-rgb.rst | 1 + > > .../media/uapi/v4l/pixfmt-srggb12lp.rst | 76 +++++++++++++++++++ > > drivers/media/v4l2-core/v4l2-ioctl.c | 4 + > > include/uapi/linux/videodev2.h | 7 ++ > > 4 files changed, 88 insertions(+) > > create mode 100644 Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst > > > > diff --git a/Documentation/media/uapi/v4l/pixfmt-rgb.rst b/Documentation/media/uapi/v4l/pixfmt-rgb.rst > > index 48ab80024835..9efa500c02dc 100644 > > --- a/Documentation/media/uapi/v4l/pixfmt-rgb.rst > > +++ b/Documentation/media/uapi/v4l/pixfmt-rgb.rst > > @@ -26,5 +26,6 @@ RGB Formats > > pixfmt-srggb10-ipu3 > > pixfmt-srggb12 > > pixfmt-srggb12p > > + pixfmt-srggb12lp > > I'd move this above srggb12p to order them alphabetically. > > > pixfmt-srggb14p > > pixfmt-srggb16 > > diff --git a/Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst b/Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst > > new file mode 100644 > > index 000000000000..08d73cfdc42d > > --- /dev/null > > +++ b/Documentation/media/uapi/v4l/pixfmt-srggb12lp.rst > > @@ -0,0 +1,76 @@ > > +.. -*- coding: utf-8; mode: rst -*- > > + > > +.. _v4l2-pix-fmt-sbggr12lp: > > +.. _v4l2-pix-fmt-sgbrg12lp: > > +.. _v4l2-pix-fmt-sgrbg12lp: > > +.. _v4l2-pix-fmt-srggb12lp: > > + > > +********************************************************************************************************************************** > > +V4L2_PIX_FMT_SBGGR12LP ('BGCp'), V4L2_PIX_FMT_SGBRG12LP ('GBCp'), V4L2_PIX_FMT_SGRBG12LP ('GRCp'), V4L2_PIX_FMT_SRGGB12LP ('RGCp') > > +********************************************************************************************************************************** > > + > > +12-bit Bayer formats > > This should be > > 12-bit linear packed Bayer formats > ---------------------------------- > > > + > > +Description > > +=========== > > + > > +These packed Bayer formats are used by industrial cameras, often in conjunction > > +with UsbVision (see https://www.visiononline.org/userAssets/aiaUploads/file/USB3_Vision_Specification_v1-0-1.pdf). > > + > > +The formats are equal to the Genicam PFNC Bayer12p formats > > +(see https://www.emva.org/wp-content/uploads/GenICam_PFNC_2_3.pdf). > > + > > +They are raw sRGB / Bayer formats with 12 bits > > +per sample with 3 bytes for every 2 pixels. > > + > > +The format is little endian. > > I'd drop this line, as there's no real endianess here, is there ? > > With those small changes, > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Feel free to add: Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] v4l: Add 12-bit raw bayer linear packed formats 2021-03-22 13:29 ` [PATCH v2 1/2] v4l: " Laurent Pinchart 2021-04-09 10:39 ` Sakari Ailus @ 2021-05-05 6:27 ` Edgar Thier 1 sibling, 0 replies; 6+ messages in thread From: Edgar Thier @ 2021-05-05 6:27 UTC (permalink / raw) To: Laurent Pinchart; +Cc: sakari.ailus, Linux Media Mailing List Hi Laurent, My apologies for the late reply. > no need to resubmit this patch if you agree with the proposed > changes, I'll apply them locally. Feel free to apply them locally. Regards, Edgar ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-05-05 6:27 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-07-08 6:02 [PATCH v2 1/2] v4l: Add 12-bit raw bayer linear packed formats Edgar Thier 2019-07-08 6:04 ` [PATCH v2 2/2] uvc: " Edgar Thier 2021-03-22 13:31 ` Laurent Pinchart 2021-03-22 13:29 ` [PATCH v2 1/2] v4l: " Laurent Pinchart 2021-04-09 10:39 ` Sakari Ailus 2021-05-05 6:27 ` Edgar Thier
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.