aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2016-04-10 03:37:48 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-04-14 21:43:58 -0400
commit14d66538716574f8899b22bff24a68301e65f08d (patch)
tree321fabcd77f314c050fcc8e286a9c7110903c618
parent98eee2550f7b5e800641e90469f400a8c06fde73 (diff)
[media] v4l: Define a pixel format for the R-Car VSP1 1-D histogram engine
The format is used on the R-Car VSP1 video queues that carry 1-D histogram statistics data. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--Documentation/media/uapi/v4l/meta-formats.rst15
-rw-r--r--Documentation/media/uapi/v4l/pixfmt-meta-vsp1-hgo.rst168
-rw-r--r--Documentation/media/uapi/v4l/pixfmt.rst1
-rw-r--r--drivers/media/v4l2-core/v4l2-ioctl.c1
-rw-r--r--include/uapi/linux/videodev2.h3
5 files changed, 188 insertions, 0 deletions
diff --git a/Documentation/media/uapi/v4l/meta-formats.rst b/Documentation/media/uapi/v4l/meta-formats.rst
new file mode 100644
index 000000000000..05ab91e12f10
--- /dev/null
+++ b/Documentation/media/uapi/v4l/meta-formats.rst
@@ -0,0 +1,15 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _meta-formats:
4
5****************
6Metadata Formats
7****************
8
9These formats are used for the :ref:`metadata` interface only.
10
11
12.. toctree::
13 :maxdepth: 1
14
15 pixfmt-meta-vsp1-hgo
diff --git a/Documentation/media/uapi/v4l/pixfmt-meta-vsp1-hgo.rst b/Documentation/media/uapi/v4l/pixfmt-meta-vsp1-hgo.rst
new file mode 100644
index 000000000000..8d37bb313493
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-meta-vsp1-hgo.rst
@@ -0,0 +1,168 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _v4l2-meta-fmt-vsp1-hgo:
4
5*******************************
6V4L2_META_FMT_VSP1_HGO ('VSPH')
7*******************************
8
9Renesas R-Car VSP1 1-D Histogram Data
10
11
12Description
13===========
14
15This format describes histogram data generated by the Renesas R-Car VSP1 1-D
16Histogram (HGO) engine.
17
18The VSP1 HGO is a histogram computation engine that can operate on RGB, YCrCb
19or HSV data. It operates on a possibly cropped and subsampled input image and
20computes the minimum, maximum and sum of all pixels as well as per-channel
21histograms.
22
23The HGO can compute histograms independently per channel, on the maximum of the
24three channels (RGB data only) or on the Y channel only (YCbCr only). It can
25additionally output the histogram with 64 or 256 bins, resulting in four
26possible modes of operation.
27
28- In *64 bins normal mode*, the HGO operates on the three channels independently
29 to compute three 64-bins histograms. RGB, YCbCr and HSV image formats are
30 supported.
31- In *64 bins maximum mode*, the HGO operates on the maximum of the (R, G, B)
32 channels to compute a single 64-bins histogram. Only the RGB image format is
33 supported.
34- In *256 bins normal mode*, the HGO operates on the Y channel to compute a
35 single 256-bins histogram. Only the YCbCr image format is supported.
36- In *256 bins maximum mode*, the HGO operates on the maximum of the (R, G, B)
37 channels to compute a single 256-bins histogram. Only the RGB image format is
38 supported.
39
40**Byte Order.**
41All data is stored in memory in little endian format. Each cell in the tables
42contains one byte.
43
44.. flat-table:: VSP1 HGO Data - 64 Bins, Normal Mode (792 bytes)
45 :header-rows: 2
46 :stub-columns: 0
47
48 * - Offset
49 - :cspan:`4` Memory
50 * -
51 - [31:24]
52 - [23:16]
53 - [15:8]
54 - [7:0]
55 * - 0
56 - -
57 - R/Cr/H max [7:0]
58 - -
59 - R/Cr/H min [7:0]
60 * - 4
61 - -
62 - G/Y/S max [7:0]
63 - -
64 - G/Y/S min [7:0]
65 * - 8
66 - -
67 - B/Cb/V max [7:0]
68 - -
69 - B/Cb/V min [7:0]
70 * - 12
71 - :cspan:`4` R/Cr/H sum [31:0]
72 * - 16
73 - :cspan:`4` G/Y/S sum [31:0]
74 * - 20
75 - :cspan:`4` B/Cb/V sum [31:0]
76 * - 24
77 - :cspan:`4` R/Cr/H bin 0 [31:0]
78 * -
79 - :cspan:`4` ...
80 * - 276
81 - :cspan:`4` R/Cr/H bin 63 [31:0]
82 * - 280
83 - :cspan:`4` G/Y/S bin 0 [31:0]
84 * -
85 - :cspan:`4` ...
86 * - 532
87 - :cspan:`4` G/Y/S bin 63 [31:0]
88 * - 536
89 - :cspan:`4` B/Cb/V bin 0 [31:0]
90 * -
91 - :cspan:`4` ...
92 * - 788
93 - :cspan:`4` B/Cb/V bin 63 [31:0]
94
95.. flat-table:: VSP1 HGO Data - 64 Bins, Max Mode (264 bytes)
96 :header-rows: 2
97 :stub-columns: 0
98
99 * - Offset
100 - :cspan:`4` Memory
101 * -
102 - [31:24]
103 - [23:16]
104 - [15:8]
105 - [7:0]
106 * - 0
107 - -
108 - max(R,G,B) max [7:0]
109 - -
110 - max(R,G,B) min [7:0]
111 * - 4
112 - :cspan:`4` max(R,G,B) sum [31:0]
113 * - 8
114 - :cspan:`4` max(R,G,B) bin 0 [31:0]
115 * -
116 - :cspan:`4` ...
117 * - 260
118 - :cspan:`4` max(R,G,B) bin 63 [31:0]
119
120.. flat-table:: VSP1 HGO Data - 256 Bins, Normal Mode (1032 bytes)
121 :header-rows: 2
122 :stub-columns: 0
123
124 * - Offset
125 - :cspan:`4` Memory
126 * -
127 - [31:24]
128 - [23:16]
129 - [15:8]
130 - [7:0]
131 * - 0
132 - -
133 - Y max [7:0]
134 - -
135 - Y min [7:0]
136 * - 4
137 - :cspan:`4` Y sum [31:0]
138 * - 8
139 - :cspan:`4` Y bin 0 [31:0]
140 * -
141 - :cspan:`4` ...
142 * - 1028
143 - :cspan:`4` Y bin 255 [31:0]
144
145.. flat-table:: VSP1 HGO Data - 256 Bins, Max Mode (1032 bytes)
146 :header-rows: 2
147 :stub-columns: 0
148
149 * - Offset
150 - :cspan:`4` Memory
151 * -
152 - [31:24]
153 - [23:16]
154 - [15:8]
155 - [7:0]
156 * - 0
157 - -
158 - max(R,G,B) max [7:0]
159 - -
160 - max(R,G,B) min [7:0]
161 * - 4
162 - :cspan:`4` max(R,G,B) sum [31:0]
163 * - 8
164 - :cspan:`4` max(R,G,B) bin 0 [31:0]
165 * -
166 - :cspan:`4` ...
167 * - 1028
168 - :cspan:`4` max(R,G,B) bin 255 [31:0]
diff --git a/Documentation/media/uapi/v4l/pixfmt.rst b/Documentation/media/uapi/v4l/pixfmt.rst
index 4f184c7aedab..00737152497b 100644
--- a/Documentation/media/uapi/v4l/pixfmt.rst
+++ b/Documentation/media/uapi/v4l/pixfmt.rst
@@ -34,4 +34,5 @@ see also :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>`.)
34 pixfmt-013 34 pixfmt-013
35 sdr-formats 35 sdr-formats
36 tch-formats 36 tch-formats
37 meta-formats
37 pixfmt-reserved 38 pixfmt-reserved
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index dec6b120a5a2..a7c50241594e 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1233,6 +1233,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
1233 case V4L2_TCH_FMT_DELTA_TD08: descr = "8-bit signed deltas"; break; 1233 case V4L2_TCH_FMT_DELTA_TD08: descr = "8-bit signed deltas"; break;
1234 case V4L2_TCH_FMT_TU16: descr = "16-bit unsigned touch data"; break; 1234 case V4L2_TCH_FMT_TU16: descr = "16-bit unsigned touch data"; break;
1235 case V4L2_TCH_FMT_TU08: descr = "8-bit unsigned touch data"; break; 1235 case V4L2_TCH_FMT_TU08: descr = "8-bit unsigned touch data"; break;
1236 case V4L2_META_FMT_VSP1_HGO: descr = "R-Car VSP1 1-D Histogram"; break;
1236 1237
1237 default: 1238 default:
1238 /* Compressed formats */ 1239 /* Compressed formats */
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 7078deef2c64..09cf3a32faf4 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -676,6 +676,9 @@ struct v4l2_pix_format {
676#define V4L2_TCH_FMT_TU16 v4l2_fourcc('T', 'U', '1', '6') /* 16-bit unsigned touch data */ 676#define V4L2_TCH_FMT_TU16 v4l2_fourcc('T', 'U', '1', '6') /* 16-bit unsigned touch data */
677#define V4L2_TCH_FMT_TU08 v4l2_fourcc('T', 'U', '0', '8') /* 8-bit unsigned touch data */ 677#define V4L2_TCH_FMT_TU08 v4l2_fourcc('T', 'U', '0', '8') /* 8-bit unsigned touch data */
678 678
679/* Meta-data formats */
680#define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 Histogram */
681
679/* priv field value to indicates that subsequent fields are valid. */ 682/* priv field value to indicates that subsequent fields are valid. */
680#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe 683#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe
681 684