aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/admin-guide/media/bcm2835-isp.rst
blob: e1c19f78435e6b14d051607b6a8b0d4f442f0314 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
.. SPDX-License-Identifier: GPL-2.0

BCM2835 ISP Driver
==================

Introduction
------------

The BCM2835 Image Sensor Pipeline (ISP) is a fixed function hardware pipeline
for performing image processing operations.  Images are fed to the input
of the ISP through memory frame buffers.  These images may be in various YUV,
RGB, or Bayer formats.  A typical use case would have Bayer images obtained from
an image sensor by the BCM2835 Unicam peripheral, written to a memory
frame buffer, and finally fed into the input of the ISP.  Two concurrent output
images may be generated in YUV or RGB format at different resolutions.
Statistics output is also generated for Bayer input images.

The bcm2835-isp driver exposes the following media pads as V4L2 device nodes:

.. tabularcolumns:: |l|l|l|l|

.. cssclass: longtable

.. flat-table::

    * - *Pad*
      - *Direction*
      - *Purpose*
      - *Formats*

    * - "bcm2835-isp0-output0"
      - sink
      - Accepts Bayer, RGB or YUV format frame buffers as input to the ISP HW
        pipeline.
      - :ref:`RAW8 <V4L2-PIX-FMT-SRGGB8>`,
        :ref:`RAW10P <V4L2-PIX-FMT-SRGGB10P>`,
        :ref:`RAW12P <V4L2-PIX-FMT-SRGGB12P>`,
        :ref:`RAW14P <V4L2-PIX-FMT-SRGGB14P>`,
        :ref:`RAW16 <V4L2-PIX-FMT-SRGGB16>`,
        :ref:`RGB24/BGR24 <V4L2-PIX-FMT-RGB24>`,
        :ref:`YUYV <V4L2-PIX-FMT-YUYV>`,
        :ref:`YVYU <V4L2-PIX-FMT-YVYU>`,
        :ref:`UYVY <V4L2-PIX-FMT-UYVY>`,
        :ref:`VYUY <V4L2-PIX-FMT-VYUY>`,
        :ref:`YUV420/YVU420 <V4L2-PIX-FMT-YUV420>`

    * - "bcm2835-isp0-capture1"
      - source
      - High resolution YUV or RGB processed output from the ISP.
      - :ref:`RGB565 <V4L2-PIX-FMT-RGB565>`,
        :ref:`RGB24/BGR24 <V4L2-PIX-FMT-RGB24>`,
        :ref:`ABGR32 <V4L2-PIX-FMT-ABGR32>`,
        :ref:`YUYV <V4L2-PIX-FMT-YUYV>`,
        :ref:`YVYU <V4L2-PIX-FMT-YVYU>`,
        :ref:`UYVY <V4L2-PIX-FMT-UYVY>`,
        :ref:`VYUY <V4L2-PIX-FMT-VYUY>`.
        :ref:`YUV420/YVU420 <V4L2-PIX-FMT-YUV420>`,
        :ref:`NV12/NV21 <V4L2-PIX-FMT-NV12>`,

    * - "bcm2835-isp0-capture2"
      - source
      - Low resolution YUV processed output from the ISP. The output of
        this pad cannot have a resolution larger than the "bcm2835-isp0-capture1" pad in any dimension.
      - :ref:`YUYV <V4L2-PIX-FMT-YUYV>`,
        :ref:`YVYU <V4L2-PIX-FMT-YVYU>`,
        :ref:`UYVY <V4L2-PIX-FMT-UYVY>`,
        :ref:`VYUY <V4L2-PIX-FMT-VYUY>`.
        :ref:`YUV420/YVU420 <V4L2-PIX-FMT-YUV420>`,
        :ref:`NV12/NV21 <V4L2-PIX-FMT-NV12>`,

    * - "bcm2835-isp0-capture1"
      - source
      - Image statistics calculated from the input image provided on the
        "bcm2835-isp0-output0" pad.  Statistics are only available for Bayer
        format input images.
      - :ref:`v4l2-meta-fmt-bcm2835-isp-stats`.

Pipeline Configuration
----------------------

The ISP pipeline can be configure through user-space by calling
:ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` on the “bcm2835-isp0-output0”
node with the appropriate parameters as shown in the table below.

.. tabularcolumns:: |p{2cm}|p{5.0cm}|

.. cssclass: longtable

.. flat-table::

    * - *id*
      - *Parameter*

    * - ``V4L2_CID_USER_BCM2835_ISP_CC_MATRIX``
      - struct :c:type:`bcm2835_isp_custom_ccm`

    * - ``V4L2_CID_USER_BCM2835_ISP_LENS_SHADING``
      - struct :c:type:`bcm2835_isp_lens_shading`

    * - ``V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL``
      - struct :c:type:`bcm2835_isp_black_level`

    * - ``V4L2_CID_USER_BCM2835_ISP_GEQ``
      - struct :c:type:`bcm2835_isp_geq`

    * - ``V4L2_CID_USER_BCM2835_ISP_GAMMA``
      - struct :c:type:`bcm2835_isp_gamma`

    * - ``V4L2_CID_USER_BCM2835_ISP_DENOISE``
      - struct :c:type:`bcm2835_isp_denoise`

    * - ``V4L2_CID_USER_BCM2835_ISP_SHARPEN``
      - struct :c:type:`bcm2835_isp_sharpen`

    * - ``V4L2_CID_USER_BCM2835_ISP_DPC``
      - struct :c:type:`bcm2835_isp_dpc`

++++++++++++++++++++++++
Configuration Parameters
++++++++++++++++++++++++

.. kernel-doc:: include/uapi/linux/bcm2835-isp.h
   :functions: bcm2835_isp_rational bcm2835_isp_ccm bcm2835_isp_custom_ccm
                bcm2835_isp_gain_format bcm2835_isp_lens_shading
                bcm2835_isp_black_level bcm2835_isp_geq bcm2835_isp_gamma
                bcm2835_isp_denoise bcm2835_isp_sharpen
                bcm2835_isp_dpc_mode bcm2835_isp_dpc