hello,
My custom board used dm8148 and tvp5158 .By now,I ran saLoopBackFbdev.c and can captrue correct image from camera,when setting tvp5158 with 1CH D1 Mode.
ti81xx_vpss.c code is below :
static struct ti81xxvin_subdev_info hdvpss_capture_sdev_info[] = {
......
.video_capture_mode =
VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC,
.video_if_mode = VPS_CAPT_VIDEO_IF_MODE_8BIT,
.input_data_format = FVID2_DF_YUV422P,
}
========================================================================
Now, I will capture 4CH D1 with tvp5158,so set tvp5158 with 4ch D1 mode,and modify ti81xx_vpss.c code.
static struct ti81xxvin_subdev_info hdvpss_capture_sdev_info[] = {
......
.video_capture_mode =
VPS_CAPT_VIDEO_CAPTURE_MODE_MULTI_CH_LINE_MUX_EMBEDDED_SYNC,
.video_if_mode = VPS_CAPT_VIDEO_IF_MODE_8BIT,
.input_data_format = FVID2_DF_YUV422P,
}
and I run saLoopBackFbdev.c,but it is go wrong when startCapture,the information on console is :VPSS_FVID2: create handle is NULL
ret = queueCaptureBuffers();
/* Start Captureing */
ret = startCapture();
/* Start capture and display loop */
for (i = 0; i < MAXLOOPCOUNT; i++) {
ret = ioctl(capt.fd, VIDIOC_DQBUF, &capt.buf);
I debuged the vpss driver kernel/driver/video/ti81xx/vpss/fvid2.c ,
void *vps_fvid2_create(u32 drvid,
u32 instanceid,
void *createargs,
void *createstatusargs,
struct fvid2_cbparams *cbparams)
{
struct vps_fvid2_ctrl *fctrl = NULL;
int status;
struct timeval stime, etime;
u32 td = 0;
fctrl = vps_alloc_fvid2_ctrl();
if (fctrl == NULL)
return NULL;
/*assembel the create parameter structure*/
fctrl->fcrprms->command = VPS_FVID2_CREATE;
fctrl->fcrprms->hosttaskinstance = VPS_FVID2_TASK_TYPE_1,
fctrl->fcrprms->createargs = createargs;
fctrl->fcrprms->createstatusargs = createstatusargs;
fctrl->fcrprms->drvid = drvid;
fctrl->fcrprms->cbparams = cbparams;
fctrl->fcrprms->instanceid = instanceid;
fctrl->fcrprms->fvid2handle = (void *)VPS_FVID2_M3_INIT_VALUE;
if (cbparams == NULL) {
fctrl->fcrprms->ioreqcb = NULL;
fctrl->fcrprms->errcb = NULL;
} else {
fctrl->fcrprms->ioreqcb =
(struct vps_psrvcallback *)fctrl->cbprms_phy;
fctrl->fcrprms->errcb =
(struct vps_psrverrorcallback *)fctrl->ecbprms_phy;
}
fctrl->cmdprms->cmdtype = VPS_FVID2_CMDTYPE_SIMPLEX;
fctrl->cmdprms->simplexcmdarg = (void *)fctrl->fcrprms_phy;
/*set the event to M3*/
#ifdef CONFIG_TI81XX_VPSS_SYSNLINK_NOTIFY
status = Notify_sendEvent(fctrl->rmprocid,
fctrl->lineid,
VPS_FVID2_RESERVED_NOTIFY,
fctrl->cmdprms_phy,
1);
#else
status = notify_send_event(fctrl->rmprocid,
fctrl->lineid,
VPS_FVID2_RESERVED_NOTIFY,
fctrl->cmdprms_phy,
1);
#endif
if (status < 0) {
VPSSERR("send create event failed with status 0x%0x\n",
status);
goto exit;
}
do_gettimeofday(&stime);
etime = stime;
while ((fctrl->fcrprms->fvid2handle ==
(void *)VPS_FVID2_M3_INIT_VALUE)) {
usleep_range(100, 300);
/*time out check*/
if (vps_timeout) {
do_gettimeofday(&etime);
td = time_diff(stime, etime);
if (vps_timeout < td) {
VPSSERR("create timeout\n");
goto exit;
}
}
}
fctrl->notifyno = fctrl->fcrprms->syslnkntyno;
fctrl->fvid2handle = (u32)fctrl->fcrprms->fvid2handle;
VPSSDBG("Fvid2 handle 0x%08x with notifyno %d within %d ms\n",
(u32)fctrl->fvid2handle,
fctrl->notifyno,
td);
if (fctrl->fvid2handle == 0) {
VPSSERR("create handle is NULL\n");
goto exit;
}
How can I resolve this problem?and should I modify saLoopBackFbdev.c because of capturing SuperFame?
Thanks