| 1 |
Some notes about the working of the atomisp drivers (learned while working |
| 2 |
on cleaning it up). |
| 3 |
|
| 4 |
The atomisp seems to be a generic DSP(ISP) like processor without a fixed |
| 5 |
pipeline. It does not have its own memory, but instead uses main memory. |
| 6 |
The ISP has its own address-space and main memory needs to be mapped into |
| 7 |
its address space through the ISP's MMU. |
| 8 |
|
| 9 |
Memory is allocated by the hmm code. hmm_alloc() returns an ISP virtual |
| 10 |
address. The hmm code keeps a list of all allocations and when necessary |
| 11 |
the hmm code finds the backing hmm-buffer-object (hmm_bo) by looking |
| 12 |
up the hmm_bo based on the ISP virtual address. |
| 13 |
|
| 14 |
The actual processing pipeline is made by loading one or more programs, |
| 15 |
called binaries. The shisp_240??0_v21.bin firmware file contains many |
| 16 |
different binaries. Binaries are picked by filling a ia_css_binary_descr |
| 17 |
struct with various input and output parameters and then calling |
| 18 |
ia_css_binary_find(). Some binaries support creating multiple outputs |
| 19 |
(preview + video frame?) at the same time. |
| 20 |
|
| 21 |
For example for the /dev/video0 preview node load_preview_binaries() |
| 22 |
from atomisp/pci/sh_css.c is called and then loads a preview and |
| 23 |
optionally a scalar binary. Note when digital zoom is disabled |
| 24 |
(it is enabled by default) only the preview binary is loaded. |
| 25 |
So in this case a single binary handles the entire pipeline. |
| 26 |
|
| 27 |
Since getting a picture requires multiple processing steps, |
| 28 |
this means that unlike in fixed pipelines the soft pipelines |
| 29 |
on the ISP can do multiple processing steps in a single pipeline |
| 30 |
element (in a single binary). |
| 31 |
|
| 32 |
### |
| 33 |
|
| 34 |
The sensor drivers use of v4l2_get_subdev_hostdata(), which returns |
| 35 |
a camera_mipi_info struct. This struct is allocated/managed by |
| 36 |
the core atomisp code. The most important parts of the struct |
| 37 |
are filled by the atomisp core itself, like e.g. the port number. |
| 38 |
|
| 39 |
Other members of camera_mipi_info which are set by some drivers are: |
| 40 |
-metadata_width, metadata_height, metadata_effective_width, set by |
| 41 |
the ov5693 driver (and used by the atomisp core) |
| 42 |
-raw_bayer_order, adjusted by the ov2680 driver when flipping since |
| 43 |
flipping can change the bayer order |