From patchwork Mon Jun 20 16:20:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 9188159 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 A9C326075F for ; Mon, 20 Jun 2016 16:26:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9778526992 for ; Mon, 20 Jun 2016 16:26:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BA6827BE5; Mon, 20 Jun 2016 16:26:29 +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 56F8026992 for ; Mon, 20 Jun 2016 16:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754618AbcFTQ0W (ORCPT ); Mon, 20 Jun 2016 12:26:22 -0400 Received: from mga02.intel.com ([134.134.136.20]:7473 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755664AbcFTQZM (ORCPT ); Mon, 20 Jun 2016 12:25:12 -0400 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 20 Jun 2016 09:23:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,499,1459839600"; d="scan'208";a="125411609" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga004.fm.intel.com with ESMTP; 20 Jun 2016 09:23:49 -0700 Received: from nauris.fi.intel.com (nauris.localdomain [192.168.240.2]) by paasikivi.fi.intel.com (Postfix) with ESMTP id 79627209F2; Mon, 20 Jun 2016 19:23:48 +0300 (EEST) Received: by nauris.fi.intel.com (Postfix, from userid 1000) id EA2D1200BE; Mon, 20 Jun 2016 19:20:12 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl Subject: [PATCH v2 4/7] v4l: Add packed Bayer raw12 pixel formats Date: Mon, 20 Jun 2016 19:20:05 +0300 Message-Id: <1466439608-22890-5-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 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..12f0ac1 --- /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 */