From patchwork Fri May 27 12:44:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 9138259 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 9884E60467 for ; Fri, 27 May 2016 12:48:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A22F27BF4 for ; Fri, 27 May 2016 12:48:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EC7028093; Fri, 27 May 2016 12:48:13 +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 F204A27BF4 for ; Fri, 27 May 2016 12:48:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752678AbcE0MsD (ORCPT ); Fri, 27 May 2016 08:48:03 -0400 Received: from mga03.intel.com ([134.134.136.65]:15727 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbcE0MsA (ORCPT ); Fri, 27 May 2016 08:48:00 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 27 May 2016 05:47:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,374,1459839600"; d="scan'208";a="989964905" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga002.fm.intel.com with ESMTP; 27 May 2016 05:47:58 -0700 Received: from nauris.fi.intel.com (nauris.localdomain [192.168.240.2]) by paasikivi.fi.intel.com (Postfix) with ESMTP id CE8BB20AB8; Fri, 27 May 2016 15:47:57 +0300 (EEST) Received: by nauris.fi.intel.com (Postfix, from userid 1000) id 8E37A2020E; 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 3/6] v4l: Add packed Bayer raw12 pixel formats Date: Fri, 27 May 2016 15:44:37 +0300 Message-Id: <1464353080-18300-4-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 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 Acked-by: Hans Verkuil --- .../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'), + + &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 */