IMX577 DOL HDR Device Tree

Hello everyone.

I have an IMX577 camera. While I was booting the kernel-dtb files, I am using IMX477 device tree binary file, and it works. I want to edit this device tree for getting DOL HDR image.

Actual device tree:

mode1 {
mclk_khz = “24000”;
num_lanes = [34 00];
tegra_sinterface = “serial_a”;
discontinuous_clk = “no”;
dpcm_enable = “false”;
cil_settletime = [30 00];
dynamic_pixel_bit_depth = “10”;
csi_pixel_bit_depth = “10”;
mode_type = “bayer”;
pixel_phase = “rggb”;
active_w = “3840”;
active_h = “2160”;
pixel_t = “bayer_rggb”;
readout_orientation = “90”;
line_length = “6308”;
inherent_gain = [31 00];
mclk_multiplier = “200”;
pix_clk_hz = “840000000”;
min_gain_val = “1.0”;
max_gain_val = “354”;
min_hdr_ratio = [31 00];
max_hdr_ratio = “64”;
min_framerate = “1.462526”;
max_framerate = “60”;
min_exp_time = “16.165”;
max_exp_time = “165770”;
embedded_metadata_height = [32 00];
};

Edited device tree:

mode1 {
mclk_khz = “24000”;
num_lanes = “4”;
tegra_sinterface = “serial_a”;
phy_mode = “DPHY”;
discontinuous_clk = “yes”;
dpcm_enable = “false”;
cil_settletime = “0”;
dynamic_pixel_bit_depth = “16”;
csi_pixel_bit_depth = “12”;
mode_type = “bayer_wdr_pwl”;
pixel_phase = “rggb”;
active_w = “3856”;
active_h = “4436”;
readout_orientation = “0”;
line_length = “5500”;
inherent_gain = “1”;
pix_clk_hz = “742240215”;
gain_factor = “10”;
min_gain_val = “0”; /* 0dB /
max_gain_val = “720”; /
72dB /
step_gain_val = “3”; /
0.3 /
default_gain = “0”;
min_hdr_ratio = “32”;
max_hdr_ratio = “32”;
framerate_factor = “1000000”;
min_framerate = “3000000”; /
3.0 /
max_framerate = “30000000”; /
30 /
step_framerate = “1”;
default_framerate = “30000000”;
exposure_factor = “1000000”;
min_exp_time = “641”; /
us /
max_exp_time = “32429”; /
us /
step_exp_time = “1”;
default_exp_time = “16512”;/
us /
embedded_metadata_height = “1”;
/
PWL /
num_control_point = “4”;
control_point_x_0 = “0”;
control_point_x_1 = “2048”;
control_point_x_2 = “16384”;
control_point_x_3 = “65536”;
control_point_y_0 = “0”;
control_point_y_1 = “2048”;
control_point_y_2 = “2944”;
control_point_y_3 = “3712”;
/
DOL params */
num_of_exposure = “2”;
num_of_ignored_lines = “14”;
num_of_lines_offset_0 = “50”;
num_of_ignored_pixels = “4”;
num_of_left_margin_pixels = “12”;
num_of_right_margin_pixels = “0”;
};

When I use the edited device tree, I get only a black screen. Can you help me to update correctly?

P.S: Please don’t forward me to Sensor Driver Programming Guide, because I already looked at while I was preparing this device tree. I only want a working device tree configuration.

Thanks.

Your configure looks like PWL HDR instead of DOL WDR.
Have a reference to IMX274 for DOL WDR.

For WDR you still need create camera_overrides.isp file at /var/nvidia/nvcam/settings and change mode to 664
And add below to the overrides file.
wdr.DOL.v4.EnableDOL = TRUE;
ae.wdr.DreMin = FER;
ae.wdr.DreMax = FER;

Check the FER from below

Also the exposure ratio needs to be fixed value, preferably a power of 2.
This fixed exposure ratio needs to obeys the following constraints:
a. Short exposure time lower limit * fixed exposure ratio >= Long exposure time lower limit.
b. Short exposure time upper limit * fixed exposure ratio <= Long exposure time upper limit.

The limits for short exposure time and long exposure time can be derived from the data sheet.
The above constraints will ensure that that long and short exposure times output by our auto exposure always maintain a fixed exposure ratio.

Once such a Fixed Exposure Ratio (let’s call it FER) value has been derived, the following changes should be made:

  1. Add these knobs to the config overrides:
    ae.wdr.DreMin = FER;
    ae.wdr.DreMax = FER;

  2. Setup DT properties for DOL sensor mode:
    min_exp_time = FER * short exposure time lower limit;
    max_exp_time = FER * short exposure time upper limit;

As mentioned in last reply and this post, there is a sensor driver documentation for specifically IMX577. I googled it and found nothing. Where can I have this documentation?

I applied changes but I think values of parameters doesn’t fit for IMX577.

You need consult with Sony to get the sensor mode REGs configure and those DOL HDR information.