xref: /linux/Documentation/driver-api/media/v4l2-isp.rst (revision 84318277d6334c6981ab326d4acc87c6a6ddc9b8)
1*76799be6SJacopo Mondi.. SPDX-License-Identifier: GPL-2.0
2*76799be6SJacopo Mondi
3*76799be6SJacopo MondiV4L2 generic ISP parameters and statistics support
4*76799be6SJacopo Mondi^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5*76799be6SJacopo Mondi
6*76799be6SJacopo MondiDesign rationale
7*76799be6SJacopo Mondi================
8*76799be6SJacopo Mondi
9*76799be6SJacopo MondiISP configuration parameters and statistics are processed and collected by
10*76799be6SJacopo Mondidrivers and exchanged with userspace through data types that usually
11*76799be6SJacopo Mondireflect the ISP peripheral registers layout.
12*76799be6SJacopo Mondi
13*76799be6SJacopo MondiEach ISP driver defines its own metadata output format for parameters and
14*76799be6SJacopo Mondia metadata capture format for statistics. The buffer layout is realized by a
15*76799be6SJacopo Mondiset of C structures that reflects the registers layout. The number and types
16*76799be6SJacopo Mondiof C structures is fixed by the format definition and becomes part of the Linux
17*76799be6SJacopo Mondikernel uAPI/uABI interface.
18*76799be6SJacopo Mondi
19*76799be6SJacopo MondiBecause of the hard requirement of backward compatibility when extending the
20*76799be6SJacopo Mondiuser API/ABI interface, modifying an ISP driver capture or output metadata
21*76799be6SJacopo Mondiformat after it has been accepted by mainline is very hard if not impossible.
22*76799be6SJacopo Mondi
23*76799be6SJacopo MondiIt generally happens, in fact, that after the first accepted revision of an ISP
24*76799be6SJacopo Mondidriver the buffers layout need to be modified, either to support new hardware
25*76799be6SJacopo Mondiblocks, to fix bugs or to support different revisions of the hardware.
26*76799be6SJacopo Mondi
27*76799be6SJacopo MondiEach of these situations would require defining a new metadata format, making it
28*76799be6SJacopo Mondireally hard to maintain and extend drivers and requiring userspace to use
29*76799be6SJacopo Mondithe correct format depending on the kernel revision in use.
30*76799be6SJacopo Mondi
31*76799be6SJacopo MondiV4L2 ISP configuration parameters
32*76799be6SJacopo Mondi=================================
33*76799be6SJacopo Mondi
34*76799be6SJacopo MondiFor these reasons, Video4Linux2 defines generic types for ISP configuration
35*76799be6SJacopo Mondiparameters and statistics. Drivers are still expected to define their own
36*76799be6SJacopo Mondiformats for their metadata output and capture nodes, but the buffers layout can
37*76799be6SJacopo Mondibe defined using the extensible and versioned types defined by
38*76799be6SJacopo Mondiinclude/uapi/linux/media/v4l2-isp.h.
39*76799be6SJacopo Mondi
40*76799be6SJacopo MondiDrivers are expected to provide the definitions of their supported ISP blocks
41*76799be6SJacopo Mondiand the expected maximum size of a buffer.
42*76799be6SJacopo Mondi
43*76799be6SJacopo MondiFor driver developers a set of helper functions to assist them with validation
44*76799be6SJacopo Mondiof the buffer received from userspace is available in
45*76799be6SJacopo Mondidrivers/media/v4l2-core/v4l2-isp.c
46*76799be6SJacopo Mondi
47*76799be6SJacopo MondiV4L2 ISP support driver documentation
48*76799be6SJacopo Mondi=====================================
49*76799be6SJacopo Mondi.. kernel-doc:: include/media/v4l2-isp.h
50