Hi,
we want to enable DOL HDR modes for IMX585 based sensor. However, we are facing an issue with misaligned DOL output frames:
Output fused frame:
It seems like the SEF frame is misaligned compared to LEF frame.
I have already posted some results here: How to calculate device-tree parameters for WDR DOL-2 frame [IMX585]
However, we hit the dead-end and we think, the problem is still in the device-tree parameter calculations.
We calculate device-tree parameters with the following datasheet parameters + formulas:
IMAGE DRAWING
HORIZONTAL DIRECTION
W1 = 8
W2 = 3840
W3 = 8
LI = 8 (see image drawing, yellow rectangle)
VERTICAL DIRECTION
H0* = (RHS1-2)/2 = (278-2)/2 = 138
H1 = 1
H2 = 1
H3 = 10
H4 = 10
H5 = 4
H6 = 8
H7 = 2160
H8 = 8
H9 = 1
H10*= (RHS1-2)/2 = (278-2)/2 = 138
*RHS1 register is set to 0x116 = 278 (for all-pixels mode).
FORMULAS
active_w = W2 + LI + W1 + W3 = 3840 + 8 + 8 + 8 = 3864
active_h = (H7 + H3 + H4 + H5 + H0)*2 =
(2160 + 10 +10 + 4 + 138) * 2 = 4644 ???
num_of_exposure = 2 (always 2 for DOL-2 frame)
num_of_ignored_lines = H3 + H4 + H5 =
10 + 10 + 4 = 24 ???
num_of_lines_offset_0 = H0 = 138
num_of_ignored_pixels = LI = 8
num_of_left_margin_pixels = W1 = 8
num_of_right_margin_pixels = W3 = 8
HEIGHT = (active_h / 2) - num_of_ignored_lines - num_of_lines_offset_0 = 4644/2-24-138=2160
UNCERTAINTIES
- We are not sure for active_h if we shall include H3 (Ignored OB_1)?
Can you write down formula for active_h with the above frame diagram and information?
- We are not sure for num_of_ignored_lines if we shall include H6 (Effective margin for color processing)?
Can you write down formula for num_of_ignored_lines with the above information?
- Do you perhaps see any errors in calculation of other parameters? For now, we only think issues might be in the active_h and num_of_ignored_lines parameters.
NOTE: Please use symbols provided (H1, H2, H3…) for parameters when formulating formulas. Thanks.
Here is image drawing of reference IMX274 sensor implementation:
It can be observed that drawing for IMX585 contains a lot more field that need to somehow be accounted for.
Additionally, would it be possible to provide IMX274 datasheet? That way it would be easier to cross-check what settings are missing or need to be modified?