From patchwork Mon Jun 20 16:20:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 9188175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1DECE6075F for ; Mon, 20 Jun 2016 16:27:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C0C526992 for ; Mon, 20 Jun 2016 16:27:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 010D427B2F; Mon, 20 Jun 2016 16:26:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 278CB26992 for ; Mon, 20 Jun 2016 16:26:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932134AbcFTQ02 (ORCPT ); Mon, 20 Jun 2016 12:26:28 -0400 Received: from mga11.intel.com ([192.55.52.93]:42558 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753516AbcFTQZM (ORCPT ); Mon, 20 Jun 2016 12:25:12 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 20 Jun 2016 09:23:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,499,1459839600"; d="scan'208";a="991501640" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga001.fm.intel.com with ESMTP; 20 Jun 2016 09:23:51 -0700 Received: from nauris.fi.intel.com (nauris.localdomain [192.168.240.2]) by paasikivi.fi.intel.com (Postfix) with ESMTP id C6A9F20A01; Mon, 20 Jun 2016 19:23:48 +0300 (EEST) Received: by nauris.fi.intel.com (Postfix, from userid 1000) id 6942C200CB; Mon, 20 Jun 2016 19:20:13 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl Subject: [PATCH v2 6/7] v4l: Add 14-bit raw bayer pixel format definitions Date: Mon, 20 Jun 2016 19:20:07 +0300 Message-Id: <1466439608-22890-7-git-send-email-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466439608-22890-1-git-send-email-sakari.ailus@linux.intel.com> References: <1466439608-22890-1-git-send-email-sakari.ailus@linux.intel.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Hans Verkuil --- Documentation/DocBook/media/v4l/pixfmt-srggb14.xml | 91 ++++++++++++++++++++++ Documentation/DocBook/media/v4l/pixfmt.xml | 1 + include/uapi/linux/videodev2.h | 4 + 3 files changed, 96 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..3b9d2cc --- /dev/null +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml @@ -0,0 +1,91 @@ + + + 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, the 2 most significant bits in the 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 */