raspberrypi-rp1-cfe.rst 3.0 KB

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