v4l2-isp.rst 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. .. SPDX-License-Identifier: GPL-2.0
  2. V4L2 generic ISP parameters and statistics support
  3. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4. Design rationale
  5. ================
  6. ISP configuration parameters and statistics are processed and collected by
  7. drivers and exchanged with userspace through data types that usually
  8. reflect the ISP peripheral registers layout.
  9. Each ISP driver defines its own metadata output format for parameters and
  10. a metadata capture format for statistics. The buffer layout is realized by a
  11. set of C structures that reflects the registers layout. The number and types
  12. of C structures is fixed by the format definition and becomes part of the Linux
  13. kernel uAPI/uABI interface.
  14. Because of the hard requirement of backward compatibility when extending the
  15. user API/ABI interface, modifying an ISP driver capture or output metadata
  16. format after it has been accepted by mainline is very hard if not impossible.
  17. It generally happens, in fact, that after the first accepted revision of an ISP
  18. driver the buffers layout need to be modified, either to support new hardware
  19. blocks, to fix bugs or to support different revisions of the hardware.
  20. Each of these situations would require defining a new metadata format, making it
  21. really hard to maintain and extend drivers and requiring userspace to use
  22. the correct format depending on the kernel revision in use.
  23. V4L2 ISP configuration parameters
  24. =================================
  25. For these reasons, Video4Linux2 defines generic types for ISP configuration
  26. parameters and statistics. Drivers are still expected to define their own
  27. formats for their metadata output and capture nodes, but the buffers layout can
  28. be defined using the extensible and versioned types defined by
  29. include/uapi/linux/media/v4l2-isp.h.
  30. Drivers are expected to provide the definitions of their supported ISP blocks
  31. and the expected maximum size of a buffer.
  32. For driver developers a set of helper functions to assist them with validation
  33. of the buffer received from userspace is available in
  34. drivers/media/v4l2-core/v4l2-isp.c
  35. V4L2 ISP support driver documentation
  36. =====================================
  37. .. kernel-doc:: include/media/v4l2-isp.h