Re: [PATCH v2.1 6/9] v4l: Add 14-bit raw bayer pixel format definitions

2016-07-08 Thread Hans Verkuil
On 06/27/2016 04:45 PM, Sakari Ailus wrote:
> The formats added by this patch are:
> 
>   V4L2_PIX_FMT_SBGGR14
>   V4L2_PIX_FMT_SGBRG14
>   V4L2_PIX_FMT_SGRBG14
>   V4L2_PIX_FMT_SRGGB14
> 
> Signed-off-by: Jouni Ukkonen 
> Signed-off-by: Sakari Ailus 
> Acked-by: Hans Verkuil 

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

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

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2.1 6/9] v4l: Add 14-bit raw bayer pixel format definitions

2016-06-27 Thread Sakari Ailus
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 
Signed-off-by: Sakari Ailus 
Acked-by: Hans Verkuil 
---
since v2:

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

 Documentation/DocBook/media/v4l/pixfmt-srggb14.xml | 91 ++
 Documentation/DocBook/media/v4l/pixfmt.xml |  1 +
 include/uapi/linux/videodev2.h |  4 +
 3 files changed, 96 insertions(+)
 create mode 100644 Documentation/DocBook/media/v4l/pixfmt-srggb14.xml

diff --git a/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml 
b/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml
new file mode 100644
index 000..5139c45
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/pixfmt-srggb14.xml
@@ -0,0 +1,91 @@
+
+  
+   V4L2_PIX_FMT_SRGGB14 ('RG14'),
+V4L2_PIX_FMT_SGRBG14 ('GR14'),
+V4L2_PIX_FMT_SGBRG14 ('GB14'),
+V4L2_PIX_FMT_SBGGR14 ('BG14')
+
+   &manvol;
+  
+  
+   V4L2_PIX_FMT_SRGGB14
+   V4L2_PIX_FMT_SGRBG14
+   V4L2_PIX_FMT_SGBRG14
+   V4L2_PIX_FMT_SBGGR14
+   14-bit Bayer formats expanded to 16 bits
+  
+  
+   Description
+
+   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:
+
+
+  V4L2_PIX_FMT_SBGGR14 4 × 4
+pixel image
+
+  
+   Byte Order.
+   Each cell is one byte, the 2 most significant bits in the high
+ bytes are 0.
+ 
+   
+ 
+ 
+   
+ start + 0:
+ B00low
+ B00high
+ G01low
+ G01high
+ B02low
+ B02high
+ G03low
+ G03high
+   
+   
+ start + 8:
+ G10low
+ G10high
+ R11low
+ R11high
+ G12low
+ G12high
+ R13low
+ R13high
+   
+   
+ start + 16:
+ B20low
+ B20high
+ G21low
+ G21high
+ B22low
+ B22high
+ G23low
+ G23high
+   
+   
+ start + 24:
+ G30low
+ G30high
+ R31low
+ R31high
+ G32low
+ G32high
+ R33low
+ R33high
+   
+ 
+   
+ 
+   
+  
+
+  
+
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;
   
 
   
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 7ace868..86af01a 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -581,6 +581,10 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C')
 #define V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C')
 #define V4L2_PIX_FMT_SRGGB12P v4l2_fourcc('p', 'R', 'C', 'C')
+#define V4L2_PIX_FMT_SBGGR14 v4l2_fourcc('B', 'G', '1', '4') /* 14  BGBG.. 
GRGR.. */
+#define V4L2_PIX_FMT_SGBRG14 v4l2_fourcc('G', 'B', '1', '4') /* 14  GBGB.. 
RGRG.. */
+#define V4L2_PIX_FMT_SGRBG14 v4l2_fourcc('G', 'R', '1', '4') /* 14  GRGR.. 
BGBG.. */
+#define V4L2_PIX_FMT_SRGGB14 v4l2_fourcc('R', 'G', '1', '4') /* 14  RGRG.. 
GBGB.. */
 #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16  BGBG.. 
GRGR.. */
 
 /* compressed formats */
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html