linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] New raw bayer format definitions, fixes
@ 2016-05-27 12:44 Sakari Ailus
  2016-05-27 12:44 ` [PATCH 1/6] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats Sakari Ailus
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Sakari Ailus @ 2016-05-27 12:44 UTC (permalink / raw)
  To: linux-media; +Cc: g.liakhovetski

Hi,

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.

-- 
Kind regards,
Sakari


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

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

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] 17+ messages in thread

* [PATCH 2/6] v4l: Fix number of zeroed high order bits in 12-bit raw format defs
  2016-05-27 12:44 [PATCH 0/6] New raw bayer format definitions, fixes Sakari Ailus
  2016-05-27 12:44 ` [PATCH 1/6] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats Sakari Ailus
@ 2016-05-27 12:44 ` Sakari Ailus
  2016-06-20 15:13   ` Hans Verkuil
  2016-05-27 12:44 ` [PATCH 3/6] v4l: Add packed Bayer raw12 pixel formats Sakari Ailus
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Sakari Ailus @ 2016-05-27 12:44 UTC (permalink / raw)
  To: linux-media; +Cc: g.liakhovetski

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] 17+ messages in thread

* [PATCH 3/6] v4l: Add packed Bayer raw12 pixel formats
  2016-05-27 12:44 [PATCH 0/6] New raw bayer format definitions, fixes Sakari Ailus
  2016-05-27 12:44 ` [PATCH 1/6] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats Sakari Ailus
  2016-05-27 12:44 ` [PATCH 2/6] v4l: Fix number of zeroed high order bits in 12-bit raw format defs Sakari Ailus
@ 2016-05-27 12:44 ` Sakari Ailus
  2016-06-20 15:21   ` Hans Verkuil
  2016-05-27 12:44 ` [PATCH 4/6] media: Add 1X14 14-bit raw bayer media bus code definitions Sakari Ailus
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Sakari Ailus @ 2016-05-27 12:44 UTC (permalink / raw)
  To: linux-media; +Cc: g.liakhovetski

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>
---
 .../DocBook/media/v4l/pixfmt-srggb12p.xml          | 103 +++++++++++++++++++++
 Documentation/DocBook/media/v4l/pixfmt.xml         |   1 +
 include/uapi/linux/videodev2.h                     |   5 +
 3 files changed, 109 insertions(+)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml
new file mode 100644
index 0000000..affa366
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml
@@ -0,0 +1,103 @@
+    <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] 17+ messages in thread

* [PATCH 4/6] media: Add 1X14 14-bit raw bayer media bus code definitions
  2016-05-27 12:44 [PATCH 0/6] New raw bayer format definitions, fixes Sakari Ailus
                   ` (2 preceding siblings ...)
  2016-05-27 12:44 ` [PATCH 3/6] v4l: Add packed Bayer raw12 pixel formats Sakari Ailus
@ 2016-05-27 12:44 ` Sakari Ailus
  2016-06-20 15:23   ` Hans Verkuil
  2016-05-27 12:44 ` [PATCH 5/6] v4l: Add 14-bit raw bayer pixel format definitions Sakari Ailus
  2016-05-27 12:44 ` [PATCH 6/6] v4l: Add packed Bayer raw14 pixel formats Sakari Ailus
  5 siblings, 1 reply; 17+ messages in thread
From: Sakari Ailus @ 2016-05-27 12:44 UTC (permalink / raw)
  To: linux-media; +Cc: g.liakhovetski, 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>
---
 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] 17+ messages in thread

* [PATCH 5/6] v4l: Add 14-bit raw bayer pixel format definitions
  2016-05-27 12:44 [PATCH 0/6] New raw bayer format definitions, fixes Sakari Ailus
                   ` (3 preceding siblings ...)
  2016-05-27 12:44 ` [PATCH 4/6] media: Add 1X14 14-bit raw bayer media bus code definitions Sakari Ailus
@ 2016-05-27 12:44 ` Sakari Ailus
  2016-06-20 15:24   ` Hans Verkuil
  2016-05-27 12:44 ` [PATCH 6/6] v4l: Add packed Bayer raw14 pixel formats Sakari Ailus
  5 siblings, 1 reply; 17+ messages in thread
From: Sakari Ailus @ 2016-05-27 12:44 UTC (permalink / raw)
  To: linux-media; +Cc: g.liakhovetski

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>
---
 Documentation/DocBook/media/v4l/pixfmt-srggb14.xml | 90 ++++++++++++++++++++++
 Documentation/DocBook/media/v4l/pixfmt.xml         |  1 +
 include/uapi/linux/videodev2.h                     |  4 +
 3 files changed, 95 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..7e82d7e
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml
@@ -0,0 +1,90 @@
+    <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, high 2 bits in 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] 17+ messages in thread

* [PATCH 6/6] v4l: Add packed Bayer raw14 pixel formats
  2016-05-27 12:44 [PATCH 0/6] New raw bayer format definitions, fixes Sakari Ailus
                   ` (4 preceding siblings ...)
  2016-05-27 12:44 ` [PATCH 5/6] v4l: Add 14-bit raw bayer pixel format definitions Sakari Ailus
@ 2016-05-27 12:44 ` Sakari Ailus
  2016-06-20 15:29   ` Hans Verkuil
  5 siblings, 1 reply; 17+ messages in thread
From: Sakari Ailus @ 2016-05-27 12:44 UTC (permalink / raw)
  To: linux-media; +Cc: g.liakhovetski

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>
---
 .../DocBook/media/v4l/pixfmt-srggb14p.xml          | 118 +++++++++++++++++++++
 Documentation/DocBook/media/v4l/pixfmt.xml         |   1 +
 include/uapi/linux/videodev2.h                     |   5 +
 3 files changed, 124 insertions(+)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml
new file mode 100644
index 0000000..ecb06ef
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml
@@ -0,0 +1,118 @@
+    <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 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_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] 17+ messages in thread

* Re: [PATCH 1/6] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats
  2016-05-27 12:44 ` [PATCH 1/6] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats Sakari Ailus
@ 2016-06-20 15:12   ` Hans Verkuil
  2016-06-20 15:34     ` Sakari Ailus
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Verkuil @ 2016-06-20 15:12 UTC (permalink / raw)
  To: Sakari Ailus, linux-media; +Cc: g.liakhovetski, Laurent Pinchart

On 05/27/2016 02:44 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.

This is used by the uvc driver. Has this been verified against a UVC webcam
that supports this format? Laurent, do you have such a device?

Just in case UVC actually supports this as it is documented today.

Regards,

	Hans

> 
> 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>
> 

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

* Re: [PATCH 2/6] v4l: Fix number of zeroed high order bits in 12-bit raw format defs
  2016-05-27 12:44 ` [PATCH 2/6] v4l: Fix number of zeroed high order bits in 12-bit raw format defs Sakari Ailus
@ 2016-06-20 15:13   ` Hans Verkuil
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Verkuil @ 2016-06-20 15:13 UTC (permalink / raw)
  To: Sakari Ailus, linux-media; +Cc: g.liakhovetski

On 05/27/2016 02:44 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>

Thanks,

	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] 17+ messages in thread

* Re: [PATCH 3/6] v4l: Add packed Bayer raw12 pixel formats
  2016-05-27 12:44 ` [PATCH 3/6] v4l: Add packed Bayer raw12 pixel formats Sakari Ailus
@ 2016-06-20 15:21   ` Hans Verkuil
  2016-06-20 15:37     ` Sakari Ailus
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Verkuil @ 2016-06-20 15:21 UTC (permalink / raw)
  To: Sakari Ailus, linux-media; +Cc: g.liakhovetski

On 05/27/2016 02:44 PM, Sakari Ailus wrote:
> 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>
> ---
>  .../DocBook/media/v4l/pixfmt-srggb12p.xml          | 103 +++++++++++++++++++++
>  Documentation/DocBook/media/v4l/pixfmt.xml         |   1 +
>  include/uapi/linux/videodev2.h                     |   5 +
>  3 files changed, 109 insertions(+)
>  create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml
> 
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml
> new file mode 100644
> index 0000000..affa366
> --- /dev/null
> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml
> @@ -0,0 +1,103 @@
> +    <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'),

Nitpick: the last comma should be removed otherwise the title would end with it.

Looks good otherwise.

With the comma removed:

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

Regards,

	Hans

> +	 </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 */
> 

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

* Re: [PATCH 4/6] media: Add 1X14 14-bit raw bayer media bus code definitions
  2016-05-27 12:44 ` [PATCH 4/6] media: Add 1X14 14-bit raw bayer media bus code definitions Sakari Ailus
@ 2016-06-20 15:23   ` Hans Verkuil
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Verkuil @ 2016-06-20 15:23 UTC (permalink / raw)
  To: Sakari Ailus, linux-media; +Cc: g.liakhovetski, Jouni Ukkonen

On 05/27/2016 02:44 PM, Sakari Ailus wrote:
> 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>

	Hans

> ---
>  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
> 

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

* Re: [PATCH 5/6] v4l: Add 14-bit raw bayer pixel format definitions
  2016-05-27 12:44 ` [PATCH 5/6] v4l: Add 14-bit raw bayer pixel format definitions Sakari Ailus
@ 2016-06-20 15:24   ` Hans Verkuil
  2016-06-20 16:03     ` Sakari Ailus
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Verkuil @ 2016-06-20 15:24 UTC (permalink / raw)
  To: Sakari Ailus, linux-media; +Cc: g.liakhovetski

On 05/27/2016 02:44 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>
> ---
>  Documentation/DocBook/media/v4l/pixfmt-srggb14.xml | 90 ++++++++++++++++++++++
>  Documentation/DocBook/media/v4l/pixfmt.xml         |  1 +
>  include/uapi/linux/videodev2.h                     |  4 +
>  3 files changed, 95 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..7e82d7e
> --- /dev/null
> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml
> @@ -0,0 +1,90 @@
> +    <refentry>
> +      <refmeta>
> +	<refentrytitle>V4L2_PIX_FMT_SRGGB14 ('RG14'),
> +	 V4L2_PIX_FMT_SGRBG14 ('BA14'),
> +	 V4L2_PIX_FMT_SGBRG14 ('GB14'),
> +	 V4L2_PIX_FMT_SBGGR14 ('BG14'),

Same comma problem.

> +	 </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>

s/formats/formats:/

> +
> +    <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, high 2 bits in high bytes are 0.

s/high 2/the high 2/

> +	  <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 */
> 

Regards,

	Hans

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

* Re: [PATCH 6/6] v4l: Add packed Bayer raw14 pixel formats
  2016-05-27 12:44 ` [PATCH 6/6] v4l: Add packed Bayer raw14 pixel formats Sakari Ailus
@ 2016-06-20 15:29   ` Hans Verkuil
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Verkuil @ 2016-06-20 15:29 UTC (permalink / raw)
  To: Sakari Ailus, linux-media; +Cc: g.liakhovetski

On 05/27/2016 02:44 PM, Sakari Ailus wrote:
> 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>
> ---
>  .../DocBook/media/v4l/pixfmt-srggb14p.xml          | 118 +++++++++++++++++++++
>  Documentation/DocBook/media/v4l/pixfmt.xml         |   1 +
>  include/uapi/linux/videodev2.h                     |   5 +
>  3 files changed, 124 insertions(+)
>  create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml
> 
> diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml
> new file mode 100644
> index 0000000..ecb06ef
> --- /dev/null
> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14p.xml
> @@ -0,0 +1,118 @@
> +    <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'),

Again comma too many.

> +	 </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 significants bits of each

s/significants/significant/

After fixing this:

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

Regards,

	Hans

> +	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 */
> 

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

* Re: [PATCH 1/6] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats
  2016-06-20 15:12   ` Hans Verkuil
@ 2016-06-20 15:34     ` Sakari Ailus
  0 siblings, 0 replies; 17+ messages in thread
From: Sakari Ailus @ 2016-06-20 15:34 UTC (permalink / raw)
  To: Hans Verkuil, linux-media; +Cc: g.liakhovetski, Laurent Pinchart

Hi Hans,

Hans Verkuil wrote:
> On 05/27/2016 02:44 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.
> 
> This is used by the uvc driver. Has this been verified against a UVC webcam
> that supports this format? Laurent, do you have such a device?

I bet Laurent hasn't got one. Guennadi, could you comment on this?

-- 
Regards,

Sakari Ailus
sakari.ailus@linux.intel.com

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

* Re: [PATCH 3/6] v4l: Add packed Bayer raw12 pixel formats
  2016-06-20 15:21   ` Hans Verkuil
@ 2016-06-20 15:37     ` Sakari Ailus
  0 siblings, 0 replies; 17+ messages in thread
From: Sakari Ailus @ 2016-06-20 15:37 UTC (permalink / raw)
  To: Hans Verkuil, linux-media; +Cc: g.liakhovetski

Hi Hans,

Thanks for the review!

Hans Verkuil wrote:
> On 05/27/2016 02:44 PM, Sakari Ailus wrote:
>> 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>
>> ---
>>  .../DocBook/media/v4l/pixfmt-srggb12p.xml          | 103 +++++++++++++++++++++
>>  Documentation/DocBook/media/v4l/pixfmt.xml         |   1 +
>>  include/uapi/linux/videodev2.h                     |   5 +
>>  3 files changed, 109 insertions(+)
>>  create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml
>>
>> diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml b/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml
>> new file mode 100644
>> index 0000000..affa366
>> --- /dev/null
>> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb12p.xml
>> @@ -0,0 +1,103 @@
>> +    <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'),
> 
> Nitpick: the last comma should be removed otherwise the title would end with it.
> 
> Looks good otherwise.
> 
> With the comma removed:
> 
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Indeed. Looks like this comes from the 10-bit definitions. I'll fix that
one as well.

-- 
Sakari Ailus
sakari.ailus@linux.intel.com

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

* Re: [PATCH 5/6] v4l: Add 14-bit raw bayer pixel format definitions
  2016-06-20 15:24   ` Hans Verkuil
@ 2016-06-20 16:03     ` Sakari Ailus
  2016-06-20 16:05       ` Hans Verkuil
  0 siblings, 1 reply; 17+ messages in thread
From: Sakari Ailus @ 2016-06-20 16:03 UTC (permalink / raw)
  To: Hans Verkuil, linux-media; +Cc: g.liakhovetski

Hi Hans,

Hans Verkuil wrote:
> On 05/27/2016 02:44 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>
>> ---
>>  Documentation/DocBook/media/v4l/pixfmt-srggb14.xml | 90 ++++++++++++++++++++++
>>  Documentation/DocBook/media/v4l/pixfmt.xml         |  1 +
>>  include/uapi/linux/videodev2.h                     |  4 +
>>  3 files changed, 95 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..7e82d7e
>> --- /dev/null
>> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml
>> @@ -0,0 +1,90 @@
>> +    <refentry>
>> +      <refmeta>
>> +	<refentrytitle>V4L2_PIX_FMT_SRGGB14 ('RG14'),
>> +	 V4L2_PIX_FMT_SGRBG14 ('BA14'),
>> +	 V4L2_PIX_FMT_SGBRG14 ('GB14'),
>> +	 V4L2_PIX_FMT_SBGGR14 ('BG14'),
> 
> Same comma problem.

Fixed.

> 
>> +	 </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>
> 
> s/formats/formats:/

Fixed.

>> +
>> +    <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, high 2 bits in high bytes are 0.
> 
> s/high 2/the high 2/

After re-reading the patch, I changed this to "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 */
>>
> 
> Regards,
> 
> 	Hans
> 

-- 
Kind regards,

Sakari Ailus
sakari.ailus@linux.intel.com

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

* Re: [PATCH 5/6] v4l: Add 14-bit raw bayer pixel format definitions
  2016-06-20 16:03     ` Sakari Ailus
@ 2016-06-20 16:05       ` Hans Verkuil
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Verkuil @ 2016-06-20 16:05 UTC (permalink / raw)
  To: Sakari Ailus, linux-media; +Cc: g.liakhovetski

On 06/20/2016 06:03 PM, Sakari Ailus wrote:
> Hi Hans,
> 
> Hans Verkuil wrote:
>> On 05/27/2016 02:44 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>
>>> ---
>>>  Documentation/DocBook/media/v4l/pixfmt-srggb14.xml | 90 ++++++++++++++++++++++
>>>  Documentation/DocBook/media/v4l/pixfmt.xml         |  1 +
>>>  include/uapi/linux/videodev2.h                     |  4 +
>>>  3 files changed, 95 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..7e82d7e
>>> --- /dev/null
>>> +++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml
>>> @@ -0,0 +1,90 @@
>>> +    <refentry>
>>> +      <refmeta>
>>> +	<refentrytitle>V4L2_PIX_FMT_SRGGB14 ('RG14'),
>>> +	 V4L2_PIX_FMT_SGRBG14 ('BA14'),
>>> +	 V4L2_PIX_FMT_SGBRG14 ('GB14'),
>>> +	 V4L2_PIX_FMT_SBGGR14 ('BG14'),
>>
>> Same comma problem.
> 
> Fixed.
> 
>>
>>> +	 </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>
>>
>> s/formats/formats:/
> 
> Fixed.
> 
>>> +
>>> +    <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, high 2 bits in high bytes are 0.
>>
>> s/high 2/the high 2/
> 
> After re-reading the patch, I changed this to "Each cell is one byte,
> the 2 most significant bits in the high bytes are 0".

That is indeed better, although I would also say "two most" instead of "2 most".
It's slightly weird to have "one byte" followed by "2 most". Could be me, though.

Regards,

	Hans

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

end of thread, other threads:[~2016-06-20 16:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-27 12:44 [PATCH 0/6] New raw bayer format definitions, fixes Sakari Ailus
2016-05-27 12:44 ` [PATCH 1/6] v4l: Correct the ordering of LSBs of the 10-bit raw packed formats Sakari Ailus
2016-06-20 15:12   ` Hans Verkuil
2016-06-20 15:34     ` Sakari Ailus
2016-05-27 12:44 ` [PATCH 2/6] v4l: Fix number of zeroed high order bits in 12-bit raw format defs Sakari Ailus
2016-06-20 15:13   ` Hans Verkuil
2016-05-27 12:44 ` [PATCH 3/6] v4l: Add packed Bayer raw12 pixel formats Sakari Ailus
2016-06-20 15:21   ` Hans Verkuil
2016-06-20 15:37     ` Sakari Ailus
2016-05-27 12:44 ` [PATCH 4/6] media: Add 1X14 14-bit raw bayer media bus code definitions Sakari Ailus
2016-06-20 15:23   ` Hans Verkuil
2016-05-27 12:44 ` [PATCH 5/6] v4l: Add 14-bit raw bayer pixel format definitions Sakari Ailus
2016-06-20 15:24   ` Hans Verkuil
2016-06-20 16:03     ` Sakari Ailus
2016-06-20 16:05       ` Hans Verkuil
2016-05-27 12:44 ` [PATCH 6/6] v4l: Add packed Bayer raw14 pixel formats Sakari Ailus
2016-06-20 15:29   ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).