Commit 95cd86ff authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

fixed fps 2 (now after a bit of testing)

parent c5dd2cf3
...@@ -981,12 +981,20 @@ int mt9f002_pgm_window_common (int sensor_port, ///< sensor port ...@@ -981,12 +981,20 @@ int mt9f002_pgm_window_common (int sensor_port, ///< sensor port
// this sets the vertical blanking // this sets the vertical blanking
if (fll!=thispars->pars[P_SENSOR_REGS+P_MT9F002_FRAME_LENGTH_LINES]){ if (fll!=thispars->pars[P_SENSOR_REGS+P_MT9F002_FRAME_LENGTH_LINES]){
dev_dbg(g_dev_ptr,"limit fps, old frame_length_lines=0x%08x, new frame_length_lines=0x%08x\n", dev_dbg(g_dev_ptr,"limit fps, old frame_length_lines=0x%08x, new frame_length_lines=0x%08x\n",
thispars->pars[P_SENSOR_REGS+P_MT9F002_FRAME_LENGTH_LINES], fll); (int) thispars->pars[P_SENSOR_REGS+P_MT9F002_FRAME_LENGTH_LINES], fll);
SET_SENSOR_MBPAR_LUT(sensor_port, frame16, P_MT9F002_FRAME_LENGTH_LINES, fll); SET_SENSOR_MBPAR_LUT(sensor_port, frame16, P_MT9F002_FRAME_LENGTH_LINES, fll);
} }
// need this fix for max possible fps
if (ww >= X_OUTPUT_BORDER_SIZE){
min_line_length_pck = MIN_LINE_LENGTH_PCK_FROM_DATASHEET;
}
// else, leave as thispars->pars[P_SENSOR_REGS+P_MT9F002_MIN_LINE_LENGTH_PCK]
// which is 0x930
// recalc exposure after this one // recalc exposure after this one
//llp = mt9f002_calc_line_length_pck(thispars); //llp = mt9f002_calc_line_length_pck(thispars);
llp = mt9f002_calc_line_length_pck_2(wws,wwe,ww_odd_inc,ww,min_line_blanking_pck,min_line_length_pck); llp = mt9f002_calc_line_length_pck_2(wws,wwe,ww_odd_inc,ww,min_line_blanking_pck,min_line_length_pck);
if (llp != thispars->pars[P_SENSOR_REGS+P_MT9F002_LINE_LENGTH_PCK]){ if (llp != thispars->pars[P_SENSOR_REGS+P_MT9F002_LINE_LENGTH_PCK]){
SET_SENSOR_MBPAR_LUT(sensor_port, frame16, P_MT9F002_LINE_LENGTH_PCK, llp); SET_SENSOR_MBPAR_LUT(sensor_port, frame16, P_MT9F002_LINE_LENGTH_PCK, llp);
...@@ -1173,6 +1181,12 @@ int mt9f002_pgm_limitfps (int sensor_port, ///< sensor port numb ...@@ -1173,6 +1181,12 @@ int mt9f002_pgm_limitfps (int sensor_port, ///< sensor port numb
//hor_blank = hor_blank_min; //hor_blank = hor_blank_min;
//dev_dbg(g_dev_ptr,"{%d} hor_blank =%d(0x%x)\n",sensor_port,hor_blank,hor_blank); //dev_dbg(g_dev_ptr,"{%d} hor_blank =%d(0x%x)\n",sensor_port,hor_blank,hor_blank);
row_time_in_pixels = 2*thispars->pars[P_SENSOR_REGS+P_MT9F002_LINE_LENGTH_PCK]; row_time_in_pixels = 2*thispars->pars[P_SENSOR_REGS+P_MT9F002_LINE_LENGTH_PCK];
// fps correction
if (ww < X_OUTPUT_BORDER_SIZE){
row_time_in_pixels = thispars->pars[P_SENSOR_REGS+P_MT9F002_LINE_LENGTH_PCK];
}
//row_time_in_pixels = mt9f002_calc_line_length_pck(thispars); //row_time_in_pixels = mt9f002_calc_line_length_pck(thispars);
......
...@@ -27,6 +27,14 @@ ...@@ -27,6 +27,14 @@
// number of lines to sacrifice before generating Frame Valid // number of lines to sacrifice before generating Frame Valid
#define MT9F002_VACT_DELAY 2 #define MT9F002_VACT_DELAY 2
// !!! Unpredicted operation:
// * Value from the datasheet works while image width is above border
// suspecting sensor's ADCs performance
// * if width < BORDER_WIDTH row_time_in_pixels become 1:1
// else row_time_in_pixels 1:2
#define MIN_LINE_LENGTH_PCK_FROM_DATASHEET 0x4c8
#define X_OUTPUT_BORDER_SIZE 912
// Clocks, this is basis // Clocks, this is basis
// from x393_parameters.vh: // from x393_parameters.vh:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment