Hi all,
Environment :
Board : Jetson AGX Xavier
JetPack : 4.3
We’ve developed a driver for our MIPI-CSI GMSL2 custom camera using an AR0820 as an image sensor, this latter has a resolution of 8 Mpx (3848x2168), we’re able to capture properly with this resolution, i’ve tried to implement the sensor mode to be able to capture in 1920x1080 as it was suggested in my previous post, but i realize that it does a cropping despite of resizing the captured 8 Mpx (3848x2168), there is the step i’ve done to implement the new sensor mode
- I’ve set the wanted resolution in registers
{0x3002, 0x0000}, /* Y_ADDR_START_ /
{0x3004, 0x0000}, / X_ADDR_START_ /
{0x3006, 0x0437}, / Y_ADDR_END_ /
{0x3008, 0x077F}, / X_ADDR_END_ */
static ar0820_reg ar0820_1920X1080_30fps[] = {
{0x301A, 0x005d}, /* RESET_REGISTER */
{0x301A, 0x0058}, /* RESET_REGISTER */
{AR0820_TABLE_WAIT_MS, 200}, /* RESET_REGISTER */
{0x301A, 0x0058}, /* RESET_REGISTER */
{0x301A, 0x0058}, /* RESET_REGISTER */
/* SEQ_CTRL_PORT configuration */
{0x2512, 0x8000},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFF07},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0xFFFF},
{0x2510, 0x3001},
{0x2510, 0x3010},
{0x2510, 0x3006},
{0x2510, 0x3020},
{0x2510, 0x3008},
{0x2510, 0xB031},
{0x2510, 0xA824},
{0x2510, 0x003C},
{0x2510, 0x001F},
{0x2510, 0xB2F9},
{0x2510, 0x006F},
{0x2510, 0x0078},
{0x2510, 0x005C},
{0x2510, 0x106F},
{0x2510, 0xC013},
{0x2510, 0x006E},
{0x2510, 0x0079},
{0x2510, 0x007B},
{0x2510, 0xC806},
{0x2510, 0x106E},
{0x2510, 0x0017},
{0x2510, 0x0013},
{0x2510, 0x004B},
{0x2510, 0x0002},
{0x2510, 0x90F2},
{0x2510, 0x90FF},
{0x2510, 0xD034},
{0x2510, 0x1032},
{0x2510, 0x0000},
{0x2510, 0x0033},
{0x2510, 0x00D1},
{0x2510, 0x092E},
{0x2510, 0x1333},
{0x2510, 0x123D},
{0x2510, 0x045B},
{0x2510, 0x11BB},
{0x2510, 0x133A},
{0x2510, 0x1013},
{0x2510, 0x1017},
{0x2510, 0x1015},
{0x2510, 0x1099},
{0x2510, 0x14DB},
{0x2510, 0x00DD},
{0x2510, 0x3088},
{0x2510, 0x3084},
{0x2510, 0x2003},
{0x2510, 0x11F9},
{0x2510, 0x02DA},
{0x2510, 0xD80C},
{0x2510, 0x2006},
{0x2510, 0x017A},
{0x2510, 0x01F0},
{0x2510, 0x14F0},
{0x2510, 0x008B},
{0x2510, 0x10F8},
{0x2510, 0x118B},
{0x2510, 0x00ED},
{0x2510, 0x00E4},
{0x2510, 0x0072},
{0x2510, 0x203B},
{0x2510, 0x8828},
{0x2510, 0x2003},
{0x2510, 0x1064},
{0x2510, 0x0063},
{0x2510, 0x1072},
{0x2510, 0x003E},
{0x2510, 0xC00A},
{0x2510, 0x05CD},
{0x2510, 0x006E},
{0x2510, 0x100E},
{0x2510, 0x0019},
{0x2510, 0x0015},
{0x2510, 0x16EE},
{0x2510, 0x0071},
{0x2510, 0x10BE},
{0x2510, 0x1063},
{0x2510, 0x1671},
{0x2510, 0x1095},
{0x2510, 0x1019},
{0x2510, 0x3088},
{0x2510, 0x3084},
{0x2510, 0x2003},
{0x2510, 0x018B},
{0x2510, 0x110B},
{0x2510, 0x117B},
{0x2510, 0x00E4},
{0x2510, 0x0072},
{0x2510, 0x20C4},
{0x2510, 0x1064},
{0x2510, 0x107A},
{0x2510, 0x1072},
{0x2510, 0x3041},
{0x2510, 0xD800},
{0x2510, 0x881A},
{0x2510, 0x100C},
{0x2510, 0x000E},
{0x2510, 0x100D},
{0x2510, 0x3081},
{0x2510, 0x10CB},
{0x2510, 0x1052},
{0x2510, 0x0038},
{0x2510, 0xC200},
{0x2510, 0xCA00},
{0x2510, 0xD230},
{0x2510, 0x8200},
{0x2510, 0x11AE},
{0x2510, 0xB041},
{0x2510, 0xD000},
{0x2510, 0x106D},
{0x2510, 0x101F},
{0x2510, 0x100E},
{0x2510, 0x100A},
{0x2510, 0x3042},
{0x2510, 0x3086},
{0x2510, 0x102F},
{0x2510, 0x3090},
{0x2510, 0x9010},
{0x2510, 0xB000},
{0x2510, 0x30A0},
{0x2510, 0x1016},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
{0x2510, 0x7FFF},
/* end of sequential port configuration */
{0x3508, 0xAA80}, /* DAC_LD_8_9 */
{0x350A, 0xC5C0}, /* DAC_LD_10_11 */
{0x350C, 0xC8C4}, /* DAC_LD_12_13 */
{0x350E, 0x8C8C}, /* DAC_LD_14_15 */
{0x3510, 0x8C88}, /* DAC_LD_16_17 */
{0x3512, 0x8C8C}, /* DAC_LD_18_19 */
{0x3514, 0xA0A0}, /* DAC_LD_20_21 */
{0x3518, 0x0040}, /* DAC_LD_24_25 */
{0x351A, 0x8600}, /* DAC_LD_26_27 */
{0x351E, 0x0E40}, /* DAC_LD_30_31 */
{0x3506, 0x004A}, /* DAC_LD_6_7 */
{0x3520, 0x0E19}, /* DAC_LD_32_33 */
{0x3522, 0x7F7F}, /* DAC_LD_34_35 */
{0x3524, 0x7F7F}, /* DAC_LD_36_37 */
{0x3526, 0x7F7F}, /* DAC_LD_38_39 */
{0x3528, 0x7F7F}, /* DAC_LD_40_41 */
{0x30FE, 0x00A8}, /* NOISE_PEDESTAL */
{0x3584, 0x0000}, /* ROW_AB_CTRL */
{0x3540, 0x8308}, /* DAC_LD_64_65 */
{0x354C, 0x0031}, /* DAC_LD_76_77 */
{0x354E, 0x535C}, /* DAC_LD_78_79 */
{0x3550, 0x5C7F}, /* DAC_LD_80_81 */
{0x3552, 0x0011}, /* DAC_LD_82_83 */
{0x3370, 0x0111}, /* DBLC_CONTROL */
{0x337A, 0x0F50}, /* DBLC_SCALE0 */
{0x337E, 0xFFF8}, /* DBLC_OFFSET0 */
{0x3110, 0x0011}, /* HDR_CONTROL0 */
{0x3100, 0x4000}, /* DLO_CONTROL0 */
{0x3364, 0x0173}, /* DCG_TRIM */
{0x3180, 0x0021}, /* DELTA_DK_CONTROL */
{0x3E4C, 0x0404}, /* ROW_NOISE_DDK_FILTER_CONF */
{0x3E52, 0x0060}, /* ROW_NOISE_DDK_KERNEL_SIZE */
{0x3180, 0x0021}, /* DELTA_DK_CONTROL */
{0x37A0, 0x0001}, /* COARSE_INTEGRATION_AD_TIME */
{0x37A4, 0x0000}, /* COARSE_INTEGRATION_AD_TIME2 */
{0x37A8, 0x0000}, /* COARSE_INTEGRATION_AD_TIME3 */
{0x37AC, 0x0000}, /* COARSE_INTEGRATION_AD_TIME4 */
{0x3E94, 0x2F10}, /* TEMPVSENS1_SREG_TRIM0 */
{0x3E9C, 0x0000}, /* TEMPVSENS0_MUX_ADDR_EN_HI */
{0x3E9E, 0x0000}, /* TEMPVSENS0_MUX_ADDR_EN_LO */
{0x3F92, 0x5400}, /* TEMPVSENS1_TMG_CTRL */
{0x3372, 0xF50F}, /* DBLC_FS0_CONTROL */
{0x302A, 0x0003}, /* VT_PIX_CLK_DIV */
{0x302C, 0x0701}, /* VT_SYS_CLK_DIV */
{0x302E, 0x0009}, /* PRE_PLL_CLK_DIV */
{0x3030, 0x00a9}, /* PLL_MULTIPLIER */
{0x3036, 0x0006}, /* OP_WORD_CLK_DIV */
{0x3038, 0x0001}, /* OP_SYS_CLK_DIV */
{0x303A, 0x0085}, /* PLL_MULTIPLIER_ANA */
{0x303C, 0x0003}, /* PRE_PLL_CLK_DIV_ANA */
{0x31B0, 0x0047}, /* FRAME_PREAMBLE */
{0x31B2, 0x0026}, /* LINE_PREAMBLE */
{0x31B4, 0x5187}, /* MIPI_TIMING_0 */
{0x31B6, 0x5248}, /* MIPI_TIMING_1 */
{0x31B8, 0x70CA}, /* MIPI_TIMING_2 */
{0x31BA, 0x028A}, /* MIPI_TIMING_3 */
{0x31BC, 0x8A88}, /* MIPI_TIMING_4 */
{0x31BE, 0x0023}, /* MIPI_CONFIG_STATUS */
{0x3002, 0x0000}, /* Y_ADDR_START_ */
{0x3004, 0x0000}, /* X_ADDR_START_ */
{0x3006, 0x0437}, /* Y_ADDR_END_ */
{0x3008, 0x077F}, /* X_ADDR_END_ */
{0x32FC, 0x0000}, /* READ_MODE2 */
{0x37E0, 0x8421}, /* ROW_TX_RO_ENABLE */
{0x37E2, 0x8421}, /* ROW_TX_RO_ENABLE_CB */
{0x323C, 0x8421}, /* ROW_TX_ENABLE */
{0x323E, 0x8421}, /* ROW_TX_ENABLE_CB */
{0x3040, 0x0001}, /* READ_MODE */
{0x301D, 0x0000}, /* IMAGE_ORIENTATION_ */
{0x3082, 0x0000}, /* OPERATION_MODE_CTRL */
{0x30BA, 0x1110}, /* DIGITAL_CTRL */
{0x3012, 0x0090}, /* COARSE_INTEGRATION_TIME_ */
{0x3362, 0x00FF}, /* DC_GAIN */
{0x3366, 0x0000}, /* ANALOG_GAIN */
{0x336A, 0x0000}, /* ANALOG_GAIN2 */
{0x300C, 0x1160}, /* LINE_LENGTH_PCK_ */
{0x300A, 0x0928}, /* FRAME_LENGTH_LINES_ */
{0x31AE, 0x0204}, /* SERIAL_FORMAT */
{0x31AC, 0x0C0C}, /* DATA_FORMAT_BITS */
{0x3064, 0x0100}, /* SMIA_TEST */
{0x3012, 0x0100}, /* COARSE_INTEGRATION_TIME_ */
{0x3064, 0x0000}, /* SMIA_TEST */
{0x301A, 0x005C}, /* RESET_REGISTER */
{AR0820_TABLE_WAIT_MS, 100}, /* RESET_REGISTER */
{AR0820_TABLE_END, 0x00},
};
- Then i’ve set the 2 Mpx resolution in tegra194-camera-ar0820-a00.dtsi
mode0 {/*mode AR0820_MODE_1920X1080_CROP_30FPS*/
mclk_khz = "24000";
num_lanes = "4";
tegra_sinterface = "serial_e";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
dynamic_pixel_bit_depth = "12";
csi_pixel_bit_depth = "12";
mode_type = "bayer";
pixel_phase = "grbg";
active_w = "1920";
active_h = "1080";
readout_orientation = "0";
line_length = "4440";
inherent_gain = "1";
mclk_multiplier = "14.58";
pix_clk_hz = "296236800";
serdes_pix_clk_hz = "833333333";
gain_factor = "1";
Can you please suggest a modification to be able to do a resizing and not a cropping ?
Thanks