From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from lb2-smtp-cloud2.xs4all.net ([194.109.24.25]:50040 "EHLO lb2-smtp-cloud2.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752285AbcFTPZz (ORCPT ); Mon, 20 Jun 2016 11:25:55 -0400 Subject: Re: [PATCH 3/6] v4l: Add packed Bayer raw12 pixel formats To: Sakari Ailus , linux-media@vger.kernel.org References: <1464353080-18300-1-git-send-email-sakari.ailus@linux.intel.com> <1464353080-18300-4-git-send-email-sakari.ailus@linux.intel.com> Cc: g.liakhovetski@gmx.de From: Hans Verkuil Message-ID: <576809F1.1010507@xs4all.nl> Date: Mon, 20 Jun 2016 17:21:21 +0200 MIME-Version: 1.0 In-Reply-To: <1464353080-18300-4-git-send-email-sakari.ailus@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: On 05/27/2016 02:44 PM, Sakari Ailus wrote: > These formats are compressed 12-bit raw bayer formats with four different > pixel orders. They are similar to 10-bit variants. The formats added by > this patch are > > V4L2_PIX_FMT_SBGGR12P > V4L2_PIX_FMT_SGBRG12P > V4L2_PIX_FMT_SGRBG12P > V4L2_PIX_FMT_SRGGB12P > > Signed-off-by: Sakari Ailus > --- > .../DocBook/media/v4l/pixfmt-srggb12p.xml | 103 +++++++++++++++++++++ > Documentation/DocBook/media/v4l/pixfmt.xml | 1 + > include/uapi/linux/videodev2.h | 5 + > 3 files changed, 109 insertions(+) > create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml > > diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml > new file mode 100644 > index 0000000..affa366 > --- /dev/null > +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml > @@ -0,0 +1,103 @@ > + > + > + V4L2_PIX_FMT_SRGGB12P ('pRCC'), > + V4L2_PIX_FMT_SGRBG12P ('pgCC'), > + V4L2_PIX_FMT_SGBRG12P ('pGCC'), > + V4L2_PIX_FMT_SBGGR12P ('pBCC'), Nitpick: the last comma should be removed otherwise the title would end with it. Looks good otherwise. With the comma removed: Acked-by: Hans Verkuil Regards, Hans > + > + &manvol; > + > + > + V4L2_PIX_FMT_SRGGB12P > + V4L2_PIX_FMT_SGRBG12P > + V4L2_PIX_FMT_SGBRG12P > + V4L2_PIX_FMT_SBGGR12P > + 12-bit packed Bayer formats > + > + > + Description > + > + These four pixel formats are packed raw sRGB / Bayer > + formats with 12 bits per colour. Every four consecutive colour > + components are packed into 6 bytes. Each of the first 4 bytes > + contain the 8 high order bits of the pixels, and the fifth and > + sixth bytes contains the four least significants bits of each > + pixel, in the same order. > + > + Each n-pixel row contains n/2 green samples and n/2 blue > + or red samples, with alternating green-red and green-blue > + rows. They are conventionally described as GRGR... BGBG..., > + RGRG... GBGB..., etc. Below is an example of one of these > + formats: > + > + > + <constant>V4L2_PIX_FMT_SBGGR12P</constant> 4 × 4 > + pixel image > + > + > + Byte Order. > + Each cell is one byte. > + > + > + > + > + > + start + 0: > + B00high > + G01high > + G01low(bits 7--4) > + B00low(bits 3--0) > + > + B02high > + G03high > + G03low(bits 7--4) > + B02low(bits 3--0) > + > + > + > + start + 6: > + G10high > + R11high > + R11low(bits 7--4) > + G10low(bits 3--0) > + > + G12high > + R13high > + R13low(bits 7--4) > + G12low(bits 3--0) > + > + > + > + start + 12: > + B20high > + G21high > + G21low(bits 7--4) > + B20low(bits 3--0) > + > + B22high > + G23high > + G23low(bits 7--4) > + B22low(bits 3--0) > + > + > + > + start + 18: > + G30high > + R31high > + R31low(bits 7--4) > + G30low(bits 3--0) > + > + G32high > + R33high > + R33low(bits 7--4) > + G32low(bits 3--0) > + > + > + > + > + > + > + > + > + > + > diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml > index 5a08aee..457337e 100644 > --- a/Documentation/DocBook/media/v4l/pixfmt.xml > +++ b/Documentation/DocBook/media/v4l/pixfmt.xml > @@ -1593,6 +1593,7 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.< > &sub-srggb10alaw8; > &sub-srggb10dpcm8; > &sub-srggb12; > + &sub-srggb12p; > > >
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > index 8f95191..7ace868 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -576,6 +576,11 @@ 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 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') > +#define V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C') > +#define V4L2_PIX_FMT_SRGGB12P v4l2_fourcc('p', 'R', 'C', 'C') > #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ > > /* compressed formats */ >