xref: /linux/Documentation/admin-guide/media/raspberrypi-rp1-cfe.rst (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1.. SPDX-License-Identifier: GPL-2.0
2
3============================================
4Raspberry Pi PiSP Camera Front End (rp1-cfe)
5============================================
6
7The PiSP Camera Front End
8=========================
9
10The PiSP Camera Front End (CFE) is a module which combines a CSI-2 receiver with
11a simple ISP, called the Front End (FE).
12
13The CFE has four DMA engines and can write frames from four separate streams
14received from the CSI-2 to the memory. One of those streams can also be routed
15directly to the FE, which can do minimal image processing, write two versions
16(e.g. non-scaled and downscaled versions) of the received frames to memory and
17provide statistics of the received frames.
18
19The FE registers are documented in the `Raspberry Pi Image Signal Processor
20(ISP) Specification document
21<https://datasheets.raspberrypi.com/camera/raspberry-pi-image-signal-processor-specification.pdf>`_,
22and example code for FE can be found in `libpisp
23<https://github.com/raspberrypi/libpisp>`_.
24
25The rp1-cfe driver
26==================
27
28The Raspberry Pi PiSP Camera Front End (rp1-cfe) driver is located under
29drivers/media/platform/raspberrypi/rp1-cfe. It uses the `V4L2 API` to register
30a number of video capture and output devices, the `V4L2 subdev API` to register
31subdevices for the CSI-2 received and the FE that connects the video devices in
32a single media graph realized using the `Media Controller (MC) API`.
33
34The media topology registered by the `rp1-cfe` driver, in this particular
35example connected to an imx219 sensor, is the following one:
36
37.. _rp1-cfe-topology:
38
39.. kernel-figure:: raspberrypi-rp1-cfe.dot
40    :alt:   Diagram of an example media pipeline topology
41    :align: center
42
43The media graph contains the following video device nodes:
44
45- rp1-cfe-csi2-ch0: capture device for the first CSI-2 stream
46- rp1-cfe-csi2-ch1: capture device for the second CSI-2 stream
47- rp1-cfe-csi2-ch2: capture device for the third CSI-2 stream
48- rp1-cfe-csi2-ch3: capture device for the fourth CSI-2 stream
49- rp1-cfe-fe-image0: capture device for the first FE output
50- rp1-cfe-fe-image1: capture device for the second FE output
51- rp1-cfe-fe-stats: capture device for the FE statistics
52- rp1-cfe-fe-config: output device for FE configuration
53
54rp1-cfe-csi2-chX
55----------------
56
57The rp1-cfe-csi2-chX capture devices are normal V4L2 capture devices which
58can be used to capture video frames or metadata received from the CSI-2.
59
60rp1-cfe-fe-image0, rp1-cfe-fe-image1
61------------------------------------
62
63The rp1-cfe-fe-image0 and rp1-cfe-fe-image1 capture devices are used to write
64the processed frames to memory.
65
66rp1-cfe-fe-stats
67----------------
68
69The format of the FE statistics buffer is defined by
70:c:type:`pisp_statistics` C structure and the meaning of each parameter is
71described in the `PiSP specification` document.
72
73rp1-cfe-fe-config
74-----------------
75
76The format of the FE configuration buffer is defined by
77:c:type:`pisp_fe_config` C structure and the meaning of each parameter is
78described in the `PiSP specification` document.
79