From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mga01.intel.com ([192.55.52.88]:36594 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbcE0MsD (ORCPT ); Fri, 27 May 2016 08:48:03 -0400 From: Sakari Ailus To: linux-media@vger.kernel.org Cc: g.liakhovetski@gmx.de Subject: [PATCH 5/6] v4l: Add 14-bit raw bayer pixel format definitions Date: Fri, 27 May 2016 15:44:39 +0300 Message-Id: <1464353080-18300-6-git-send-email-sakari.ailus@linux.intel.com> In-Reply-To: <1464353080-18300-1-git-send-email-sakari.ailus@linux.intel.com> References: <1464353080-18300-1-git-send-email-sakari.ailus@linux.intel.com> Sender: linux-media-owner@vger.kernel.org List-ID: The formats added by this patch are: V4L2_PIX_FMT_SBGGR14 V4L2_PIX_FMT_SGBRG14 V4L2_PIX_FMT_SGRBG14 V4L2_PIX_FMT_SRGGB14 Signed-off-by: Jouni Ukkonen Signed-off-by: Sakari Ailus --- Documentation/DocBook/media/v4l/pixfmt-srggb14.xml | 90 ++++++++++++++++++++++ Documentation/DocBook/media/v4l/pixfmt.xml | 1 + include/uapi/linux/videodev2.h | 4 + 3 files changed, 95 insertions(+) create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb14.xml diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml new file mode 100644 index 0000000..7e82d7e --- /dev/null +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml @@ -0,0 +1,90 @@ + + + V4L2_PIX_FMT_SRGGB14 ('RG14'), + V4L2_PIX_FMT_SGRBG14 ('BA14'), + V4L2_PIX_FMT_SGBRG14 ('GB14'), + V4L2_PIX_FMT_SBGGR14 ('BG14'), + + &manvol; + + + V4L2_PIX_FMT_SRGGB14 + V4L2_PIX_FMT_SGRBG14 + V4L2_PIX_FMT_SGBRG14 + V4L2_PIX_FMT_SBGGR14 + 14-bit Bayer formats expanded to 16 bits + + + Description + + These four pixel formats are raw sRGB / Bayer formats with +14 bits per colour. Each colour component is stored in a 16-bit word, with 2 +unused high bits filled with zeros. Each n-pixel row contains n/2 green samples +and n/2 blue or red samples, with alternating red and blue rows. Bytes are +stored in memory in little endian order. They are conventionally described +as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example of one of these +formats + + + <constant>V4L2_PIX_FMT_SBGGR14</constant> 4 × 4 +pixel image + + + Byte Order. + Each cell is one byte, high 2 bits in high bytes are 0. + + + + + + start + 0: + B00low + B00high + G01low + G01high + B02low + B02high + G03low + G03high + + + start + 8: + G10low + G10high + R11low + R11high + G12low + G12high + R13low + R13high + + + start + 16: + B20low + B20high + G21low + G21high + B22low + B22high + G23low + G23high + + + start + 24: + G30low + G30high + R31low + R31high + G32low + G32high + R33low + R33high + + + + + + + + + diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml index 457337e..29e9d7c 100644 --- a/Documentation/DocBook/media/v4l/pixfmt.xml +++ b/Documentation/DocBook/media/v4l/pixfmt.xml @@ -1594,6 +1594,7 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.< &sub-srggb10dpcm8; &sub-srggb12; &sub-srggb12p; + &sub-srggb14;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 7ace868..2c4b076 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -581,6 +581,10 @@ struct v4l2_pix_format { #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_SBGGR14 v4l2_fourcc('B', 'G', '1', '4') /* 14 BGBG.. GRGR.. */ +#define V4L2_PIX_FMT_SGBRG14 v4l2_fourcc('G', 'B', '1', '4') /* 14 GBGB.. RGRG.. */ +#define V4L2_PIX_FMT_SGRBG14 v4l2_fourcc('B', 'A', '1', '4') /* 14 GRGR.. BGBG.. */ +#define V4L2_PIX_FMT_SRGGB14 v4l2_fourcc('R', 'G', '1', '4') /* 14 RGRG.. GBGB.. */ #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ /* compressed formats */ -- 1.9.1