I have encountered a problem where the Fault Pixel Correction & Optical Black Clamp Averaging are not working on the DM6446. Kernel version is 2.6.18.
I am testing this with a simple application that reads the bayer image from the v4l2 device with the following code snippets.
#define FAULTPIXEL(y,x,type) (y<< (14+5) | x<< 5 | type) #define
NUM_FAULTPIXELS ((unsigned short)1) unsigned int
badpixels[NUM_FAULTPIXELS] = { FAULTPIXEL(1,47,1), }
ccdc_config_params_raw ccdc_params = { .fid_pol =
CCDC_PINPOL_NEGATIVE, .vd_pol = CCDC_PINPOL_POSITIVE, .hd_pol = CCDC_PINPOL_POSITIVE, .image_invert_enable = FALSE, .data_sz =
_10BITS, .alaw = { .b_alaw_enable = FALSE} , .blk_clamp = { .b_clamp_enable = FALSE, .dc_sub = 0} , .blk_comp = {0, 0, 0, 0} , .fault_pxl = { .fpc_enable = FALSE} , };
I then modify, the struct with:
ccdc_params.blk_clamp.b_clamp_enable = TRUE;
ccdc_params.blk_clamp.sample_pixel = _16PIXELS;
ccdc_params.blk_clamp.sample_ln = _16LINES;
ccdc_params.blk_clamp.start_pixel = 0; ccdc_params.blk_clamp.sgain = 0;
ccdc_params.fault_pxl.fpc_enable = TRUE; ccdc_params.fault_pxl.fp_num = NUM_FAULTPIXELS; ccdc_params.fault_pxl.fpc_table_addr = (unsigned int) badpixels;
Finally, I call this ioctl before streamon:
if (ioctl(fd, VPFE_CMD_CONFIG_CCDC_RAW,&ccdc_params) == -1) { break;
}
If I enable dev_dbg messages, I get the following output:
Validation pass
image_invert_enable = 0<7>vpfe vpfe.1:
data_sz = 6<7>vpfe vpfe.1:
ALaw Enable = 0<7>vpfe vpfe.1:
b_clamp_enable = 1<7>vpfe vpfe.1:
blk_clamp.sgain = 0<7>vpfe vpfe.1:
blk_clamp.start_pixel = 0<7>vpfe vpfe.1:
blk_clamp.sample_ln = 4<7>vpfe vpfe.1:
blk_clamp.sample_pixel = 4<7>vpfe vpfe.1:
blk_comp.r_comp = 0<7>vpfe vpfe.1:
blk_comp.gr_comp = 0<7>vpfe vpfe.1:
blk_comp.b_comp = 0<7>vpfe vpfe.1:
blk_comp.gb_comp = 0<7>vpfe vpfe.1:
fault_pxl.fpc_enable = 1<7>vpfe vpfe.1:
Starting ccdc_config_raw...<7>vpfe vpfe.1:
Starting ccdc_setwin...<7>vpfe vpfe.1:
End of ccdc_setwin...<7>vpfe vpfe.1:
Writing 0xc8000000 to CLAMP...
Writing 0x00000000 to DCSUB...
Writing 0x0 to BLKCMP...
below regw(val, BLKCMP)...<7>vpfe vpfe.1:
Writing 0x87367000 to FPC_ADDR...
Writing 0x1 to FPC...
Writing 0x8001 to FPC...
Writing 0xe000 to FMTCFG...
Writing 0xBB11BB11 to COLPTN...
Writing 0x34e to FMT_HORZ...
params->win.height 0x1e0 ...
Writing 0x1e0 to FMT_VERT...
below regw(val, FMT_VERT)...<7>vpfe vpfe.1:
Writing 0x0000 to SDOFST...
Writing 0x3be34e0 to VP_OUT...
Writing 0x30610 to SYN_MODE...
Reading 0x0 from SBL...
end of ccdc_config_raw...<7>vpfe vpfe.1:
Reading 0x0 to ALAW...
Reading 0xc8000000 to CLAMP...
Reading 0x0 to DCSUB...
Reading 0x0 to BLKCMP...
Reading 0x87367000 to FPC_ADDR...
Reading 0x8001 to FPC...
Reading 0x0 to FMTCFG...
Reading 0xbb11bb11 to COLPTN...
Reading 0x34e to FMT_HORZ...
Reading 0x1e0 to FMT_VERT...
Reading 0x6a0 to HSIZE_OFF...
Reading 0x0 to SDOFST...
Reading 0x3be34e0 to VP_OUT...
Reading 0x38610 to SYN_MODE...
Reading 0x34d to HORZ_INFO...
Reading 0x0 to VERT_START...
Reading 0x1df to VERT_LINES...
The frame from the CCD looks like this:
dark columns (36 pixels), active pixels (752 pixels), blanking (58 pixels)
From the looks of it, FPC_ADDR is 64-bit aligned which seems to be the only requirement.
The contents of the FPC register, 0x8001, shows that that fault pixel correction is enabled. I've also read back the FPC register just after grabbing a frame and the FPERR bit is not set. However, the hot pixel located at (47, 1) does not get corrected (where 0,0 would be the top left corner).
Also, there is no difference in the picture before/after Optical Black Clamp Averaging is enabled.
What am I missing?
Thanks,