1 From 23afbeb993acfd94fa21341f01819ab6505444d2 Mon Sep 17 00:00:00 2001
2 From: Naushir Patuck <naush@raspberrypi.com>
3 Date: Tue, 21 Apr 2020 15:06:19 +0100
4 Subject: [PATCH] media: uapi: v4l-ctrls: Add CID base for the
7 We are reserving controls for the new bcm2835-isp driver.
9 Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
11 .../media/v4l-drivers/bcm2835-isp.rst | 127 ++++++++++++++++++
12 Documentation/media/v4l-drivers/index.rst | 1 +
13 include/uapi/linux/v4l2-controls.h | 4 +
14 3 files changed, 132 insertions(+)
15 create mode 100644 Documentation/media/v4l-drivers/bcm2835-isp.rst
18 +++ b/Documentation/media/v4l-drivers/bcm2835-isp.rst
20 +.. SPDX-License-Identifier: GPL-2.0
28 +The BCM2835 Image Sensor Pipeline (ISP) is a fixed function hardware pipeline
29 +for performing image processing operations. Images are fed to the input
30 +of the ISP through memory frame buffers. These images may be in various YUV,
31 +RGB, or Bayer formats. A typical use case would have Bayer images obtained from
32 +an image sensor by the BCM2835 Unicam peripheral, written to a memory
33 +frame buffer, and finally fed into the input of the ISP. Two concurrent output
34 +images may be generated in YUV or RGB format at different resolutions.
35 +Statistics output is also generated for Bayer input images.
37 +The bcm2835-isp driver exposes the following media pads as V4L2 device nodes:
39 +.. tabularcolumns:: |l|l|l|l|
41 +.. cssclass: longtable
50 + * - "bcm2835-isp0-output0"
52 + - Accepts Bayer, RGB or YUV format frame buffers as input to the ISP HW
54 + - :ref:`RAW8 <V4L2-PIX-FMT-SRGGB8>`,
55 + :ref:`RAW10P <V4L2-PIX-FMT-SRGGB10P>`,
56 + :ref:`RAW12P <V4L2-PIX-FMT-SRGGB12P>`,
57 + :ref:`RAW14P <V4L2-PIX-FMT-SRGGB14P>`,
58 + :ref:`RAW16 <V4L2-PIX-FMT-SRGGB16>`,
59 + :ref:`RGB24/BGR24 <V4L2-PIX-FMT-RGB24>`,
60 + :ref:`YUYV <V4L2-PIX-FMT-YUYV>`,
61 + :ref:`YVYU <V4L2-PIX-FMT-YVYU>`,
62 + :ref:`UYVY <V4L2-PIX-FMT-UYVY>`,
63 + :ref:`VYUY <V4L2-PIX-FMT-VYUY>`,
64 + :ref:`YUV420/YVU420 <V4L2-PIX-FMT-YUV420>`
66 + * - "bcm2835-isp0-capture1"
68 + - High resolution YUV or RGB processed output from the ISP.
69 + - :ref:`RGB565 <V4L2-PIX-FMT-RGB565>`,
70 + :ref:`RGB24/BGR24 <V4L2-PIX-FMT-RGB24>`,
71 + :ref:`ABGR32 <V4L2-PIX-FMT-ABGR32>`,
72 + :ref:`YUYV <V4L2-PIX-FMT-YUYV>`,
73 + :ref:`YVYU <V4L2-PIX-FMT-YVYU>`,
74 + :ref:`UYVY <V4L2-PIX-FMT-UYVY>`,
75 + :ref:`VYUY <V4L2-PIX-FMT-VYUY>`.
76 + :ref:`YUV420/YVU420 <V4L2-PIX-FMT-YUV420>`,
77 + :ref:`NV12/NV21 <V4L2-PIX-FMT-NV12>`,
79 + * - "bcm2835-isp0-capture2"
81 + - Low resolution YUV processed output from the ISP. The output of
82 + this pad cannot have a resolution larger than the "bcm2835-isp0-capture1" pad in any dimension.
83 + - :ref:`YUYV <V4L2-PIX-FMT-YUYV>`,
84 + :ref:`YVYU <V4L2-PIX-FMT-YVYU>`,
85 + :ref:`UYVY <V4L2-PIX-FMT-UYVY>`,
86 + :ref:`VYUY <V4L2-PIX-FMT-VYUY>`.
87 + :ref:`YUV420/YVU420 <V4L2-PIX-FMT-YUV420>`,
88 + :ref:`NV12/NV21 <V4L2-PIX-FMT-NV12>`,
90 + * - "bcm2835-isp0-capture1"
92 + - Image statistics calculated from the input image provided on the
93 + "bcm2835-isp0-output0" pad. Statistics are only available for Bayer
94 + format input images.
95 + - :ref:`v4l2-meta-fmt-bcm2835-isp-stats`.
97 +Pipeline Configuration
98 +----------------------
100 +The ISP pipeline can be configure through user-space by calling
101 +:ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` on the “bcm2835-isp0-output0”
102 +node with the appropriate parameters as shown in the table below.
104 +.. tabularcolumns:: |p{2cm}|p{5.0cm}|
106 +.. cssclass: longtable
113 + * - ``V4L2_CID_USER_BCM2835_ISP_CC_MATRIX``
114 + - struct :c:type:`bcm2835_isp_custom_ccm`
116 + * - ``V4L2_CID_USER_BCM2835_ISP_LENS_SHADING``
117 + - struct :c:type:`bcm2835_isp_lens_shading`
119 + * - ``V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL``
120 + - struct :c:type:`bcm2835_isp_black_level`
122 + * - ``V4L2_CID_USER_BCM2835_ISP_GEQ``
123 + - struct :c:type:`bcm2835_isp_geq`
125 + * - ``V4L2_CID_USER_BCM2835_ISP_GAMMA``
126 + - struct :c:type:`bcm2835_isp_gamma`
128 + * - ``V4L2_CID_USER_BCM2835_ISP_DENOISE``
129 + - struct :c:type:`bcm2835_isp_denoise`
131 + * - ``V4L2_CID_USER_BCM2835_ISP_SHARPEN``
132 + - struct :c:type:`bcm2835_isp_sharpen`
134 + * - ``V4L2_CID_USER_BCM2835_ISP_DPC``
135 + - struct :c:type:`bcm2835_isp_dpc`
137 +++++++++++++++++++++++++
138 +Configuration Parameters
139 +++++++++++++++++++++++++
141 +.. kernel-doc:: include/uapi/linux/bcm2835-isp.h
142 + :functions: bcm2835_isp_rational bcm2835_isp_ccm bcm2835_isp_custom_ccm
143 + bcm2835_isp_gain_format bcm2835_isp_lens_shading
144 + bcm2835_isp_black_level bcm2835_isp_geq bcm2835_isp_gamma
145 + bcm2835_isp_denoise bcm2835_isp_sharpen
146 + bcm2835_isp_dpc_mode bcm2835_isp_dpc
147 --- a/Documentation/media/v4l-drivers/index.rst
148 +++ b/Documentation/media/v4l-drivers/index.rst
149 @@ -35,6 +35,7 @@ For more details see the file COPYING in
157 --- a/include/uapi/linux/v4l2-controls.h
158 +++ b/include/uapi/linux/v4l2-controls.h
159 @@ -192,6 +192,10 @@ enum v4l2_colorfx {
160 * We reserve 16 controls for this driver. */
161 #define V4L2_CID_USER_IMX_BASE (V4L2_CID_USER_BASE + 0x10b0)
163 +/* The base for the bcm2835-isp driver controls.
164 + * We reserve 16 controls for this driver. */
165 +#define V4L2_CID_USER_BCM2835_ISP_BASE (V4L2_CID_USER_BASE + 0x10c0)
167 /* MPEG-class control IDs */
168 /* The MPEG controls are applicable to all codec controls
169 * and the 'MPEG' part of the define is historical */