c3-isp.rst 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. .. SPDX-License-Identifier: (GPL-2.0-only OR MIT)
  2. .. include:: <isonum.txt>
  3. =================================================
  4. Amlogic C3 Image Signal Processing (C3ISP) driver
  5. =================================================
  6. Introduction
  7. ============
  8. This file documents the Amlogic C3ISP driver located under
  9. drivers/media/platform/amlogic/c3/isp.
  10. The current version of the driver supports the C3ISP found on
  11. Amlogic C308L processor.
  12. The driver implements V4L2, Media controller and V4L2 subdev interfaces.
  13. Camera sensor using V4L2 subdev interface in the kernel is supported.
  14. The driver has been tested on AW419-C308L-Socket platform.
  15. Amlogic C3 ISP
  16. ==============
  17. The Camera hardware found on C308L processors and supported by
  18. the driver consists of:
  19. - 1 MIPI-CSI-2 module: handles the physical layer of the MIPI CSI-2 receiver and
  20. receives data from the connected camera sensor.
  21. - 1 MIPI-ADAPTER module: organizes MIPI data to meet ISP input requirements and
  22. send MIPI data to ISP.
  23. - 1 ISP (Image Signal Processing) module: contains a pipeline of image processing
  24. hardware blocks. The ISP pipeline contains three resizers at the end each of
  25. them connected to a DMA interface which writes the output data to memory.
  26. A high-level functional view of the C3 ISP is presented below.::
  27. +----------+ +-------+
  28. | Resizer |--->| WRMIF |
  29. +---------+ +------------+ +--------------+ +-------+ |----------+ +-------+
  30. | Sensor |--->| MIPI CSI-2 |--->| MIPI ADAPTER |--->| ISP |---|----------+ +-------+
  31. +---------+ +------------+ +--------------+ +-------+ | Resizer |--->| WRMIF |
  32. +----------+ +-------+
  33. |----------+ +-------+
  34. | Resizer |--->| WRMIF |
  35. +----------+ +-------+
  36. Driver architecture and design
  37. ==============================
  38. With the goal to model the hardware links between the modules and to expose a
  39. clean, logical and usable interface, the driver registers the following V4L2
  40. sub-devices:
  41. - 1 `c3-mipi-csi2` sub-device - the MIPI CSI-2 receiver
  42. - 1 `c3-mipi-adapter` sub-device - the MIPI adapter
  43. - 1 `c3-isp-core` sub-device - the ISP core
  44. - 3 `c3-isp-resizer` sub-devices - the ISP resizers
  45. The `c3-isp-core` sub-device is linked to 2 video device nodes for statistics
  46. capture and parameters programming:
  47. - the `c3-isp-stats` capture video device node for statistics capture
  48. - the `c3-isp-params` output video device for parameters programming
  49. Each `c3-isp-resizer` sub-device is linked to a capture video device node where
  50. frames are captured from:
  51. - `c3-isp-resizer0` is linked to the `c3-isp-cap0` capture video device
  52. - `c3-isp-resizer1` is linked to the `c3-isp-cap1` capture video device
  53. - `c3-isp-resizer2` is linked to the `c3-isp-cap2` capture video device
  54. The media controller pipeline graph is as follows (with connected a
  55. IMX290 camera sensor):
  56. .. _isp_topology_graph:
  57. .. kernel-figure:: c3-isp.dot
  58. :alt: c3-isp.dot
  59. :align: center
  60. Media pipeline topology
  61. Implementation
  62. ==============
  63. Runtime configuration of the ISP hardware is performed on the `c3-isp-params`
  64. video device node using the :ref:`V4L2_META_FMT_C3ISP_PARAMS
  65. <v4l2-meta-fmt-c3isp-params>` as data format. The buffer structure is defined by
  66. :c:type:`c3_isp_params_cfg`.
  67. Statistics are captured from the `c3-isp-stats` video device node using the
  68. :ref:`V4L2_META_FMT_C3ISP_STATS <v4l2-meta-fmt-c3isp-stats>` data format.
  69. The final picture size and format is configured using the V4L2 video
  70. capture interface on the `c3-isp-cap[0, 2]` video device nodes.
  71. The Amlogic C3 ISP is supported by `libcamera <https://libcamera.org>`_ with a
  72. dedicated pipeline handler and algorithms that perform run-time image correction
  73. and enhancement.