All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] New raw bayer format definitions, fixes
@ 2016-06-20 16:20 Sakari Ailus
  2016-06-20 16:20 ` [PATCH v2 1/7] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats Sakari Ailus
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: Sakari Ailus @ 2016-06-20 16:20 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil

Hi all,

These patches fix and add new raw bayer format definitions. 12-bit packed
V4L2 format definition is added as well as definitions of 14-bit media bus
codes as well as unpacked and packed V4L2 formats.

No driver uses them right now, yet they're common formats needed by newer
devices that use higher bit depths so adding them would make sense.

since v1:

- Fix issues Hans pointed out in his review,

- add one patch to fix similar issues in already defined 10-bit and 12-bit
  formats found in 14-bit format definitions.

The previous set with the review comments can be found here:

<URL:http://www.spinics.net/lists/linux-media/msg100763.html>

-- 
Kind regards,
Sakari


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 1/7] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats
  2016-06-20 16:20 [PATCH v2 0/7] New raw bayer format definitions, fixes Sakari Ailus
@ 2016-06-20 16:20 ` Sakari Ailus
  2016-06-20 17:03   ` Hans Verkuil
  2016-06-20 16:20 ` [PATCH v2 2/7] v4l: Fix number of zeroed high order bits in 12-bit raw format defs Sakari Ailus
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Sakari Ailus @ 2016-06-20 16:20 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil

The 10-bit packed raw bayer format documented that the data of the first
pixel of a four-pixel group was found in the first byte and the two
highest bits of the fifth byte. This was not entirely correct. The two
bits in the fifth byte are the two lowest bits. The second pixel occupies
the second byte and third and fourth least significant bits and so on.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 .../DocBook/media/v4l/pixfmt-srggb10p.xml          | 32 +++++++++++-----------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
index a8cc102..747822b 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
@@ -47,10 +47,10 @@
 		  <entry>G<subscript>01high</subscript></entry>
 		  <entry>B<subscript>02high</subscript></entry>
 		  <entry>G<subscript>03high</subscript></entry>
-		  <entry>B<subscript>00low</subscript>(bits 7--6)
-			 G<subscript>01low</subscript>(bits 5--4)
-			 B<subscript>02low</subscript>(bits 3--2)
-			 G<subscript>03low</subscript>(bits 1--0)
+		  <entry>G<subscript>03low</subscript>(bits 7--6)
+			 B<subscript>02low</subscript>(bits 5--4)
+			 G<subscript>01low</subscript>(bits 3--2)
+			 B<subscript>00low</subscript>(bits 1--0)
 		  </entry>
 		</row>
 		<row>
@@ -59,10 +59,10 @@
 		  <entry>R<subscript>11high</subscript></entry>
 		  <entry>G<subscript>12high</subscript></entry>
 		  <entry>R<subscript>13high</subscript></entry>
-		  <entry>G<subscript>10low</subscript>(bits 7--6)
-			 R<subscript>11low</subscript>(bits 5--4)
-			 G<subscript>12low</subscript>(bits 3--2)
-			 R<subscript>13low</subscript>(bits 1--0)
+		  <entry>R<subscript>13low</subscript>(bits 7--6)
+			 G<subscript>12low</subscript>(bits 5--4)
+			 R<subscript>11low</subscript>(bits 3--2)
+			 G<subscript>10low</subscript>(bits 1--0)
 		  </entry>
 		</row>
 		<row>
@@ -71,10 +71,10 @@
 		  <entry>G<subscript>21high</subscript></entry>
 		  <entry>B<subscript>22high</subscript></entry>
 		  <entry>G<subscript>23high</subscript></entry>
-		  <entry>B<subscript>20low</subscript>(bits 7--6)
-			 G<subscript>21low</subscript>(bits 5--4)
-			 B<subscript>22low</subscript>(bits 3--2)
-			 G<subscript>23low</subscript>(bits 1--0)
+		  <entry>G<subscript>23low</subscript>(bits 7--6)
+			 B<subscript>22low</subscript>(bits 5--4)
+			 G<subscript>21low</subscript>(bits 3--2)
+			 B<subscript>20low</subscript>(bits 1--0)
 		  </entry>
 		</row>
 		<row>
@@ -83,10 +83,10 @@
 		  <entry>R<subscript>31high</subscript></entry>
 		  <entry>G<subscript>32high</subscript></entry>
 		  <entry>R<subscript>33high</subscript></entry>
-		  <entry>G<subscript>30low</subscript>(bits 7--6)
-			 R<subscript>31low</subscript>(bits 5--4)
-			 G<subscript>32low</subscript>(bits 3--2)
-			 R<subscript>33low</subscript>(bits 1--0)
+		  <entry>R<subscript>33low</subscript>(bits 7--6)
+			 G<subscript>32low</subscript>(bits 5--4)
+			 R<subscript>31low</subscript>(bits 3--2)
+			 G<subscript>30low</subscript>(bits 1--0)
 		  </entry>
 		</row>
 	      </tbody>
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 2/7] v4l: Fix number of zeroed high order bits in 12-bit raw format defs
  2016-06-20 16:20 [PATCH v2 0/7] New raw bayer format definitions, fixes Sakari Ailus
  2016-06-20 16:20 ` [PATCH v2 1/7] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats Sakari Ailus
@ 2016-06-20 16:20 ` Sakari Ailus
  2016-06-20 16:54   ` Hans Verkuil
  2016-06-20 16:20 ` [PATCH v2 3/7] v4l: Clean up raw bayer pixel format definitions Sakari Ailus
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Sakari Ailus @ 2016-06-20 16:20 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil

The number of high order bits in samples was documented to be 6 for 12-bit
data. This is clearly wrong, fix it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 Documentation/DocBook/media/v4l/pixfmt-srggb12.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
index 0c8e4ad..4394101 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
@@ -31,7 +31,7 @@ pixel image</title>
 
       <formalpara>
 	<title>Byte Order.</title>
-	<para>Each cell is one byte, high 6 bits in high bytes are 0.
+	<para>Each cell is one byte, high 4 bits in high bytes are 0.
 	  <informaltable frame="none">
 	    <tgroup cols="5" align="center">
 	      <colspec align="left" colwidth="2*" />
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 3/7] v4l: Clean up raw bayer pixel format definitions
  2016-06-20 16:20 [PATCH v2 0/7] New raw bayer format definitions, fixes Sakari Ailus
  2016-06-20 16:20 ` [PATCH v2 1/7] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats Sakari Ailus
  2016-06-20 16:20 ` [PATCH v2 2/7] v4l: Fix number of zeroed high order bits in 12-bit raw format defs Sakari Ailus
@ 2016-06-20 16:20 ` Sakari Ailus
  2016-06-20 16:54   ` Hans Verkuil
  2016-06-20 16:20 ` [PATCH v2 4/7] v4l: Add packed Bayer raw12 pixel formats Sakari Ailus
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Sakari Ailus @ 2016-06-20 16:20 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil

- Explicitly state that the most significant n bits are zeroed on 10 and
  12 bpp formats.
- Remove extra comma from the last entry of the format list
- Add a missing colon before a list

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 Documentation/DocBook/media/v4l/pixfmt-srggb10.xml  | 5 +++--
 Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml | 2 +-
 Documentation/DocBook/media/v4l/pixfmt-srggb12.xml  | 5 +++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml
index f34d03e..cd3f915 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml
@@ -23,7 +23,7 @@ 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</para>
+formats:</para>
 
     <example>
       <title><constant>V4L2_PIX_FMT_SBGGR10</constant> 4 &times; 4
@@ -31,7 +31,8 @@ pixel image</title>
 
       <formalpara>
 	<title>Byte Order.</title>
-	<para>Each cell is one byte, high 6 bits in high bytes are 0.
+	<para>Each cell is one byte, the 6 most significant bits in the high
+	      bytes are 0.
 	  <informaltable frame="none">
 	    <tgroup cols="5" align="center">
 	      <colspec align="left" colwidth="2*" />
diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
index 747822b..18bb722 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
@@ -3,7 +3,7 @@
 	<refentrytitle>V4L2_PIX_FMT_SRGGB10P ('pRAA'),
 	 V4L2_PIX_FMT_SGRBG10P ('pgAA'),
 	 V4L2_PIX_FMT_SGBRG10P ('pGAA'),
-	 V4L2_PIX_FMT_SBGGR10P ('pBAA'),
+	 V4L2_PIX_FMT_SBGGR10P ('pBAA')
 	 </refentrytitle>
 	&manvol;
       </refmeta>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
index 4394101..2d8efeb 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
@@ -23,7 +23,7 @@ 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</para>
+formats:</para>
 
     <example>
       <title><constant>V4L2_PIX_FMT_SBGGR12</constant> 4 &times; 4
@@ -31,7 +31,8 @@ pixel image</title>
 
       <formalpara>
 	<title>Byte Order.</title>
-	<para>Each cell is one byte, high 4 bits in high bytes are 0.
+	<para>Each cell is one byte, the 4 most significant bits in the high
+	      bytes are 0.
 	  <informaltable frame="none">
 	    <tgroup cols="5" align="center">
 	      <colspec align="left" colwidth="2*" />
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 4/7] v4l: Add packed Bayer raw12 pixel formats
  2016-06-20 16:20 [PATCH v2 0/7] New raw bayer format definitions, fixes Sakari Ailus
                   ` (2 preceding siblings ...)
  2016-06-20 16:20 ` [PATCH v2 3/7] v4l: Clean up raw bayer pixel format definitions Sakari Ailus
@ 2016-06-20 16:20 ` Sakari Ailus
  2016-06-20 16:20 ` [PATCH v2 5/7] media: Add 1X14 14-bit raw bayer media bus code definitions Sakari Ailus
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Sakari Ailus @ 2016-06-20 16:20 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil

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 <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 .../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 @@
+    <refentry id="pixfmt-srggb12p">
+      <refmeta>
+	<refentrytitle>V4L2_PIX_FMT_SRGGB12P ('pRCC'),
+	 V4L2_PIX_FMT_SGRBG12P ('pgCC'),
+	 V4L2_PIX_FMT_SGBRG12P ('pGCC'),
+	 V4L2_PIX_FMT_SBGGR12P ('pBCC')
+	 </refentrytitle>
+	&manvol;
+      </refmeta>
+      <refnamediv>
+	<refname id="V4L2-PIX-FMT-SRGGB12P"><constant>V4L2_PIX_FMT_SRGGB12P</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGRBG12P"><constant>V4L2_PIX_FMT_SGRBG12P</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGBRG12P"><constant>V4L2_PIX_FMT_SGBRG12P</constant></refname>
+	<refname id="V4L2-PIX-FMT-SBGGR12P"><constant>V4L2_PIX_FMT_SBGGR12P</constant></refname>
+	<refpurpose>12-bit packed Bayer formats</refpurpose>
+      </refnamediv>
+      <refsect1>
+	<title>Description</title>
+
+	<para>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.</para>
+
+	<para>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:</para>
+
+    <example>
+      <title><constant>V4L2_PIX_FMT_SBGGR12P</constant> 4 &times; 4
+      pixel image</title>
+
+      <formalpara>
+	<title>Byte Order.</title>
+	<para>Each cell is one byte.
+	  <informaltable frame="topbot" colsep="1" rowsep="1">
+	    <tgroup cols="6" align="center">
+	      <colspec align="left" colwidth="2*" />
+	      <tbody valign="top">
+		<row>
+		  <entry>start&nbsp;+&nbsp;0:</entry>
+		  <entry>B<subscript>00high</subscript></entry>
+		  <entry>G<subscript>01high</subscript></entry>
+		  <entry>G<subscript>01low</subscript>(bits 7--4)
+			 B<subscript>00low</subscript>(bits 3--0)
+		  </entry>
+		  <entry>B<subscript>02high</subscript></entry>
+		  <entry>G<subscript>03high</subscript></entry>
+		  <entry>G<subscript>03low</subscript>(bits 7--4)
+			 B<subscript>02low</subscript>(bits 3--0)
+		  </entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;6:</entry>
+		  <entry>G<subscript>10high</subscript></entry>
+		  <entry>R<subscript>11high</subscript></entry>
+		  <entry>R<subscript>11low</subscript>(bits 7--4)
+			 G<subscript>10low</subscript>(bits 3--0)
+		  </entry>
+		  <entry>G<subscript>12high</subscript></entry>
+		  <entry>R<subscript>13high</subscript></entry>
+		  <entry>R<subscript>13low</subscript>(bits 7--4)
+			 G<subscript>12low</subscript>(bits 3--0)
+		  </entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;12:</entry>
+		  <entry>B<subscript>20high</subscript></entry>
+		  <entry>G<subscript>21high</subscript></entry>
+		  <entry>G<subscript>21low</subscript>(bits 7--4)
+			 B<subscript>20low</subscript>(bits 3--0)
+		  </entry>
+		  <entry>B<subscript>22high</subscript></entry>
+		  <entry>G<subscript>23high</subscript></entry>
+		  <entry>G<subscript>23low</subscript>(bits 7--4)
+			 B<subscript>22low</subscript>(bits 3--0)
+		  </entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;18:</entry>
+		  <entry>G<subscript>30high</subscript></entry>
+		  <entry>R<subscript>31high</subscript></entry>
+		  <entry>R<subscript>31low</subscript>(bits 7--4)
+			 G<subscript>30low</subscript>(bits 3--0)
+		  </entry>
+		  <entry>G<subscript>32high</subscript></entry>
+		  <entry>R<subscript>33high</subscript></entry>
+		  <entry>R<subscript>33low</subscript>(bits 7--4)
+			 G<subscript>32low</subscript>(bits 3--0)
+		  </entry>
+		</row>
+	      </tbody>
+	    </tgroup>
+	  </informaltable>
+	</para>
+      </formalpara>
+    </example>
+  </refsect1>
+</refentry>
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;
   </section>
 
   <section id="yuv-formats">
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 */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 5/7] media: Add 1X14 14-bit raw bayer media bus code definitions
  2016-06-20 16:20 [PATCH v2 0/7] New raw bayer format definitions, fixes Sakari Ailus
                   ` (3 preceding siblings ...)
  2016-06-20 16:20 ` [PATCH v2 4/7] v4l: Add packed Bayer raw12 pixel formats Sakari Ailus
@ 2016-06-20 16:20 ` Sakari Ailus
  2016-06-20 16:20 ` [PATCH v2 6/7] v4l: Add 14-bit raw bayer pixel format definitions Sakari Ailus
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Sakari Ailus @ 2016-06-20 16:20 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil, Jouni Ukkonen

From: Jouni Ukkonen <jouni.ukkonen@intel.com>

The codes will be called:

	MEDIA_BUS_FMT_SBGGR14_1X14
	MEDIA_BUS_FMT_SGBRG14_1X14
	MEDIA_BUS_FMT_SGRBG14_1X14
	MEDIA_BUS_FMT_SRGGB14_1X14

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 Documentation/DocBook/media/v4l/subdev-formats.xml | 162 +++++++++++++++++++--
 include/uapi/linux/media-bus-format.h              |   6 +-
 2 files changed, 154 insertions(+), 14 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml
index 199c84e..6d45dc8 100644
--- a/Documentation/DocBook/media/v4l/subdev-formats.xml
+++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
@@ -1098,22 +1098,24 @@ see <xref linkend="colorspaces" />.</entry>
 
       <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-bayer">
 	<title>Bayer Formats</title>
-	<tgroup cols="15">
+	<tgroup cols="17">
 	  <colspec colname="id" align="left" />
 	  <colspec colname="code" align="center"/>
 	  <colspec colname="bit" />
-	  <colspec colnum="4" colname="b11" align="center" />
-	  <colspec colnum="5" colname="b10" align="center" />
-	  <colspec colnum="6" colname="b09" align="center" />
-	  <colspec colnum="7" colname="b08" align="center" />
-	  <colspec colnum="8" colname="b07" align="center" />
-	  <colspec colnum="9" colname="b06" align="center" />
-	  <colspec colnum="10" colname="b05" align="center" />
-	  <colspec colnum="11" colname="b04" align="center" />
-	  <colspec colnum="12" colname="b03" align="center" />
-	  <colspec colnum="13" colname="b02" align="center" />
-	  <colspec colnum="14" colname="b01" align="center" />
-	  <colspec colnum="15" colname="b00" align="center" />
+	  <colspec colnum="4" colname="b13" align="center" />
+	  <colspec colnum="5" colname="b12" align="center" />
+	  <colspec colnum="6" colname="b11" align="center" />
+	  <colspec colnum="7" colname="b10" align="center" />
+	  <colspec colnum="8" colname="b09" align="center" />
+	  <colspec colnum="9" colname="b08" align="center" />
+	  <colspec colnum="10" colname="b07" align="center" />
+	  <colspec colnum="11" colname="b06" align="center" />
+	  <colspec colnum="12" colname="b05" align="center" />
+	  <colspec colnum="13" colname="b04" align="center" />
+	  <colspec colnum="14" colname="b03" align="center" />
+	  <colspec colnum="15" colname="b02" align="center" />
+	  <colspec colnum="16" colname="b01" align="center" />
+	  <colspec colnum="17" colname="b00" align="center" />
 	  <spanspec namest="b11" nameend="b00" spanname="b0" />
 	  <thead>
 	    <row>
@@ -1126,6 +1128,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry></entry>
 	      <entry>Bit</entry>
+	      <entry>13</entry>
+	      <entry>12</entry>
 	      <entry>11</entry>
 	      <entry>10</entry>
 	      <entry>9</entry>
@@ -1149,6 +1153,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>7</subscript></entry>
 	      <entry>b<subscript>6</subscript></entry>
 	      <entry>b<subscript>5</subscript></entry>
@@ -1166,6 +1172,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1183,6 +1191,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1200,6 +1210,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>r<subscript>7</subscript></entry>
 	      <entry>r<subscript>6</subscript></entry>
 	      <entry>r<subscript>5</subscript></entry>
@@ -1217,6 +1229,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>7</subscript></entry>
 	      <entry>b<subscript>6</subscript></entry>
 	      <entry>b<subscript>5</subscript></entry>
@@ -1234,6 +1248,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1251,6 +1267,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1268,6 +1286,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>r<subscript>7</subscript></entry>
 	      <entry>r<subscript>6</subscript></entry>
 	      <entry>r<subscript>5</subscript></entry>
@@ -1285,6 +1305,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>7</subscript></entry>
 	      <entry>b<subscript>6</subscript></entry>
 	      <entry>b<subscript>5</subscript></entry>
@@ -1302,6 +1324,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1319,6 +1343,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1336,6 +1362,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>r<subscript>7</subscript></entry>
 	      <entry>r<subscript>6</subscript></entry>
 	      <entry>r<subscript>5</subscript></entry>
@@ -1353,6 +1381,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>0</entry>
 	      <entry>0</entry>
 	      <entry>0</entry>
@@ -1370,6 +1400,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>7</subscript></entry>
 	      <entry>b<subscript>6</subscript></entry>
 	      <entry>b<subscript>5</subscript></entry>
@@ -1387,6 +1419,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>7</subscript></entry>
 	      <entry>b<subscript>6</subscript></entry>
 	      <entry>b<subscript>5</subscript></entry>
@@ -1404,6 +1438,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>0</entry>
 	      <entry>0</entry>
 	      <entry>0</entry>
@@ -1421,6 +1457,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>9</subscript></entry>
 	      <entry>b<subscript>8</subscript></entry>
 	      <entry>b<subscript>7</subscript></entry>
@@ -1438,6 +1476,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>1</subscript></entry>
 	      <entry>b<subscript>0</subscript></entry>
 	      <entry>0</entry>
@@ -1455,6 +1495,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>1</subscript></entry>
 	      <entry>b<subscript>0</subscript></entry>
 	      <entry>0</entry>
@@ -1472,6 +1514,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>9</subscript></entry>
 	      <entry>b<subscript>8</subscript></entry>
 	      <entry>b<subscript>7</subscript></entry>
@@ -1487,6 +1531,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>9</subscript></entry>
 	      <entry>b<subscript>8</subscript></entry>
 	      <entry>b<subscript>7</subscript></entry>
@@ -1504,6 +1550,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>9</subscript></entry>
 	      <entry>g<subscript>8</subscript></entry>
 	      <entry>g<subscript>7</subscript></entry>
@@ -1521,6 +1569,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>9</subscript></entry>
 	      <entry>g<subscript>8</subscript></entry>
 	      <entry>g<subscript>7</subscript></entry>
@@ -1538,6 +1588,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>r<subscript>9</subscript></entry>
 	      <entry>r<subscript>8</subscript></entry>
 	      <entry>r<subscript>7</subscript></entry>
@@ -1553,6 +1605,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SBGGR12_1X12</entry>
 	      <entry>0x3008</entry>
 	      <entry></entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>11</subscript></entry>
 	      <entry>b<subscript>10</subscript></entry>
 	      <entry>b<subscript>9</subscript></entry>
@@ -1570,6 +1624,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SGBRG12_1X12</entry>
 	      <entry>0x3010</entry>
 	      <entry></entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>11</subscript></entry>
 	      <entry>g<subscript>10</subscript></entry>
 	      <entry>g<subscript>9</subscript></entry>
@@ -1587,6 +1643,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SGRBG12_1X12</entry>
 	      <entry>0x3011</entry>
 	      <entry></entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>11</subscript></entry>
 	      <entry>g<subscript>10</subscript></entry>
 	      <entry>g<subscript>9</subscript></entry>
@@ -1604,6 +1662,84 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SRGGB12_1X12</entry>
 	      <entry>0x3012</entry>
 	      <entry></entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>r<subscript>11</subscript></entry>
+	      <entry>r<subscript>10</subscript></entry>
+	      <entry>r<subscript>9</subscript></entry>
+	      <entry>r<subscript>8</subscript></entry>
+	      <entry>r<subscript>7</subscript></entry>
+	      <entry>r<subscript>6</subscript></entry>
+	      <entry>r<subscript>5</subscript></entry>
+	      <entry>r<subscript>4</subscript></entry>
+	      <entry>r<subscript>3</subscript></entry>
+	      <entry>r<subscript>2</subscript></entry>
+	      <entry>r<subscript>1</subscript></entry>
+	      <entry>r<subscript>0</subscript></entry>
+	    </row>
+	    <row id="MEDIA-BUS-FMT-SBGGR14-1X14">
+	      <entry>MEDIA_BUS_FMT_SBGGR14_1X14</entry>
+	      <entry>0x3019</entry>
+	      <entry></entry>
+	      <entry>b<subscript>13</subscript></entry>
+	      <entry>b<subscript>12</subscript></entry>
+	      <entry>b<subscript>11</subscript></entry>
+	      <entry>b<subscript>10</subscript></entry>
+	      <entry>b<subscript>9</subscript></entry>
+	      <entry>b<subscript>8</subscript></entry>
+	      <entry>b<subscript>7</subscript></entry>
+	      <entry>b<subscript>6</subscript></entry>
+	      <entry>b<subscript>5</subscript></entry>
+	      <entry>b<subscript>4</subscript></entry>
+	      <entry>b<subscript>3</subscript></entry>
+	      <entry>b<subscript>2</subscript></entry>
+	      <entry>b<subscript>1</subscript></entry>
+	      <entry>b<subscript>0</subscript></entry>
+	    </row>
+	    <row id="MEDIA-BUS-FMT-SGBRG14-1X14">
+	      <entry>MEDIA_BUS_FMT_SGBRG14_1X14</entry>
+	      <entry>0x301a</entry>
+	      <entry></entry>
+	      <entry>g<subscript>13</subscript></entry>
+	      <entry>g<subscript>12</subscript></entry>
+	      <entry>g<subscript>11</subscript></entry>
+	      <entry>g<subscript>10</subscript></entry>
+	      <entry>g<subscript>9</subscript></entry>
+	      <entry>g<subscript>8</subscript></entry>
+	      <entry>g<subscript>7</subscript></entry>
+	      <entry>g<subscript>6</subscript></entry>
+	      <entry>g<subscript>5</subscript></entry>
+	      <entry>g<subscript>4</subscript></entry>
+	      <entry>g<subscript>3</subscript></entry>
+	      <entry>g<subscript>2</subscript></entry>
+	      <entry>g<subscript>1</subscript></entry>
+	      <entry>g<subscript>0</subscript></entry>
+	    </row>
+	    <row id="MEDIA-BUS-FMT-SGRBG14-1X14">
+	      <entry>MEDIA_BUS_FMT_SGRBG14_1X14</entry>
+	      <entry>0x301b</entry>
+	      <entry></entry>
+	      <entry>g<subscript>13</subscript></entry>
+	      <entry>g<subscript>12</subscript></entry>
+	      <entry>g<subscript>11</subscript></entry>
+	      <entry>g<subscript>10</subscript></entry>
+	      <entry>g<subscript>9</subscript></entry>
+	      <entry>g<subscript>8</subscript></entry>
+	      <entry>g<subscript>7</subscript></entry>
+	      <entry>g<subscript>6</subscript></entry>
+	      <entry>g<subscript>5</subscript></entry>
+	      <entry>g<subscript>4</subscript></entry>
+	      <entry>g<subscript>3</subscript></entry>
+	      <entry>g<subscript>2</subscript></entry>
+	      <entry>g<subscript>1</subscript></entry>
+	      <entry>g<subscript>0</subscript></entry>
+	    </row>
+	    <row id="MEDIA-BUS-FMT-SRGGB14-1X14">
+	      <entry>MEDIA_BUS_FMT_SRGGB14_1X14</entry>
+	      <entry>0x301c</entry>
+	      <entry></entry>
+	      <entry>r<subscript>13</subscript></entry>
+	      <entry>r<subscript>12</subscript></entry>
 	      <entry>r<subscript>11</subscript></entry>
 	      <entry>r<subscript>10</subscript></entry>
 	      <entry>r<subscript>9</subscript></entry>
diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
index 190d491..1dff459 100644
--- a/include/uapi/linux/media-bus-format.h
+++ b/include/uapi/linux/media-bus-format.h
@@ -97,7 +97,7 @@
 #define MEDIA_BUS_FMT_YUV10_1X30		0x2016
 #define MEDIA_BUS_FMT_AYUV8_1X32		0x2017
 
-/* Bayer - next is	0x3019 */
+/* Bayer - next is	0x301d */
 #define MEDIA_BUS_FMT_SBGGR8_1X8		0x3001
 #define MEDIA_BUS_FMT_SGBRG8_1X8		0x3013
 #define MEDIA_BUS_FMT_SGRBG8_1X8		0x3002
@@ -122,6 +122,10 @@
 #define MEDIA_BUS_FMT_SGBRG12_1X12		0x3010
 #define MEDIA_BUS_FMT_SGRBG12_1X12		0x3011
 #define MEDIA_BUS_FMT_SRGGB12_1X12		0x3012
+#define MEDIA_BUS_FMT_SBGGR14_1X14		0x3019
+#define MEDIA_BUS_FMT_SGBRG14_1X14		0x301a
+#define MEDIA_BUS_FMT_SGRBG14_1X14		0x301b
+#define MEDIA_BUS_FMT_SRGGB14_1X14		0x301c
 
 /* JPEG compressed formats - next is	0x4002 */
 #define MEDIA_BUS_FMT_JPEG_1X8			0x4001
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 6/7] v4l: Add 14-bit raw bayer pixel format definitions
  2016-06-20 16:20 [PATCH v2 0/7] New raw bayer format definitions, fixes Sakari Ailus
                   ` (4 preceding siblings ...)
  2016-06-20 16:20 ` [PATCH v2 5/7] media: Add 1X14 14-bit raw bayer media bus code definitions Sakari Ailus
@ 2016-06-20 16:20 ` Sakari Ailus
  2016-06-27 14:45   ` [PATCH v2.1 6/9] " Sakari Ailus
  2016-06-20 16:20 ` [PATCH v2 7/7] v4l: Add packed Bayer raw14 pixel formats Sakari Ailus
  2016-06-27 14:57 ` [PATCH v2.1 8/9] media: Add 1X16 16-bit raw bayer media bus code definitions Sakari Ailus
  7 siblings, 1 reply; 21+ messages in thread
From: Sakari Ailus @ 2016-06-20 16:20 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil

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 <jouni.ukkonen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 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 @@
+    <refentry>
+      <refmeta>
+	<refentrytitle>V4L2_PIX_FMT_SRGGB14 ('RG14'),
+	 V4L2_PIX_FMT_SGRBG14 ('BA14'),
+	 V4L2_PIX_FMT_SGBRG14 ('GB14'),
+	 V4L2_PIX_FMT_SBGGR14 ('BG14')
+	 </refentrytitle>
+	&manvol;
+      </refmeta>
+      <refnamediv>
+	<refname id="V4L2-PIX-FMT-SRGGB14"><constant>V4L2_PIX_FMT_SRGGB14</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGRBG14"><constant>V4L2_PIX_FMT_SGRBG14</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGBRG14"><constant>V4L2_PIX_FMT_SGBRG14</constant></refname>
+	<refname id="V4L2-PIX-FMT-SBGGR14"><constant>V4L2_PIX_FMT_SBGGR14</constant></refname>
+	<refpurpose>14-bit Bayer formats expanded to 16 bits</refpurpose>
+      </refnamediv>
+      <refsect1>
+	<title>Description</title>
+
+	<para>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:</para>
+
+    <example>
+      <title><constant>V4L2_PIX_FMT_SBGGR14</constant> 4 &times; 4
+pixel image</title>
+
+      <formalpara>
+	<title>Byte Order.</title>
+	<para>Each cell is one byte, the 2 most significant bits in the high
+	  bytes are 0.
+	  <informaltable frame="none">
+	    <tgroup cols="5" align="center">
+	      <colspec align="left" colwidth="2*" />
+	      <tbody valign="top">
+		<row>
+		  <entry>start&nbsp;+&nbsp;0:</entry>
+		  <entry>B<subscript>00low</subscript></entry>
+		  <entry>B<subscript>00high</subscript></entry>
+		  <entry>G<subscript>01low</subscript></entry>
+		  <entry>G<subscript>01high</subscript></entry>
+		  <entry>B<subscript>02low</subscript></entry>
+		  <entry>B<subscript>02high</subscript></entry>
+		  <entry>G<subscript>03low</subscript></entry>
+		  <entry>G<subscript>03high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;8:</entry>
+		  <entry>G<subscript>10low</subscript></entry>
+		  <entry>G<subscript>10high</subscript></entry>
+		  <entry>R<subscript>11low</subscript></entry>
+		  <entry>R<subscript>11high</subscript></entry>
+		  <entry>G<subscript>12low</subscript></entry>
+		  <entry>G<subscript>12high</subscript></entry>
+		  <entry>R<subscript>13low</subscript></entry>
+		  <entry>R<subscript>13high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;16:</entry>
+		  <entry>B<subscript>20low</subscript></entry>
+		  <entry>B<subscript>20high</subscript></entry>
+		  <entry>G<subscript>21low</subscript></entry>
+		  <entry>G<subscript>21high</subscript></entry>
+		  <entry>B<subscript>22low</subscript></entry>
+		  <entry>B<subscript>22high</subscript></entry>
+		  <entry>G<subscript>23low</subscript></entry>
+		  <entry>G<subscript>23high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;24:</entry>
+		  <entry>G<subscript>30low</subscript></entry>
+		  <entry>G<subscript>30high</subscript></entry>
+		  <entry>R<subscript>31low</subscript></entry>
+		  <entry>R<subscript>31high</subscript></entry>
+		  <entry>G<subscript>32low</subscript></entry>
+		  <entry>G<subscript>32high</subscript></entry>
+		  <entry>R<subscript>33low</subscript></entry>
+		  <entry>R<subscript>33high</subscript></entry>
+		</row>
+	      </tbody>
+	    </tgroup>
+	  </informaltable>
+	</para>
+      </formalpara>
+    </example>
+  </refsect1>
+</refentry>
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;
   </section>
 
   <section id="yuv-formats">
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


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2 7/7] v4l: Add packed Bayer raw14 pixel formats
  2016-06-20 16:20 [PATCH v2 0/7] New raw bayer format definitions, fixes Sakari Ailus
                   ` (5 preceding siblings ...)
  2016-06-20 16:20 ` [PATCH v2 6/7] v4l: Add 14-bit raw bayer pixel format definitions Sakari Ailus
@ 2016-06-20 16:20 ` Sakari Ailus
  2016-06-27 14:57 ` [PATCH v2.1 8/9] media: Add 1X16 16-bit raw bayer media bus code definitions Sakari Ailus
  7 siblings, 0 replies; 21+ messages in thread
From: Sakari Ailus @ 2016-06-20 16:20 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil

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 <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 .../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..97bdaee2
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml
@@ -0,0 +1,118 @@
+    <refentry id="pixfmt-srggb14p">
+      <refmeta>
+	<refentrytitle>V4L2_PIX_FMT_SRGGB14P ('pREE'),
+	 V4L2_PIX_FMT_SGRBG14P ('pgEE'),
+	 V4L2_PIX_FMT_SGBRG14P ('pGEE'),
+	 V4L2_PIX_FMT_SBGGR14P ('pBEE')
+	 </refentrytitle>
+	&manvol;
+      </refmeta>
+      <refnamediv>
+	<refname id="V4L2-PIX-FMT-SRGGB14P"><constant>V4L2_PIX_FMT_SRGGB14P</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGRBG14P"><constant>V4L2_PIX_FMT_SGRBG14P</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGBRG14P"><constant>V4L2_PIX_FMT_SGBRG14P</constant></refname>
+	<refname id="V4L2-PIX-FMT-SBGGR14P"><constant>V4L2_PIX_FMT_SBGGR14P</constant></refname>
+	<refpurpose>14-bit packed Bayer formats</refpurpose>
+      </refnamediv>
+      <refsect1>
+	<title>Description</title>
+
+	<para>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 significant bits of each
+	pixel, in the same order.</para>
+
+	<para>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:</para>
+
+    <example>
+      <title><constant>V4L2_PIX_FMT_SBGGR14P</constant> 4 &times; 4
+      pixel image</title>
+
+      <formalpara>
+	<title>Byte Order.</title>
+	<para>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.
+
+	  <informaltable frame="topbot" colsep="1" rowsep="1">
+	    <tgroup cols="7" align="center">
+	      <colspec align="left" colwidth="2*" />
+	      <tbody valign="top">
+		<row>
+		  <entry>start&nbsp;+&nbsp;0:</entry>
+		  <entry>B<subscript>00 bits 13--8</subscript></entry>
+		  <entry>G<subscript>01 bits 13--8</subscript></entry>
+		  <entry>B<subscript>02 bits 13--8</subscript></entry>
+		  <entry>G<subscript>03 bits 13--8</subscript></entry>
+		  <entry>G<subscript>01 bits 1--0</subscript>(bits 7--6)
+			 B<subscript>00 bits 5--0</subscript>(bits 5--0)
+		  </entry>
+		  <entry>B<subscript>02 bits 3--0</subscript>(bits 7--4)
+			 G<subscript>01 bits 5--2</subscript>(bits 3--0)
+		  </entry>
+		  <entry>G<subscript>03 bits 5--0</subscript>(bits 7--2)
+			 B<subscript>02 bits 5--4</subscript>(bits 1--0)
+		  </entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;7:</entry>
+		  <entry>G<subscript>10 bits 13--8</subscript></entry>
+		  <entry>R<subscript>11 bits 13--8</subscript></entry>
+		  <entry>G<subscript>12 bits 13--8</subscript></entry>
+		  <entry>R<subscript>13 bits 13--8</subscript></entry>
+		  <entry>R<subscript>11 bits 1--0</subscript>(bits 7--6)
+			 B<subscript>10 bits 5--0</subscript>(bits 5--0)
+		  </entry>
+		  <entry>R<subscript>12 bits 3--0</subscript>(bits 7--4)
+			 G<subscript>11 bits 5--2</subscript>(bits 3--0)
+		  </entry>
+		  <entry>R<subscript>13 bits 5--0</subscript>(bits 7--2)
+			 B<subscript>12 bits 5--4</subscript>(bits 1--0)
+		  </entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;14:</entry>
+		  <entry>B<subscript>20 bits 13--8</subscript></entry>
+		  <entry>G<subscript>21 bits 13--8</subscript></entry>
+		  <entry>B<subscript>22 bits 13--8</subscript></entry>
+		  <entry>G<subscript>23 bits 13--8</subscript></entry>
+		  <entry>G<subscript>21 bits 1--0</subscript>(bits 7--6)
+			 B<subscript>20 bits 5--0</subscript>(bits 5--0)
+		  </entry>
+		  <entry>B<subscript>22 bits 3--0</subscript>(bits 7--4)
+			 G<subscript>21 bits 5--2</subscript>(bits 3--0)
+		  </entry>
+		  <entry>G<subscript>23 bits 5--0</subscript>(bits 7--2)
+			 B<subscript>22 bits 5--4</subscript>(bits 1--0)
+		  </entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;21:</entry>
+		  <entry>G<subscript>30 bits 13--8</subscript></entry>
+		  <entry>R<subscript>31 bits 13--8</subscript></entry>
+		  <entry>G<subscript>32 bits 13--8</subscript></entry>
+		  <entry>R<subscript>33 bits 13--8</subscript></entry>
+		  <entry>R<subscript>31 bits 1--0</subscript>(bits 7--6)
+			 B<subscript>30 bits 5--0</subscript>(bits 5--0)
+		  </entry>
+		  <entry>R<subscript>32 bits 3--0</subscript>(bits 7--4)
+			 G<subscript>31 bits 5--2</subscript>(bits 3--0)
+		  </entry>
+		  <entry>R<subscript>33 bits 5--0</subscript>(bits 7--2)
+			 B<subscript>32 bits 5--4</subscript>(bits 1--0)
+		  </entry>
+		</row>
+	      </tbody>
+	    </tgroup>
+	  </informaltable>
+	</para>
+      </formalpara>
+    </example>
+  </refsect1>
+</refentry>
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;
   </section>
 
   <section id="yuv-formats">
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 */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 2/7] v4l: Fix number of zeroed high order bits in 12-bit raw format defs
  2016-06-20 16:20 ` [PATCH v2 2/7] v4l: Fix number of zeroed high order bits in 12-bit raw format defs Sakari Ailus
@ 2016-06-20 16:54   ` Hans Verkuil
  0 siblings, 0 replies; 21+ messages in thread
From: Hans Verkuil @ 2016-06-20 16:54 UTC (permalink / raw)
  To: Sakari Ailus, linux-media

On 06/20/2016 06:20 PM, Sakari Ailus wrote:
> The number of high order bits in samples was documented to be 6 for 12-bit
> data. This is clearly wrong, fix it.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

	Hans

> ---
>  Documentation/DocBook/media/v4l/pixfmt-srggb12.xml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
> index 0c8e4ad..4394101 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
> @@ -31,7 +31,7 @@ pixel image</title>
>  
>        <formalpara>
>  	<title>Byte Order.</title>
> -	<para>Each cell is one byte, high 6 bits in high bytes are 0.
> +	<para>Each cell is one byte, high 4 bits in high bytes are 0.
>  	  <informaltable frame="none">
>  	    <tgroup cols="5" align="center">
>  	      <colspec align="left" colwidth="2*" />
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 3/7] v4l: Clean up raw bayer pixel format definitions
  2016-06-20 16:20 ` [PATCH v2 3/7] v4l: Clean up raw bayer pixel format definitions Sakari Ailus
@ 2016-06-20 16:54   ` Hans Verkuil
  0 siblings, 0 replies; 21+ messages in thread
From: Hans Verkuil @ 2016-06-20 16:54 UTC (permalink / raw)
  To: Sakari Ailus, linux-media

On 06/20/2016 06:20 PM, Sakari Ailus wrote:
> - Explicitly state that the most significant n bits are zeroed on 10 and
>   12 bpp formats.
> - Remove extra comma from the last entry of the format list
> - Add a missing colon before a list
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

	Hans

> ---
>  Documentation/DocBook/media/v4l/pixfmt-srggb10.xml  | 5 +++--
>  Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml | 2 +-
>  Documentation/DocBook/media/v4l/pixfmt-srggb12.xml  | 5 +++--
>  3 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml
> index f34d03e..cd3f915 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10.xml
> @@ -23,7 +23,7 @@ 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</para>
> +formats:</para>
>  
>      <example>
>        <title><constant>V4L2_PIX_FMT_SBGGR10</constant> 4 &times; 4
> @@ -31,7 +31,8 @@ pixel image</title>
>  
>        <formalpara>
>  	<title>Byte Order.</title>
> -	<para>Each cell is one byte, high 6 bits in high bytes are 0.
> +	<para>Each cell is one byte, the 6 most significant bits in the high
> +	      bytes are 0.
>  	  <informaltable frame="none">
>  	    <tgroup cols="5" align="center">
>  	      <colspec align="left" colwidth="2*" />
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
> index 747822b..18bb722 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
> @@ -3,7 +3,7 @@
>  	<refentrytitle>V4L2_PIX_FMT_SRGGB10P ('pRAA'),
>  	 V4L2_PIX_FMT_SGRBG10P ('pgAA'),
>  	 V4L2_PIX_FMT_SGBRG10P ('pGAA'),
> -	 V4L2_PIX_FMT_SBGGR10P ('pBAA'),
> +	 V4L2_PIX_FMT_SBGGR10P ('pBAA')
>  	 </refentrytitle>
>  	&manvol;
>        </refmeta>
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
> index 4394101..2d8efeb 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb12.xml
> @@ -23,7 +23,7 @@ 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</para>
> +formats:</para>
>  
>      <example>
>        <title><constant>V4L2_PIX_FMT_SBGGR12</constant> 4 &times; 4
> @@ -31,7 +31,8 @@ pixel image</title>
>  
>        <formalpara>
>  	<title>Byte Order.</title>
> -	<para>Each cell is one byte, high 4 bits in high bytes are 0.
> +	<para>Each cell is one byte, the 4 most significant bits in the high
> +	      bytes are 0.
>  	  <informaltable frame="none">
>  	    <tgroup cols="5" align="center">
>  	      <colspec align="left" colwidth="2*" />
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 1/7] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats
  2016-06-20 16:20 ` [PATCH v2 1/7] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats Sakari Ailus
@ 2016-06-20 17:03   ` Hans Verkuil
  2016-06-20 20:38     ` Dave Stevenson
  0 siblings, 1 reply; 21+ messages in thread
From: Hans Verkuil @ 2016-06-20 17:03 UTC (permalink / raw)
  To: Sakari Ailus, linux-media

On 06/20/2016 06:20 PM, Sakari Ailus wrote:
> The 10-bit packed raw bayer format documented that the data of the first
> pixel of a four-pixel group was found in the first byte and the two
> highest bits of the fifth byte. This was not entirely correct. The two
> bits in the fifth byte are the two lowest bits. The second pixel occupies
> the second byte and third and fourth least significant bits and so on.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

As mentioned, this needs confirmation. I wonder, isn't this specified in the UVC
spec?

Regards,

	Hans

> ---
>  .../DocBook/media/v4l/pixfmt-srggb10p.xml          | 32 +++++++++++-----------
>  1 file changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
> index a8cc102..747822b 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb10p.xml
> @@ -47,10 +47,10 @@
>  		  <entry>G<subscript>01high</subscript></entry>
>  		  <entry>B<subscript>02high</subscript></entry>
>  		  <entry>G<subscript>03high</subscript></entry>
> -		  <entry>B<subscript>00low</subscript>(bits 7--6)
> -			 G<subscript>01low</subscript>(bits 5--4)
> -			 B<subscript>02low</subscript>(bits 3--2)
> -			 G<subscript>03low</subscript>(bits 1--0)
> +		  <entry>G<subscript>03low</subscript>(bits 7--6)
> +			 B<subscript>02low</subscript>(bits 5--4)
> +			 G<subscript>01low</subscript>(bits 3--2)
> +			 B<subscript>00low</subscript>(bits 1--0)
>  		  </entry>
>  		</row>
>  		<row>
> @@ -59,10 +59,10 @@
>  		  <entry>R<subscript>11high</subscript></entry>
>  		  <entry>G<subscript>12high</subscript></entry>
>  		  <entry>R<subscript>13high</subscript></entry>
> -		  <entry>G<subscript>10low</subscript>(bits 7--6)
> -			 R<subscript>11low</subscript>(bits 5--4)
> -			 G<subscript>12low</subscript>(bits 3--2)
> -			 R<subscript>13low</subscript>(bits 1--0)
> +		  <entry>R<subscript>13low</subscript>(bits 7--6)
> +			 G<subscript>12low</subscript>(bits 5--4)
> +			 R<subscript>11low</subscript>(bits 3--2)
> +			 G<subscript>10low</subscript>(bits 1--0)
>  		  </entry>
>  		</row>
>  		<row>
> @@ -71,10 +71,10 @@
>  		  <entry>G<subscript>21high</subscript></entry>
>  		  <entry>B<subscript>22high</subscript></entry>
>  		  <entry>G<subscript>23high</subscript></entry>
> -		  <entry>B<subscript>20low</subscript>(bits 7--6)
> -			 G<subscript>21low</subscript>(bits 5--4)
> -			 B<subscript>22low</subscript>(bits 3--2)
> -			 G<subscript>23low</subscript>(bits 1--0)
> +		  <entry>G<subscript>23low</subscript>(bits 7--6)
> +			 B<subscript>22low</subscript>(bits 5--4)
> +			 G<subscript>21low</subscript>(bits 3--2)
> +			 B<subscript>20low</subscript>(bits 1--0)
>  		  </entry>
>  		</row>
>  		<row>
> @@ -83,10 +83,10 @@
>  		  <entry>R<subscript>31high</subscript></entry>
>  		  <entry>G<subscript>32high</subscript></entry>
>  		  <entry>R<subscript>33high</subscript></entry>
> -		  <entry>G<subscript>30low</subscript>(bits 7--6)
> -			 R<subscript>31low</subscript>(bits 5--4)
> -			 G<subscript>32low</subscript>(bits 3--2)
> -			 R<subscript>33low</subscript>(bits 1--0)
> +		  <entry>R<subscript>33low</subscript>(bits 7--6)
> +			 G<subscript>32low</subscript>(bits 5--4)
> +			 R<subscript>31low</subscript>(bits 3--2)
> +			 G<subscript>30low</subscript>(bits 1--0)
>  		  </entry>
>  		</row>
>  	      </tbody>
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 1/7] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats
  2016-06-20 17:03   ` Hans Verkuil
@ 2016-06-20 20:38     ` Dave Stevenson
  2016-06-21  6:24       ` Hans Verkuil
  0 siblings, 1 reply; 21+ messages in thread
From: Dave Stevenson @ 2016-06-20 20:38 UTC (permalink / raw)
  To: Hans Verkuil, Sakari Ailus, linux-media

Hi Hans.

On 20/06/16 18:03, Hans Verkuil wrote:
> On 06/20/2016 06:20 PM, Sakari Ailus wrote:
>> The 10-bit packed raw bayer format documented that the data of the first
>> pixel of a four-pixel group was found in the first byte and the two
>> highest bits of the fifth byte. This was not entirely correct. The two
>> bits in the fifth byte are the two lowest bits. The second pixel occupies
>> the second byte and third and fourth least significant bits and so on.
>>
>> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> As mentioned, this needs confirmation. I wonder, isn't this specified in the UVC
> spec?
>
> Regards,
>
> 	Hans
I'm assuming this is intended to be the same format as generated by many 
Bayer sensors.
Those are defined in both the SMIA CCP2 (section 7.9), and MIPI CSI2 
(section 11.4.4) specs. Whilst nominally restricted, they are both 
available via unofficial websites if you Google for them (I'm happy to 
send links, but didn't want to break mailing list rules by just posting 
them).
CSI2 draft spec Figure 98 "RAW10 Data Transmission on CSI-2 Bus Bitwise 
Illustration" is probably the clearest confirmation of the bit ordering.

dcraw from http://www.cybercom.net/~dcoffin/dcraw/ can consume Raw10 via 
nokia_load_raw
     for (dp=data, col=0; col < raw_width; dp+=5, col+=4)
       FORC4 RAW(row,col+c) = (dp[c] << 2) | (dp[4] >> (c << 1) & 3);

And checking against the Raspberry Pi hardware simulator, the RAW10 
parser code has
             for (i = 0; i < width; i++) {
                switch ((i + tile_x) & 3) {
                   case 0:  val = (buf[0] << 2) | (buf[4] & 3); break;
                   case 1:  val = (buf[1] << 2) | ((buf[4] >> 2) & 3); 
break;
                   case 2:  val = (buf[2] << 2) | ((buf[4] >> 4) & 3); 
break;
                   default: val = (buf[3] << 2) | ((buf[4] >> 6) & 3);


All of those agree with Sakari's update that the first pixel's LSBits 
are in bits 1..0 of byte 5, 2nd pixel in bits 3..2, etc.

Regards,
   Dave
(working on the Pi CSI2 receiver V4L2 driver as there is now sufficient 
data in the public domain to do it. I'll be wanting these formats!)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 1/7] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats
  2016-06-20 20:38     ` Dave Stevenson
@ 2016-06-21  6:24       ` Hans Verkuil
  0 siblings, 0 replies; 21+ messages in thread
From: Hans Verkuil @ 2016-06-21  6:24 UTC (permalink / raw)
  To: Dave Stevenson, Sakari Ailus, linux-media

On 06/20/2016 10:38 PM, Dave Stevenson wrote:
> Hi Hans.
> 
> On 20/06/16 18:03, Hans Verkuil wrote:
>> On 06/20/2016 06:20 PM, Sakari Ailus wrote:
>>> The 10-bit packed raw bayer format documented that the data of the first
>>> pixel of a four-pixel group was found in the first byte and the two
>>> highest bits of the fifth byte. This was not entirely correct. The two
>>> bits in the fifth byte are the two lowest bits. The second pixel occupies
>>> the second byte and third and fourth least significant bits and so on.
>>>
>>> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
>> As mentioned, this needs confirmation. I wonder, isn't this specified in the UVC
>> spec?

I can't find anything in the uvc spec. This format was apparently added for an
Intel R200 3D camera, so I suspect it followed the SMIA/CSI standard and that
the doc is indeed wrong.

So:

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

>>
>> Regards,
>>
>> 	Hans
> I'm assuming this is intended to be the same format as generated by many 
> Bayer sensors.
> Those are defined in both the SMIA CCP2 (section 7.9), and MIPI CSI2 
> (section 11.4.4) specs. Whilst nominally restricted, they are both 
> available via unofficial websites if you Google for them (I'm happy to 
> send links, but didn't want to break mailing list rules by just posting 
> them).
> CSI2 draft spec Figure 98 "RAW10 Data Transmission on CSI-2 Bus Bitwise 
> Illustration" is probably the clearest confirmation of the bit ordering.
> 
> dcraw from http://www.cybercom.net/~dcoffin/dcraw/ can consume Raw10 via 
> nokia_load_raw
>      for (dp=data, col=0; col < raw_width; dp+=5, col+=4)
>        FORC4 RAW(row,col+c) = (dp[c] << 2) | (dp[4] >> (c << 1) & 3);
> 
> And checking against the Raspberry Pi hardware simulator, the RAW10 
> parser code has
>              for (i = 0; i < width; i++) {
>                 switch ((i + tile_x) & 3) {
>                    case 0:  val = (buf[0] << 2) | (buf[4] & 3); break;
>                    case 1:  val = (buf[1] << 2) | ((buf[4] >> 2) & 3); 
> break;
>                    case 2:  val = (buf[2] << 2) | ((buf[4] >> 4) & 3); 
> break;
>                    default: val = (buf[3] << 2) | ((buf[4] >> 6) & 3);
> 
> 
> All of those agree with Sakari's update that the first pixel's LSBits 
> are in bits 1..0 of byte 5, 2nd pixel in bits 3..2, etc.
> 
> Regards,
>    Dave
> (working on the Pi CSI2 receiver V4L2 driver as there is now sufficient 
> data in the public domain to do it. I'll be wanting these formats!)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2.1 6/9] v4l: Add 14-bit raw bayer pixel format definitions
  2016-06-20 16:20 ` [PATCH v2 6/7] v4l: Add 14-bit raw bayer pixel format definitions Sakari Ailus
@ 2016-06-27 14:45   ` Sakari Ailus
  2016-07-08  9:24     ` Hans Verkuil
  0 siblings, 1 reply; 21+ messages in thread
From: Sakari Ailus @ 2016-06-27 14:45 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil

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 <jouni.ukkonen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
---
since v2:

- Use "GR14" instead of "BA14" 4cc for V4L2_PIX_FMT_SGRBG14.

 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..5139c45
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml
@@ -0,0 +1,91 @@
+    <refentry>
+      <refmeta>
+	<refentrytitle>V4L2_PIX_FMT_SRGGB14 ('RG14'),
+	 V4L2_PIX_FMT_SGRBG14 ('GR14'),
+	 V4L2_PIX_FMT_SGBRG14 ('GB14'),
+	 V4L2_PIX_FMT_SBGGR14 ('BG14')
+	 </refentrytitle>
+	&manvol;
+      </refmeta>
+      <refnamediv>
+	<refname id="V4L2-PIX-FMT-SRGGB14"><constant>V4L2_PIX_FMT_SRGGB14</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGRBG14"><constant>V4L2_PIX_FMT_SGRBG14</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGBRG14"><constant>V4L2_PIX_FMT_SGBRG14</constant></refname>
+	<refname id="V4L2-PIX-FMT-SBGGR14"><constant>V4L2_PIX_FMT_SBGGR14</constant></refname>
+	<refpurpose>14-bit Bayer formats expanded to 16 bits</refpurpose>
+      </refnamediv>
+      <refsect1>
+	<title>Description</title>
+
+	<para>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:</para>
+
+    <example>
+      <title><constant>V4L2_PIX_FMT_SBGGR14</constant> 4 &times; 4
+pixel image</title>
+
+      <formalpara>
+	<title>Byte Order.</title>
+	<para>Each cell is one byte, the 2 most significant bits in the high
+	  bytes are 0.
+	  <informaltable frame="none">
+	    <tgroup cols="5" align="center">
+	      <colspec align="left" colwidth="2*" />
+	      <tbody valign="top">
+		<row>
+		  <entry>start&nbsp;+&nbsp;0:</entry>
+		  <entry>B<subscript>00low</subscript></entry>
+		  <entry>B<subscript>00high</subscript></entry>
+		  <entry>G<subscript>01low</subscript></entry>
+		  <entry>G<subscript>01high</subscript></entry>
+		  <entry>B<subscript>02low</subscript></entry>
+		  <entry>B<subscript>02high</subscript></entry>
+		  <entry>G<subscript>03low</subscript></entry>
+		  <entry>G<subscript>03high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;8:</entry>
+		  <entry>G<subscript>10low</subscript></entry>
+		  <entry>G<subscript>10high</subscript></entry>
+		  <entry>R<subscript>11low</subscript></entry>
+		  <entry>R<subscript>11high</subscript></entry>
+		  <entry>G<subscript>12low</subscript></entry>
+		  <entry>G<subscript>12high</subscript></entry>
+		  <entry>R<subscript>13low</subscript></entry>
+		  <entry>R<subscript>13high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;16:</entry>
+		  <entry>B<subscript>20low</subscript></entry>
+		  <entry>B<subscript>20high</subscript></entry>
+		  <entry>G<subscript>21low</subscript></entry>
+		  <entry>G<subscript>21high</subscript></entry>
+		  <entry>B<subscript>22low</subscript></entry>
+		  <entry>B<subscript>22high</subscript></entry>
+		  <entry>G<subscript>23low</subscript></entry>
+		  <entry>G<subscript>23high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;24:</entry>
+		  <entry>G<subscript>30low</subscript></entry>
+		  <entry>G<subscript>30high</subscript></entry>
+		  <entry>R<subscript>31low</subscript></entry>
+		  <entry>R<subscript>31high</subscript></entry>
+		  <entry>G<subscript>32low</subscript></entry>
+		  <entry>G<subscript>32high</subscript></entry>
+		  <entry>R<subscript>33low</subscript></entry>
+		  <entry>R<subscript>33high</subscript></entry>
+		</row>
+	      </tbody>
+	    </tgroup>
+	  </informaltable>
+	</para>
+      </formalpara>
+    </example>
+  </refsect1>
+</refentry>
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;
   </section>
 
   <section id="yuv-formats">
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 7ace868..86af01a 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('G', 'R', '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 */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2.1 8/9] media: Add 1X16 16-bit raw bayer media bus code definitions
  2016-06-20 16:20 [PATCH v2 0/7] New raw bayer format definitions, fixes Sakari Ailus
                   ` (6 preceding siblings ...)
  2016-06-20 16:20 ` [PATCH v2 7/7] v4l: Add packed Bayer raw14 pixel formats Sakari Ailus
@ 2016-06-27 14:57 ` Sakari Ailus
  2016-06-27 14:57   ` [PATCH v2.1 9/9] v4l: Add 16-bit raw bayer pixel format definitions Sakari Ailus
  7 siblings, 1 reply; 21+ messages in thread
From: Sakari Ailus @ 2016-06-27 14:57 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil

The codes will be called:

	MEDIA_BUS_FMT_SBGGR16_1X16
	MEDIA_BUS_FMT_SGBRG16_1X16
	MEDIA_BUS_FMT_SGRBG16_1X16
	MEDIA_BUS_FMT_SRGGB16_1X16

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 Documentation/DocBook/media/v4l/subdev-formats.xml | 252 +++++++++++----------
 include/uapi/linux/media-bus-format.h              |   6 +-
 2 files changed, 137 insertions(+), 121 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml
index 6d45dc8..db5b935 100644
--- a/Documentation/DocBook/media/v4l/subdev-formats.xml
+++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
@@ -1116,6 +1116,8 @@ see <xref linkend="colorspaces" />.</entry>
 	  <colspec colnum="15" colname="b02" align="center" />
 	  <colspec colnum="16" colname="b01" align="center" />
 	  <colspec colnum="17" colname="b00" align="center" />
+	  <colspec colnum="18" colname="b01" align="center" />
+	  <colspec colnum="19" colname="b00" align="center" />
 	  <spanspec namest="b11" nameend="b00" spanname="b0" />
 	  <thead>
 	    <row>
@@ -1128,6 +1130,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry></entry>
 	      <entry>Bit</entry>
+	      <entry>15</entry>
+	      <entry>14</entry>
 	      <entry>13</entry>
 	      <entry>12</entry>
 	      <entry>11</entry>
@@ -1149,12 +1153,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SBGGR8_1X8</entry>
 	      <entry>0x3001</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>b<subscript>7</subscript></entry>
 	      <entry>b<subscript>6</subscript></entry>
 	      <entry>b<subscript>5</subscript></entry>
@@ -1168,12 +1167,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SGBRG8_1X8</entry>
 	      <entry>0x3013</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1187,12 +1181,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SGRBG8_1X8</entry>
 	      <entry>0x3002</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1206,12 +1195,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SRGGB8_1X8</entry>
 	      <entry>0x3014</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>r<subscript>7</subscript></entry>
 	      <entry>r<subscript>6</subscript></entry>
 	      <entry>r<subscript>5</subscript></entry>
@@ -1225,12 +1209,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8</entry>
 	      <entry>0x3015</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>b<subscript>7</subscript></entry>
 	      <entry>b<subscript>6</subscript></entry>
 	      <entry>b<subscript>5</subscript></entry>
@@ -1244,12 +1223,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8</entry>
 	      <entry>0x3016</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1263,12 +1237,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8</entry>
 	      <entry>0x3017</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1282,12 +1251,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8</entry>
 	      <entry>0x3018</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>r<subscript>7</subscript></entry>
 	      <entry>r<subscript>6</subscript></entry>
 	      <entry>r<subscript>5</subscript></entry>
@@ -1301,12 +1265,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8</entry>
 	      <entry>0x300b</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>b<subscript>7</subscript></entry>
 	      <entry>b<subscript>6</subscript></entry>
 	      <entry>b<subscript>5</subscript></entry>
@@ -1320,12 +1279,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8</entry>
 	      <entry>0x300c</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1339,12 +1293,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8</entry>
 	      <entry>0x3009</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>g<subscript>7</subscript></entry>
 	      <entry>g<subscript>6</subscript></entry>
 	      <entry>g<subscript>5</subscript></entry>
@@ -1358,12 +1307,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8</entry>
 	      <entry>0x300d</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>r<subscript>7</subscript></entry>
 	      <entry>r<subscript>6</subscript></entry>
 	      <entry>r<subscript>5</subscript></entry>
@@ -1377,12 +1321,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE</entry>
 	      <entry>0x3003</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>0</entry>
 	      <entry>0</entry>
 	      <entry>0</entry>
@@ -1396,12 +1335,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry></entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>b<subscript>7</subscript></entry>
 	      <entry>b<subscript>6</subscript></entry>
 	      <entry>b<subscript>5</subscript></entry>
@@ -1415,12 +1349,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE</entry>
 	      <entry>0x3004</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>b<subscript>7</subscript></entry>
 	      <entry>b<subscript>6</subscript></entry>
 	      <entry>b<subscript>5</subscript></entry>
@@ -1434,12 +1363,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry></entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>0</entry>
 	      <entry>0</entry>
 	      <entry>0</entry>
@@ -1453,12 +1377,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE</entry>
 	      <entry>0x3005</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>b<subscript>9</subscript></entry>
 	      <entry>b<subscript>8</subscript></entry>
 	      <entry>b<subscript>7</subscript></entry>
@@ -1472,12 +1391,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry></entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>b<subscript>1</subscript></entry>
 	      <entry>b<subscript>0</subscript></entry>
 	      <entry>0</entry>
@@ -1491,12 +1405,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE</entry>
 	      <entry>0x3006</entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>b<subscript>1</subscript></entry>
 	      <entry>b<subscript>0</subscript></entry>
 	      <entry>0</entry>
@@ -1510,12 +1419,7 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry></entry>
 	      <entry></entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
-	      <entry>-</entry>
+	      &dash-ent-8;
 	      <entry>b<subscript>9</subscript></entry>
 	      <entry>b<subscript>8</subscript></entry>
 	      <entry>b<subscript>7</subscript></entry>
@@ -1533,6 +1437,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>9</subscript></entry>
 	      <entry>b<subscript>8</subscript></entry>
 	      <entry>b<subscript>7</subscript></entry>
@@ -1552,6 +1458,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>9</subscript></entry>
 	      <entry>g<subscript>8</subscript></entry>
 	      <entry>g<subscript>7</subscript></entry>
@@ -1571,6 +1479,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>9</subscript></entry>
 	      <entry>g<subscript>8</subscript></entry>
 	      <entry>g<subscript>7</subscript></entry>
@@ -1590,6 +1500,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>r<subscript>9</subscript></entry>
 	      <entry>r<subscript>8</subscript></entry>
 	      <entry>r<subscript>7</subscript></entry>
@@ -1607,6 +1519,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>11</subscript></entry>
 	      <entry>b<subscript>10</subscript></entry>
 	      <entry>b<subscript>9</subscript></entry>
@@ -1626,6 +1540,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>11</subscript></entry>
 	      <entry>g<subscript>10</subscript></entry>
 	      <entry>g<subscript>9</subscript></entry>
@@ -1645,6 +1561,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>11</subscript></entry>
 	      <entry>g<subscript>10</subscript></entry>
 	      <entry>g<subscript>9</subscript></entry>
@@ -1664,6 +1582,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry></entry>
 	      <entry>-</entry>
 	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>r<subscript>11</subscript></entry>
 	      <entry>r<subscript>10</subscript></entry>
 	      <entry>r<subscript>9</subscript></entry>
@@ -1681,6 +1601,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SBGGR14_1X14</entry>
 	      <entry>0x3019</entry>
 	      <entry></entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>b<subscript>13</subscript></entry>
 	      <entry>b<subscript>12</subscript></entry>
 	      <entry>b<subscript>11</subscript></entry>
@@ -1700,6 +1622,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SGBRG14_1X14</entry>
 	      <entry>0x301a</entry>
 	      <entry></entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>13</subscript></entry>
 	      <entry>g<subscript>12</subscript></entry>
 	      <entry>g<subscript>11</subscript></entry>
@@ -1719,6 +1643,8 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SGRBG14_1X14</entry>
 	      <entry>0x301b</entry>
 	      <entry></entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
 	      <entry>g<subscript>13</subscript></entry>
 	      <entry>g<subscript>12</subscript></entry>
 	      <entry>g<subscript>11</subscript></entry>
@@ -1738,6 +1664,92 @@ see <xref linkend="colorspaces" />.</entry>
 	      <entry>MEDIA_BUS_FMT_SRGGB14_1X14</entry>
 	      <entry>0x301c</entry>
 	      <entry></entry>
+	      <entry>-</entry>
+	      <entry>-</entry>
+	      <entry>r<subscript>13</subscript></entry>
+	      <entry>r<subscript>12</subscript></entry>
+	      <entry>r<subscript>11</subscript></entry>
+	      <entry>r<subscript>10</subscript></entry>
+	      <entry>r<subscript>9</subscript></entry>
+	      <entry>r<subscript>8</subscript></entry>
+	      <entry>r<subscript>7</subscript></entry>
+	      <entry>r<subscript>6</subscript></entry>
+	      <entry>r<subscript>5</subscript></entry>
+	      <entry>r<subscript>4</subscript></entry>
+	      <entry>r<subscript>3</subscript></entry>
+	      <entry>r<subscript>2</subscript></entry>
+	      <entry>r<subscript>1</subscript></entry>
+	      <entry>r<subscript>0</subscript></entry>
+	    </row>
+	    <row id="MEDIA-BUS-FMT-SBGGR16-1X16">
+	      <entry>MEDIA_BUS_FMT_SBGGR16_1X16</entry>
+	      <entry>0x301d</entry>
+	      <entry></entry>
+	      <entry>b<subscript>15</subscript></entry>
+	      <entry>b<subscript>14</subscript></entry>
+	      <entry>b<subscript>13</subscript></entry>
+	      <entry>b<subscript>12</subscript></entry>
+	      <entry>b<subscript>11</subscript></entry>
+	      <entry>b<subscript>10</subscript></entry>
+	      <entry>b<subscript>9</subscript></entry>
+	      <entry>b<subscript>8</subscript></entry>
+	      <entry>b<subscript>7</subscript></entry>
+	      <entry>b<subscript>6</subscript></entry>
+	      <entry>b<subscript>5</subscript></entry>
+	      <entry>b<subscript>4</subscript></entry>
+	      <entry>b<subscript>3</subscript></entry>
+	      <entry>b<subscript>2</subscript></entry>
+	      <entry>b<subscript>1</subscript></entry>
+	      <entry>b<subscript>0</subscript></entry>
+	    </row>
+	    <row id="MEDIA-BUS-FMT-SGBRG16-1X16">
+	      <entry>MEDIA_BUS_FMT_SGBRG16_1X16</entry>
+	      <entry>0x301e</entry>
+	      <entry></entry>
+	      <entry>g<subscript>15</subscript></entry>
+	      <entry>g<subscript>14</subscript></entry>
+	      <entry>g<subscript>13</subscript></entry>
+	      <entry>g<subscript>12</subscript></entry>
+	      <entry>g<subscript>11</subscript></entry>
+	      <entry>g<subscript>10</subscript></entry>
+	      <entry>g<subscript>9</subscript></entry>
+	      <entry>g<subscript>8</subscript></entry>
+	      <entry>g<subscript>7</subscript></entry>
+	      <entry>g<subscript>6</subscript></entry>
+	      <entry>g<subscript>5</subscript></entry>
+	      <entry>g<subscript>4</subscript></entry>
+	      <entry>g<subscript>3</subscript></entry>
+	      <entry>g<subscript>2</subscript></entry>
+	      <entry>g<subscript>1</subscript></entry>
+	      <entry>g<subscript>0</subscript></entry>
+	    </row>
+	    <row id="MEDIA-BUS-FMT-SGRBG16-1X16">
+	      <entry>MEDIA_BUS_FMT_SGRBG16_1X16</entry>
+	      <entry>0x301f</entry>
+	      <entry></entry>
+	      <entry>g<subscript>15</subscript></entry>
+	      <entry>g<subscript>14</subscript></entry>
+	      <entry>g<subscript>13</subscript></entry>
+	      <entry>g<subscript>12</subscript></entry>
+	      <entry>g<subscript>11</subscript></entry>
+	      <entry>g<subscript>10</subscript></entry>
+	      <entry>g<subscript>9</subscript></entry>
+	      <entry>g<subscript>8</subscript></entry>
+	      <entry>g<subscript>7</subscript></entry>
+	      <entry>g<subscript>6</subscript></entry>
+	      <entry>g<subscript>5</subscript></entry>
+	      <entry>g<subscript>4</subscript></entry>
+	      <entry>g<subscript>3</subscript></entry>
+	      <entry>g<subscript>2</subscript></entry>
+	      <entry>g<subscript>1</subscript></entry>
+	      <entry>g<subscript>0</subscript></entry>
+	    </row>
+	    <row id="MEDIA-BUS-FMT-SRGGB16-1X16">
+	      <entry>MEDIA_BUS_FMT_SRGGB16_1X16</entry>
+	      <entry>0x3020</entry>
+	      <entry></entry>
+	      <entry>r<subscript>15</subscript></entry>
+	      <entry>r<subscript>14</subscript></entry>
 	      <entry>r<subscript>13</subscript></entry>
 	      <entry>r<subscript>12</subscript></entry>
 	      <entry>r<subscript>11</subscript></entry>
diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
index 1dff459..2168759 100644
--- a/include/uapi/linux/media-bus-format.h
+++ b/include/uapi/linux/media-bus-format.h
@@ -97,7 +97,7 @@
 #define MEDIA_BUS_FMT_YUV10_1X30		0x2016
 #define MEDIA_BUS_FMT_AYUV8_1X32		0x2017
 
-/* Bayer - next is	0x301d */
+/* Bayer - next is	0x3021 */
 #define MEDIA_BUS_FMT_SBGGR8_1X8		0x3001
 #define MEDIA_BUS_FMT_SGBRG8_1X8		0x3013
 #define MEDIA_BUS_FMT_SGRBG8_1X8		0x3002
@@ -126,6 +126,10 @@
 #define MEDIA_BUS_FMT_SGBRG14_1X14		0x301a
 #define MEDIA_BUS_FMT_SGRBG14_1X14		0x301b
 #define MEDIA_BUS_FMT_SRGGB14_1X14		0x301c
+#define MEDIA_BUS_FMT_SBGGR16_1X16		0x301d
+#define MEDIA_BUS_FMT_SGBRG16_1X16		0x301e
+#define MEDIA_BUS_FMT_SGRBG16_1X16		0x301f
+#define MEDIA_BUS_FMT_SRGGB16_1X16		0x3020
 
 /* JPEG compressed formats - next is	0x4002 */
 #define MEDIA_BUS_FMT_JPEG_1X8			0x4001
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2.1 9/9] v4l: Add 16-bit raw bayer pixel format definitions
  2016-06-27 14:57 ` [PATCH v2.1 8/9] media: Add 1X16 16-bit raw bayer media bus code definitions Sakari Ailus
@ 2016-06-27 14:57   ` Sakari Ailus
  2016-07-07  6:48     ` [PATCH v2.2 09/10] v4l: 16-bit BGGR is always 16 bits Sakari Ailus
  0 siblings, 1 reply; 21+ messages in thread
From: Sakari Ailus @ 2016-06-27 14:57 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil

The formats added by this patch are:

	V4L2_PIX_FMT_SBGGR16
	V4L2_PIX_FMT_SGBRG16
	V4L2_PIX_FMT_SGRBG16

V4L2_PIX_FMT_SRGGB16 already existed before the patch. Rework the
documentation to match that of the other sample depths.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 .../v4l/{pixfmt-sbggr16.xml => pixfmt-srggb16.xml} | 49 ++++++++++++++--------
 Documentation/DocBook/media/v4l/pixfmt.xml         |  2 +-
 include/uapi/linux/videodev2.h                     |  3 ++
 3 files changed, 35 insertions(+), 19 deletions(-)
 rename Documentation/DocBook/media/v4l/{pixfmt-sbggr16.xml => pixfmt-srggb16.xml} (62%)

diff --git a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb16.xml
similarity index 62%
rename from Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
rename to Documentation/DocBook/media/v4l/pixfmt-srggb16.xml
index 6494b05..517dd4d 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb16.xml
@@ -1,22 +1,29 @@
-<refentry id="V4L2-PIX-FMT-SBGGR16">
-  <refmeta>
-    <refentrytitle>V4L2_PIX_FMT_SBGGR16 ('BYR2')</refentrytitle>
-    &manvol;
-  </refmeta>
-  <refnamediv>
-    <refname><constant>V4L2_PIX_FMT_SBGGR16</constant></refname>
-    <refpurpose>Bayer RGB format</refpurpose>
-  </refnamediv>
-  <refsect1>
-    <title>Description</title>
+    <refentry>
+      <refmeta>
+	<refentrytitle>V4L2_PIX_FMT_SRGGB16 ('RG16'),
+	 V4L2_PIX_FMT_SGRBG16 ('GR16'),
+	 V4L2_PIX_FMT_SGBRG16 ('GB16'),
+	 V4L2_PIX_FMT_SBGGR16 ('BYR2')
+	 </refentrytitle>
+	&manvol;
+      </refmeta>
+      <refnamediv>
+	<refname id="V4L2-PIX-FMT-SRGGB16"><constant>V4L2_PIX_FMT_SRGGB16</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGRBG16"><constant>V4L2_PIX_FMT_SGRBG16</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGBRG16"><constant>V4L2_PIX_FMT_SGBRG16</constant></refname>
+	<refname id="V4L2-PIX-FMT-SBGGR16"><constant>V4L2_PIX_FMT_SBGGR16</constant></refname>
+	<refpurpose>16-bit Bayer formats</refpurpose>
+      </refnamediv>
+      <refsect1>
+	<title>Description</title>
 
-    <para>This format is similar to <link
-linkend="V4L2-PIX-FMT-SBGGR8">
-<constant>V4L2_PIX_FMT_SBGGR8</constant></link>, except each pixel has
-a depth of 16 bits. The least significant byte is stored at lower
-memory addresses (little-endian). Note the actual sampling precision
-may be lower than 16 bits, for example 10 bits per pixel with values
-in range 0 to 1023.</para>
+	<para>These four pixel formats are raw sRGB / Bayer formats with
+16 bits per colour. Each colour component is stored in a 16-bit word.
+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:</para>
 
     <example>
       <title><constant>V4L2_PIX_FMT_SBGGR16</constant> 4 &times; 4
@@ -79,5 +86,11 @@ pixel image</title>
 	</para>
       </formalpara>
     </example>
+
+    <para>Note the actual sampling precision for format
+    <constant>V4L2_PIX_FMT_SBGGR16</constant> may be lower than 16
+    bits, for example 10 bits per pixel with values in range 0 to
+    1023.</para>
+
   </refsect1>
 </refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
index 296a50a..2c22098 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -1587,7 +1587,6 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.<
     &sub-sgbrg8;
     &sub-sgrbg8;
     &sub-srggb8;
-    &sub-sbggr16;
     &sub-srggb10;
     &sub-srggb10p;
     &sub-srggb10alaw8;
@@ -1596,6 +1595,7 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.<
     &sub-srggb12p;
     &sub-srggb14;
     &sub-srggb14p;
+    &sub-srggb16;
   </section>
 
   <section id="yuv-formats">
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index c34d467..d201857 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -591,6 +591,9 @@ struct v4l2_pix_format {
 #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.. */
+#define V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6') /* 16  GBGB.. RGRG.. */
+#define V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6') /* 16  GRGR.. BGBG.. */
+#define V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6') /* 16  RGRG.. GBGB.. */
 
 /* compressed formats */
 #define V4L2_PIX_FMT_MJPEG    v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG   */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2.2 09/10] v4l: 16-bit BGGR is always 16 bits
  2016-06-27 14:57   ` [PATCH v2.1 9/9] v4l: Add 16-bit raw bayer pixel format definitions Sakari Ailus
@ 2016-07-07  6:48     ` Sakari Ailus
  2016-07-07  6:48       ` [PATCH v2.2 10/10] v4l: Add 16-bit raw bayer pixel format definitions Sakari Ailus
  2016-07-13 13:47       ` [PATCH v2.2 09/10] v4l: 16-bit BGGR is always 16 bits Lad, Prabhakar
  0 siblings, 2 replies; 21+ messages in thread
From: Sakari Ailus @ 2016-07-07  6:48 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil, bparrot, nsekhar, prabhakar.csengg

The V4L2_PIX_FMT_SBGGR16 format is documented to contain samples of fewer
than 16 bits. However, we do have specific definitions for smaller sample
sizes. Therefore, this note is redundant from the API point of view.

Currently only two drivers, am437x and davinci, use the V4L2_PIX_FMT_SBGGR16
pixelformat currently. The sampling precision is understood to be 16 bits in
all current cases.

Remove the note on sampling precision.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml b/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
index 6494b05..789160565 100644
--- a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
@@ -14,9 +14,7 @@
 linkend="V4L2-PIX-FMT-SBGGR8">
 <constant>V4L2_PIX_FMT_SBGGR8</constant></link>, except each pixel has
 a depth of 16 bits. The least significant byte is stored at lower
-memory addresses (little-endian). Note the actual sampling precision
-may be lower than 16 bits, for example 10 bits per pixel with values
-in range 0 to 1023.</para>
+memory addresses (little-endian).</para>
 
     <example>
       <title><constant>V4L2_PIX_FMT_SBGGR16</constant> 4 &times; 4
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v2.2 10/10] v4l: Add 16-bit raw bayer pixel format definitions
  2016-07-07  6:48     ` [PATCH v2.2 09/10] v4l: 16-bit BGGR is always 16 bits Sakari Ailus
@ 2016-07-07  6:48       ` Sakari Ailus
  2016-07-13 13:48         ` Lad, Prabhakar
  2016-07-13 13:47       ` [PATCH v2.2 09/10] v4l: 16-bit BGGR is always 16 bits Lad, Prabhakar
  1 sibling, 1 reply; 21+ messages in thread
From: Sakari Ailus @ 2016-07-07  6:48 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil, bparrot, nsekhar, prabhakar.csengg

The formats added by this patch are:

	V4L2_PIX_FMT_SBGGR16
	V4L2_PIX_FMT_SGBRG16
	V4L2_PIX_FMT_SGRBG16

V4L2_PIX_FMT_SRGGB16 already existed before the patch. Rework the
documentation to match that of the other sample depths.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml | 81 -------------------
 Documentation/DocBook/media/v4l/pixfmt-srggb16.xml | 91 ++++++++++++++++++++++
 Documentation/DocBook/media/v4l/pixfmt.xml         |  2 +-
 include/uapi/linux/videodev2.h                     |  3 +
 4 files changed, 95 insertions(+), 82 deletions(-)
 delete mode 100644 Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb16.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml b/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
deleted file mode 100644
index 789160565..0000000
--- a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<refentry id="V4L2-PIX-FMT-SBGGR16">
-  <refmeta>
-    <refentrytitle>V4L2_PIX_FMT_SBGGR16 ('BYR2')</refentrytitle>
-    &manvol;
-  </refmeta>
-  <refnamediv>
-    <refname><constant>V4L2_PIX_FMT_SBGGR16</constant></refname>
-    <refpurpose>Bayer RGB format</refpurpose>
-  </refnamediv>
-  <refsect1>
-    <title>Description</title>
-
-    <para>This format is similar to <link
-linkend="V4L2-PIX-FMT-SBGGR8">
-<constant>V4L2_PIX_FMT_SBGGR8</constant></link>, except each pixel has
-a depth of 16 bits. The least significant byte is stored at lower
-memory addresses (little-endian).</para>
-
-    <example>
-      <title><constant>V4L2_PIX_FMT_SBGGR16</constant> 4 &times; 4
-pixel image</title>
-
-      <formalpara>
-	<title>Byte Order.</title>
-	<para>Each cell is one byte.
-	  <informaltable frame="none">
-	    <tgroup cols="5" align="center">
-	      <colspec align="left" colwidth="2*" />
-	      <tbody valign="top">
-		<row>
-		  <entry>start&nbsp;+&nbsp;0:</entry>
-		  <entry>B<subscript>00low</subscript></entry>
-		  <entry>B<subscript>00high</subscript></entry>
-		  <entry>G<subscript>01low</subscript></entry>
-		  <entry>G<subscript>01high</subscript></entry>
-		  <entry>B<subscript>02low</subscript></entry>
-		  <entry>B<subscript>02high</subscript></entry>
-		  <entry>G<subscript>03low</subscript></entry>
-		  <entry>G<subscript>03high</subscript></entry>
-		</row>
-		<row>
-		  <entry>start&nbsp;+&nbsp;8:</entry>
-		  <entry>G<subscript>10low</subscript></entry>
-		  <entry>G<subscript>10high</subscript></entry>
-		  <entry>R<subscript>11low</subscript></entry>
-		  <entry>R<subscript>11high</subscript></entry>
-		  <entry>G<subscript>12low</subscript></entry>
-		  <entry>G<subscript>12high</subscript></entry>
-		  <entry>R<subscript>13low</subscript></entry>
-		  <entry>R<subscript>13high</subscript></entry>
-		</row>
-		<row>
-		  <entry>start&nbsp;+&nbsp;16:</entry>
-		  <entry>B<subscript>20low</subscript></entry>
-		  <entry>B<subscript>20high</subscript></entry>
-		  <entry>G<subscript>21low</subscript></entry>
-		  <entry>G<subscript>21high</subscript></entry>
-		  <entry>B<subscript>22low</subscript></entry>
-		  <entry>B<subscript>22high</subscript></entry>
-		  <entry>G<subscript>23low</subscript></entry>
-		  <entry>G<subscript>23high</subscript></entry>
-		</row>
-		<row>
-		  <entry>start&nbsp;+&nbsp;24:</entry>
-		  <entry>G<subscript>30low</subscript></entry>
-		  <entry>G<subscript>30high</subscript></entry>
-		  <entry>R<subscript>31low</subscript></entry>
-		  <entry>R<subscript>31high</subscript></entry>
-		  <entry>G<subscript>32low</subscript></entry>
-		  <entry>G<subscript>32high</subscript></entry>
-		  <entry>R<subscript>33low</subscript></entry>
-		  <entry>R<subscript>33high</subscript></entry>
-		</row>
-	      </tbody>
-	    </tgroup>
-	  </informaltable>
-	</para>
-      </formalpara>
-    </example>
-  </refsect1>
-</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb16.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb16.xml
new file mode 100644
index 0000000..590266f
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb16.xml
@@ -0,0 +1,91 @@
+    <refentry>
+      <refmeta>
+	<refentrytitle>V4L2_PIX_FMT_SRGGB16 ('RG16'),
+	 V4L2_PIX_FMT_SGRBG16 ('GR16'),
+	 V4L2_PIX_FMT_SGBRG16 ('GB16'),
+	 V4L2_PIX_FMT_SBGGR16 ('BYR2')
+	 </refentrytitle>
+	&manvol;
+      </refmeta>
+      <refnamediv>
+	<refname id="V4L2-PIX-FMT-SRGGB16"><constant>V4L2_PIX_FMT_SRGGB16</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGRBG16"><constant>V4L2_PIX_FMT_SGRBG16</constant></refname>
+	<refname id="V4L2-PIX-FMT-SGBRG16"><constant>V4L2_PIX_FMT_SGBRG16</constant></refname>
+	<refname id="V4L2-PIX-FMT-SBGGR16"><constant>V4L2_PIX_FMT_SBGGR16</constant></refname>
+	<refpurpose>16-bit Bayer formats</refpurpose>
+      </refnamediv>
+      <refsect1>
+	<title>Description</title>
+
+	<para>These four pixel formats are raw sRGB / Bayer formats with
+16 bits per colour. Each colour component is stored in a 16-bit word.
+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:</para>
+
+    <example>
+      <title><constant>V4L2_PIX_FMT_SBGGR16</constant> 4 &times; 4
+pixel image</title>
+
+      <formalpara>
+	<title>Byte Order.</title>
+	<para>Each cell is one byte.
+	  <informaltable frame="none">
+	    <tgroup cols="5" align="center">
+	      <colspec align="left" colwidth="2*" />
+	      <tbody valign="top">
+		<row>
+		  <entry>start&nbsp;+&nbsp;0:</entry>
+		  <entry>B<subscript>00low</subscript></entry>
+		  <entry>B<subscript>00high</subscript></entry>
+		  <entry>G<subscript>01low</subscript></entry>
+		  <entry>G<subscript>01high</subscript></entry>
+		  <entry>B<subscript>02low</subscript></entry>
+		  <entry>B<subscript>02high</subscript></entry>
+		  <entry>G<subscript>03low</subscript></entry>
+		  <entry>G<subscript>03high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;8:</entry>
+		  <entry>G<subscript>10low</subscript></entry>
+		  <entry>G<subscript>10high</subscript></entry>
+		  <entry>R<subscript>11low</subscript></entry>
+		  <entry>R<subscript>11high</subscript></entry>
+		  <entry>G<subscript>12low</subscript></entry>
+		  <entry>G<subscript>12high</subscript></entry>
+		  <entry>R<subscript>13low</subscript></entry>
+		  <entry>R<subscript>13high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;16:</entry>
+		  <entry>B<subscript>20low</subscript></entry>
+		  <entry>B<subscript>20high</subscript></entry>
+		  <entry>G<subscript>21low</subscript></entry>
+		  <entry>G<subscript>21high</subscript></entry>
+		  <entry>B<subscript>22low</subscript></entry>
+		  <entry>B<subscript>22high</subscript></entry>
+		  <entry>G<subscript>23low</subscript></entry>
+		  <entry>G<subscript>23high</subscript></entry>
+		</row>
+		<row>
+		  <entry>start&nbsp;+&nbsp;24:</entry>
+		  <entry>G<subscript>30low</subscript></entry>
+		  <entry>G<subscript>30high</subscript></entry>
+		  <entry>R<subscript>31low</subscript></entry>
+		  <entry>R<subscript>31high</subscript></entry>
+		  <entry>G<subscript>32low</subscript></entry>
+		  <entry>G<subscript>32high</subscript></entry>
+		  <entry>R<subscript>33low</subscript></entry>
+		  <entry>R<subscript>33high</subscript></entry>
+		</row>
+	      </tbody>
+	    </tgroup>
+	  </informaltable>
+	</para>
+      </formalpara>
+    </example>
+
+  </refsect1>
+</refentry>
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
index 296a50a..2c22098 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -1587,7 +1587,6 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.<
     &sub-sgbrg8;
     &sub-sgrbg8;
     &sub-srggb8;
-    &sub-sbggr16;
     &sub-srggb10;
     &sub-srggb10p;
     &sub-srggb10alaw8;
@@ -1596,6 +1595,7 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.<
     &sub-srggb12p;
     &sub-srggb14;
     &sub-srggb14p;
+    &sub-srggb16;
   </section>
 
   <section id="yuv-formats">
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 32e9e74..c62c85b 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -593,6 +593,9 @@ struct v4l2_pix_format {
 #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.. */
+#define V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6') /* 16  GBGB.. RGRG.. */
+#define V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6') /* 16  GRGR.. BGBG.. */
+#define V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6') /* 16  RGRG.. GBGB.. */
 
 /* compressed formats */
 #define V4L2_PIX_FMT_MJPEG    v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG   */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH v2.1 6/9] v4l: Add 14-bit raw bayer pixel format definitions
  2016-06-27 14:45   ` [PATCH v2.1 6/9] " Sakari Ailus
@ 2016-07-08  9:24     ` Hans Verkuil
  0 siblings, 0 replies; 21+ messages in thread
From: Hans Verkuil @ 2016-07-08  9:24 UTC (permalink / raw)
  To: Sakari Ailus, linux-media

On 06/27/2016 04:45 PM, Sakari Ailus wrote:
> 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 <jouni.ukkonen@intel.com>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

You also need to update v4l2-ioctl.c, v4l_fill_fmtdesc() with the new pixel formats.

I'm OK if that's done in a follow-up patch for all the new pixelformat you
have defined in these patches.

Regards,

	Hans

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2.2 09/10] v4l: 16-bit BGGR is always 16 bits
  2016-07-07  6:48     ` [PATCH v2.2 09/10] v4l: 16-bit BGGR is always 16 bits Sakari Ailus
  2016-07-07  6:48       ` [PATCH v2.2 10/10] v4l: Add 16-bit raw bayer pixel format definitions Sakari Ailus
@ 2016-07-13 13:47       ` Lad, Prabhakar
  1 sibling, 0 replies; 21+ messages in thread
From: Lad, Prabhakar @ 2016-07-13 13:47 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media, Hans Verkuil, Benoit Parrot, Sekhar Nori

On Thu, Jul 7, 2016 at 7:48 AM, Sakari Ailus
<sakari.ailus@linux.intel.com> wrote:
> The V4L2_PIX_FMT_SBGGR16 format is documented to contain samples of fewer
> than 16 bits. However, we do have specific definitions for smaller sample
> sizes. Therefore, this note is redundant from the API point of view.
>
> Currently only two drivers, am437x and davinci, use the V4L2_PIX_FMT_SBGGR16
> pixelformat currently. The sampling precision is understood to be 16 bits in
> all current cases.
>
> Remove the note on sampling precision.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Cheers,
--Prabhakar Lad

>  Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml b/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
> index 6494b05..789160565 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
> @@ -14,9 +14,7 @@
>  linkend="V4L2-PIX-FMT-SBGGR8">
>  <constant>V4L2_PIX_FMT_SBGGR8</constant></link>, except each pixel has
>  a depth of 16 bits. The least significant byte is stored at lower
> -memory addresses (little-endian). Note the actual sampling precision
> -may be lower than 16 bits, for example 10 bits per pixel with values
> -in range 0 to 1023.</para>
> +memory addresses (little-endian).</para>
>
>      <example>
>        <title><constant>V4L2_PIX_FMT_SBGGR16</constant> 4 &times; 4
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2.2 10/10] v4l: Add 16-bit raw bayer pixel format definitions
  2016-07-07  6:48       ` [PATCH v2.2 10/10] v4l: Add 16-bit raw bayer pixel format definitions Sakari Ailus
@ 2016-07-13 13:48         ` Lad, Prabhakar
  0 siblings, 0 replies; 21+ messages in thread
From: Lad, Prabhakar @ 2016-07-13 13:48 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media, Hans Verkuil, Benoit Parrot, Sekhar Nori

On Thu, Jul 7, 2016 at 7:48 AM, Sakari Ailus
<sakari.ailus@linux.intel.com> wrote:
> The formats added by this patch are:
>
>         V4L2_PIX_FMT_SBGGR16
>         V4L2_PIX_FMT_SGBRG16
>         V4L2_PIX_FMT_SGRBG16
>
> V4L2_PIX_FMT_SRGGB16 already existed before the patch. Rework the
> documentation to match that of the other sample depths.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Cheers,
--Prabhakar Lad

>  Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml | 81 -------------------
>  Documentation/DocBook/media/v4l/pixfmt-srggb16.xml | 91 ++++++++++++++++++++++
>  Documentation/DocBook/media/v4l/pixfmt.xml         |  2 +-
>  include/uapi/linux/videodev2.h                     |  3 +
>  4 files changed, 95 insertions(+), 82 deletions(-)
>  delete mode 100644 Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
>  create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb16.xml
>
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml b/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
> deleted file mode 100644
> index 789160565..0000000
> --- a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml
> +++ /dev/null
> @@ -1,81 +0,0 @@
> -<refentry id="V4L2-PIX-FMT-SBGGR16">
> -  <refmeta>
> -    <refentrytitle>V4L2_PIX_FMT_SBGGR16 ('BYR2')</refentrytitle>
> -    &manvol;
> -  </refmeta>
> -  <refnamediv>
> -    <refname><constant>V4L2_PIX_FMT_SBGGR16</constant></refname>
> -    <refpurpose>Bayer RGB format</refpurpose>
> -  </refnamediv>
> -  <refsect1>
> -    <title>Description</title>
> -
> -    <para>This format is similar to <link
> -linkend="V4L2-PIX-FMT-SBGGR8">
> -<constant>V4L2_PIX_FMT_SBGGR8</constant></link>, except each pixel has
> -a depth of 16 bits. The least significant byte is stored at lower
> -memory addresses (little-endian).</para>
> -
> -    <example>
> -      <title><constant>V4L2_PIX_FMT_SBGGR16</constant> 4 &times; 4
> -pixel image</title>
> -
> -      <formalpara>
> -       <title>Byte Order.</title>
> -       <para>Each cell is one byte.
> -         <informaltable frame="none">
> -           <tgroup cols="5" align="center">
> -             <colspec align="left" colwidth="2*" />
> -             <tbody valign="top">
> -               <row>
> -                 <entry>start&nbsp;+&nbsp;0:</entry>
> -                 <entry>B<subscript>00low</subscript></entry>
> -                 <entry>B<subscript>00high</subscript></entry>
> -                 <entry>G<subscript>01low</subscript></entry>
> -                 <entry>G<subscript>01high</subscript></entry>
> -                 <entry>B<subscript>02low</subscript></entry>
> -                 <entry>B<subscript>02high</subscript></entry>
> -                 <entry>G<subscript>03low</subscript></entry>
> -                 <entry>G<subscript>03high</subscript></entry>
> -               </row>
> -               <row>
> -                 <entry>start&nbsp;+&nbsp;8:</entry>
> -                 <entry>G<subscript>10low</subscript></entry>
> -                 <entry>G<subscript>10high</subscript></entry>
> -                 <entry>R<subscript>11low</subscript></entry>
> -                 <entry>R<subscript>11high</subscript></entry>
> -                 <entry>G<subscript>12low</subscript></entry>
> -                 <entry>G<subscript>12high</subscript></entry>
> -                 <entry>R<subscript>13low</subscript></entry>
> -                 <entry>R<subscript>13high</subscript></entry>
> -               </row>
> -               <row>
> -                 <entry>start&nbsp;+&nbsp;16:</entry>
> -                 <entry>B<subscript>20low</subscript></entry>
> -                 <entry>B<subscript>20high</subscript></entry>
> -                 <entry>G<subscript>21low</subscript></entry>
> -                 <entry>G<subscript>21high</subscript></entry>
> -                 <entry>B<subscript>22low</subscript></entry>
> -                 <entry>B<subscript>22high</subscript></entry>
> -                 <entry>G<subscript>23low</subscript></entry>
> -                 <entry>G<subscript>23high</subscript></entry>
> -               </row>
> -               <row>
> -                 <entry>start&nbsp;+&nbsp;24:</entry>
> -                 <entry>G<subscript>30low</subscript></entry>
> -                 <entry>G<subscript>30high</subscript></entry>
> -                 <entry>R<subscript>31low</subscript></entry>
> -                 <entry>R<subscript>31high</subscript></entry>
> -                 <entry>G<subscript>32low</subscript></entry>
> -                 <entry>G<subscript>32high</subscript></entry>
> -                 <entry>R<subscript>33low</subscript></entry>
> -                 <entry>R<subscript>33high</subscript></entry>
> -               </row>
> -             </tbody>
> -           </tgroup>
> -         </informaltable>
> -       </para>
> -      </formalpara>
> -    </example>
> -  </refsect1>
> -</refentry>
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb16.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb16.xml
> new file mode 100644
> index 0000000..590266f
> --- /dev/null
> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb16.xml
> @@ -0,0 +1,91 @@
> +    <refentry>
> +      <refmeta>
> +       <refentrytitle>V4L2_PIX_FMT_SRGGB16 ('RG16'),
> +        V4L2_PIX_FMT_SGRBG16 ('GR16'),
> +        V4L2_PIX_FMT_SGBRG16 ('GB16'),
> +        V4L2_PIX_FMT_SBGGR16 ('BYR2')
> +        </refentrytitle>
> +       &manvol;
> +      </refmeta>
> +      <refnamediv>
> +       <refname id="V4L2-PIX-FMT-SRGGB16"><constant>V4L2_PIX_FMT_SRGGB16</constant></refname>
> +       <refname id="V4L2-PIX-FMT-SGRBG16"><constant>V4L2_PIX_FMT_SGRBG16</constant></refname>
> +       <refname id="V4L2-PIX-FMT-SGBRG16"><constant>V4L2_PIX_FMT_SGBRG16</constant></refname>
> +       <refname id="V4L2-PIX-FMT-SBGGR16"><constant>V4L2_PIX_FMT_SBGGR16</constant></refname>
> +       <refpurpose>16-bit Bayer formats</refpurpose>
> +      </refnamediv>
> +      <refsect1>
> +       <title>Description</title>
> +
> +       <para>These four pixel formats are raw sRGB / Bayer formats with
> +16 bits per colour. Each colour component is stored in a 16-bit word.
> +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:</para>
> +
> +    <example>
> +      <title><constant>V4L2_PIX_FMT_SBGGR16</constant> 4 &times; 4
> +pixel image</title>
> +
> +      <formalpara>
> +       <title>Byte Order.</title>
> +       <para>Each cell is one byte.
> +         <informaltable frame="none">
> +           <tgroup cols="5" align="center">
> +             <colspec align="left" colwidth="2*" />
> +             <tbody valign="top">
> +               <row>
> +                 <entry>start&nbsp;+&nbsp;0:</entry>
> +                 <entry>B<subscript>00low</subscript></entry>
> +                 <entry>B<subscript>00high</subscript></entry>
> +                 <entry>G<subscript>01low</subscript></entry>
> +                 <entry>G<subscript>01high</subscript></entry>
> +                 <entry>B<subscript>02low</subscript></entry>
> +                 <entry>B<subscript>02high</subscript></entry>
> +                 <entry>G<subscript>03low</subscript></entry>
> +                 <entry>G<subscript>03high</subscript></entry>
> +               </row>
> +               <row>
> +                 <entry>start&nbsp;+&nbsp;8:</entry>
> +                 <entry>G<subscript>10low</subscript></entry>
> +                 <entry>G<subscript>10high</subscript></entry>
> +                 <entry>R<subscript>11low</subscript></entry>
> +                 <entry>R<subscript>11high</subscript></entry>
> +                 <entry>G<subscript>12low</subscript></entry>
> +                 <entry>G<subscript>12high</subscript></entry>
> +                 <entry>R<subscript>13low</subscript></entry>
> +                 <entry>R<subscript>13high</subscript></entry>
> +               </row>
> +               <row>
> +                 <entry>start&nbsp;+&nbsp;16:</entry>
> +                 <entry>B<subscript>20low</subscript></entry>
> +                 <entry>B<subscript>20high</subscript></entry>
> +                 <entry>G<subscript>21low</subscript></entry>
> +                 <entry>G<subscript>21high</subscript></entry>
> +                 <entry>B<subscript>22low</subscript></entry>
> +                 <entry>B<subscript>22high</subscript></entry>
> +                 <entry>G<subscript>23low</subscript></entry>
> +                 <entry>G<subscript>23high</subscript></entry>
> +               </row>
> +               <row>
> +                 <entry>start&nbsp;+&nbsp;24:</entry>
> +                 <entry>G<subscript>30low</subscript></entry>
> +                 <entry>G<subscript>30high</subscript></entry>
> +                 <entry>R<subscript>31low</subscript></entry>
> +                 <entry>R<subscript>31high</subscript></entry>
> +                 <entry>G<subscript>32low</subscript></entry>
> +                 <entry>G<subscript>32high</subscript></entry>
> +                 <entry>R<subscript>33low</subscript></entry>
> +                 <entry>R<subscript>33high</subscript></entry>
> +               </row>
> +             </tbody>
> +           </tgroup>
> +         </informaltable>
> +       </para>
> +      </formalpara>
> +    </example>
> +
> +  </refsect1>
> +</refentry>
> diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
> index 296a50a..2c22098 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt.xml
> @@ -1587,7 +1587,6 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.<
>      &sub-sgbrg8;
>      &sub-sgrbg8;
>      &sub-srggb8;
> -    &sub-sbggr16;
>      &sub-srggb10;
>      &sub-srggb10p;
>      &sub-srggb10alaw8;
> @@ -1596,6 +1595,7 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.<
>      &sub-srggb12p;
>      &sub-srggb14;
>      &sub-srggb14p;
> +    &sub-srggb16;
>    </section>
>
>    <section id="yuv-formats">
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 32e9e74..c62c85b 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -593,6 +593,9 @@ struct v4l2_pix_format {
>  #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.. */
> +#define V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6') /* 16  GBGB.. RGRG.. */
> +#define V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6') /* 16  GRGR.. BGBG.. */
> +#define V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6') /* 16  RGRG.. GBGB.. */
>
>  /* compressed formats */
>  #define V4L2_PIX_FMT_MJPEG    v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG   */
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-07-13 14:04 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-20 16:20 [PATCH v2 0/7] New raw bayer format definitions, fixes Sakari Ailus
2016-06-20 16:20 ` [PATCH v2 1/7] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats Sakari Ailus
2016-06-20 17:03   ` Hans Verkuil
2016-06-20 20:38     ` Dave Stevenson
2016-06-21  6:24       ` Hans Verkuil
2016-06-20 16:20 ` [PATCH v2 2/7] v4l: Fix number of zeroed high order bits in 12-bit raw format defs Sakari Ailus
2016-06-20 16:54   ` Hans Verkuil
2016-06-20 16:20 ` [PATCH v2 3/7] v4l: Clean up raw bayer pixel format definitions Sakari Ailus
2016-06-20 16:54   ` Hans Verkuil
2016-06-20 16:20 ` [PATCH v2 4/7] v4l: Add packed Bayer raw12 pixel formats Sakari Ailus
2016-06-20 16:20 ` [PATCH v2 5/7] media: Add 1X14 14-bit raw bayer media bus code definitions Sakari Ailus
2016-06-20 16:20 ` [PATCH v2 6/7] v4l: Add 14-bit raw bayer pixel format definitions Sakari Ailus
2016-06-27 14:45   ` [PATCH v2.1 6/9] " Sakari Ailus
2016-07-08  9:24     ` Hans Verkuil
2016-06-20 16:20 ` [PATCH v2 7/7] v4l: Add packed Bayer raw14 pixel formats Sakari Ailus
2016-06-27 14:57 ` [PATCH v2.1 8/9] media: Add 1X16 16-bit raw bayer media bus code definitions Sakari Ailus
2016-06-27 14:57   ` [PATCH v2.1 9/9] v4l: Add 16-bit raw bayer pixel format definitions Sakari Ailus
2016-07-07  6:48     ` [PATCH v2.2 09/10] v4l: 16-bit BGGR is always 16 bits Sakari Ailus
2016-07-07  6:48       ` [PATCH v2.2 10/10] v4l: Add 16-bit raw bayer pixel format definitions Sakari Ailus
2016-07-13 13:48         ` Lad, Prabhakar
2016-07-13 13:47       ` [PATCH v2.2 09/10] v4l: 16-bit BGGR is always 16 bits Lad, Prabhakar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.