当一个摄像头有两个vc输出的时候,如何更改驱动配置呢?
当一个摄像头可以输出两路vc,并且格式不同。根据每一路的vc图像数据格式修改串行器中maxxxx_mode_t里面的数组mode参数(以下仅为例子)
struct maxxxx_mode_t maxxxx_modes[4] = {
[AR0231 MODE 12BIT HDR 3EXP 30FPS]=
{
pipeline={
.id = MAXIM PIPELINE X,
.mode={
.fmt = QCARCAM_FMT_MIPIRAW_1O,
.res ={ .Width = DMS SENSOR WIDTH,.height = DMS SENSOR HEIGHT,.fps = 3O.Of},
.channel_info = {.vc = 0,.dt = CSI_DT_RAW10,.Cid=CIDVCO},
}
}
},
[AR0231 MODE 12BIT LINEAR 30FPS] =
{
pipeline ={
.id = MAXIM PIPELINE X,
.mode={
.fmt = QCARCAM_FMT_YVYU_10,
.res = {.Width = DMS SENSOR WIDTH,.height= DMS SENSOR HEIGHT,.fps = 3O.Of},
.channel_info = {.vc = 1,.dt = CSI_DT_YUV422_10,.Cid=CID_VC1},
}
},
},
...
}
并且在驱动中的getlink中修改支持两路vc图像获取,
static int max96717_get_link_cfg(max96712_context_t* ctxt,
uint32 1ink, max96712_1ink_cfg_t* p_cfg)
{
int rc=0;
unsigned int mode = ctxt->max96712_sensors[link].mode;
if(link==CAMERA_2VC) //两路VC
{
p_cfg->num_pipelines = 2;
p_cfg->pipelines[0] = max96717_modes[mode].pipeline;
p_cfg->pipelines[l] = max96717_modes[mode+l].pipeline;
}else
{
p_cfg->num_pipelines = 1;
p_cfg->pipelines[0] = max96717_modes[mode].pipeline;
}
return rc;
}
同时解串器的寄存器也要配置支持两路vc
// YUv422 8bit,video pipe1,mapFS/FE
0x04,0x82,0x09,0x4B 0x3F
0x04,0x82,0x09,0x6D,0x55,//map to MIPI Controller 1
0x04,0x82,0x09,0x6E,0x05,//map to MIPI Controller 1
0x04,0x82,0x09,0x4D,0x1E
0x04,0x82,0x09,0x4E,0x5E,//vco map to vcl
0x04,0x82,0x09,0x4F,0x00,//frame start
0x04,0x82,0x09,0x50,0x40,
0x04,0x82,0x09,0x51,0x01
0x04,0x82,0x09,0x52,0x41,
0x04,0x82,0x09,0x53,0x5E,
0x04,0x82,0x09,0x54,0x9E,//VCl map to vc2
0x04,0x82,0x09,0x55,0x40,// frame start
0x04,0x82,0x09,0x56,0x80,
0x04,0x82,0x09,0x57,0x41,
0x04,0x82,0x09,0x58,0x81,
qcarcam_test测试效果
qcarcam测试的时候会有3路输出,但硬件上其实只接了2个摄像头
# gcarcam test -config=./lcam.xml