From patchwork Fri May 27 12:44:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 9138257 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 52FC460467 for ; Fri, 27 May 2016 12:48:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44CD527BF4 for ; Fri, 27 May 2016 12:48:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39A6728093; Fri, 27 May 2016 12:48:11 +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 A1BF827BF4 for ; Fri, 27 May 2016 12:48:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752861AbcE0MsG (ORCPT ); Fri, 27 May 2016 08:48:06 -0400 Received: from mga09.intel.com ([134.134.136.24]:39513 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752611AbcE0MsD (ORCPT ); Fri, 27 May 2016 08:48:03 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 27 May 2016 05:48:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,374,1459839600"; d="scan'208";a="709807341" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by FMSMGA003.fm.intel.com with ESMTP; 27 May 2016 05:48:00 -0700 Received: from nauris.fi.intel.com (nauris.localdomain [192.168.240.2]) by paasikivi.fi.intel.com (Postfix) with ESMTP id 45FEE20C6E; Fri, 27 May 2016 15:47:58 +0300 (EEST) Received: by nauris.fi.intel.com (Postfix, from userid 1000) id F17C32014E; Fri, 27 May 2016 15:44:42 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: g.liakhovetski@gmx.de Subject: [PATCH 6/6] v4l: Add packed Bayer raw14 pixel formats Date: Fri, 27 May 2016 15:44:40 +0300 Message-Id: <1464353080-18300-7-git-send-email-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 1.9.1 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 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These formats are compressed 14-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_SBGGR14P V4L2_PIX_FMT_SGBRG14P V4L2_PIX_FMT_SGRBG14P V4L2_PIX_FMT_SRGGB14P Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil --- .../DocBook/media/v4l/pixfmt-srggb14p.xml | 118 +++++++++++++++++++++ Documentation/DocBook/media/v4l/pixfmt.xml | 1 + include/uapi/linux/videodev2.h | 5 + 3 files changed, 124 insertions(+) create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml new file mode 100644 index 0000000..ecb06ef --- /dev/null +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml @@ -0,0 +1,118 @@ + + + V4L2_PIX_FMT_SRGGB14P ('pREE'), + V4L2_PIX_FMT_SGRBG14P ('pgEE'), + V4L2_PIX_FMT_SGBRG14P ('pGEE'), + V4L2_PIX_FMT_SBGGR14P ('pBEE'), + + &manvol; + + + V4L2_PIX_FMT_SRGGB14P + V4L2_PIX_FMT_SGRBG14P + V4L2_PIX_FMT_SGBRG14P + V4L2_PIX_FMT_SBGGR14P + 14-bit packed Bayer formats + + + Description + + These four pixel formats are packed raw sRGB / Bayer + formats with 14 bits per colour. Every four consecutive colour + components are packed into 7 bytes. Each of the first 4 bytes + contain the 8 high order bits of the pixels, and the fifth, sixth + and seventh bytes contains the six 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_SBGGR14P</constant> 4 × 4 + pixel image + + + Byte Order. + Each cell is one byte. The bits in subscript denote bits + of the sample. The bits of the cell byte can be found in + parentheses. + + + + + + + start + 0: + B00 bits 13--8 + G01 bits 13--8 + B02 bits 13--8 + G03 bits 13--8 + G01 bits 1--0(bits 7--6) + B00 bits 5--0(bits 5--0) + + B02 bits 3--0(bits 7--4) + G01 bits 5--2(bits 3--0) + + G03 bits 5--0(bits 7--2) + B02 bits 5--4(bits 1--0) + + + + start + 7: + G10 bits 13--8 + R11 bits 13--8 + G12 bits 13--8 + R13 bits 13--8 + R11 bits 1--0(bits 7--6) + B10 bits 5--0(bits 5--0) + + R12 bits 3--0(bits 7--4) + G11 bits 5--2(bits 3--0) + + R13 bits 5--0(bits 7--2) + B12 bits 5--4(bits 1--0) + + + + start + 14: + B20 bits 13--8 + G21 bits 13--8 + B22 bits 13--8 + G23 bits 13--8 + G21 bits 1--0(bits 7--6) + B20 bits 5--0(bits 5--0) + + B22 bits 3--0(bits 7--4) + G21 bits 5--2(bits 3--0) + + G23 bits 5--0(bits 7--2) + B22 bits 5--4(bits 1--0) + + + + start + 21: + G30 bits 13--8 + R31 bits 13--8 + G32 bits 13--8 + R33 bits 13--8 + R31 bits 1--0(bits 7--6) + B30 bits 5--0(bits 5--0) + + R32 bits 3--0(bits 7--4) + G31 bits 5--2(bits 3--0) + + R33 bits 5--0(bits 7--2) + B32 bits 5--4(bits 1--0) + + + + + + + + + + diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml index 29e9d7c..296a50a 100644 --- a/Documentation/DocBook/media/v4l/pixfmt.xml +++ b/Documentation/DocBook/media/v4l/pixfmt.xml @@ -1595,6 +1595,7 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.< &sub-srggb12; &sub-srggb12p; &sub-srggb14; + &sub-srggb14p;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 2c4b076..63d141e 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -585,6 +585,11 @@ struct v4l2_pix_format { #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.. */ + /* 14bit raw bayer packed, 7 bytes for every 4 pixels */ +#define V4L2_PIX_FMT_SBGGR14P v4l2_fourcc('p', 'B', 'E', 'E') +#define V4L2_PIX_FMT_SGBRG14P v4l2_fourcc('p', 'G', 'E', 'E') +#define V4L2_PIX_FMT_SGRBG14P v4l2_fourcc('p', 'g', 'E', 'E') +#define V4L2_PIX_FMT_SRGGB14P v4l2_fourcc('p', 'R', 'E', 'E') #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ /* compressed formats */