struct fimc_is_framemgr *framemgr;
struct fimc_is_device_ischain *device;
struct fimc_is_device_sensor *sensor;
+ struct fimc_is_group *head;
struct fimc_is_group *child;
struct fimc_is_subdev *subdev;
struct fimc_is_group_task *gtask;
device = group->device;
sensor = device->sensor;
framemgr = GET_HEAD_GROUP_FRAMEMGR(group);
- gtask = &groupmgr->gtask[group->id];
if (!framemgr) {
mgerr("framemgr is NULL", group, group);
goto p_err;
return -EPERM;
}
+ FIMC_BUG(!group->head);
+ head = group->head;
+ gtask = &groupmgr->gtask[head->id];
+
/* force stop set if only HEAD group OTF input */
if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->head->state)) {
if (test_bit(FIMC_IS_GROUP_REQUEST_FSTOP, &group->state))
retry = 150;
while (--retry && framemgr->queued_count[FS_REQUEST]) {
- if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state) &&
- !list_empty(&group->smp_trigger.wait_list)) {
+ if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &head->state) &&
+ !list_empty(&head->smp_trigger.wait_list)) {
if (!sensor) {
- mwarn(" sensor is NULL, forcely trigger(pc %d)", device, group->pcount);
- set_bit(FIMC_IS_GROUP_FORCE_STOP, &group->state);
- up(&group->smp_trigger);
- } else if (!test_bit(FIMC_IS_SENSOR_OPEN, &sensor->state)) {
- mwarn(" sensor is closed, forcely trigger(pc %d)", device, group->pcount);
- set_bit(FIMC_IS_GROUP_FORCE_STOP, &group->state);
- up(&group->smp_trigger);
+ mwarn(" sensor is NULL, forcely trigger(pc %d)", device, head->pcount);
+ set_bit(FIMC_IS_GROUP_FORCE_STOP, &head->state);
+ up(&head->smp_trigger);
+ } else if (!test_bit(FIMC_IS_SENSOR_OPEN, &head->state)) {
+ mwarn(" sensor is closed, forcely trigger(pc %d)", device, head->pcount);
+ set_bit(FIMC_IS_GROUP_FORCE_STOP, &head->state);
+ up(&head->smp_trigger);
} else if (!test_bit(FIMC_IS_SENSOR_FRONT_START, &sensor->state)) {
- mwarn(" front is stopped, forcely trigger(pc %d)", device, group->pcount);
- set_bit(FIMC_IS_GROUP_FORCE_STOP, &group->state);
- up(&group->smp_trigger);
+ mwarn(" front is stopped, forcely trigger(pc %d)", device, head->pcount);
+ set_bit(FIMC_IS_GROUP_FORCE_STOP, &head->state);
+ up(&head->smp_trigger);
} else if (!test_bit(FIMC_IS_SENSOR_BACK_START, &sensor->state)) {
- mwarn(" back is stopped, forcely trigger(pc %d)", device, group->pcount);
- set_bit(FIMC_IS_GROUP_FORCE_STOP, &group->state);
- up(&group->smp_trigger);
+ mwarn(" back is stopped, forcely trigger(pc %d)", device, head->pcount);
+ set_bit(FIMC_IS_GROUP_FORCE_STOP, &head->state);
+ up(&head->smp_trigger);
} else if (retry < 100) {
- merr(" sensor is working but no trigger(pc %d)", device, group->pcount);
- set_bit(FIMC_IS_GROUP_FORCE_STOP, &group->state);
- up(&group->smp_trigger);
+ merr(" sensor is working but no trigger(pc %d)", device, head->pcount);
+ set_bit(FIMC_IS_GROUP_FORCE_STOP, &head->state);
+ up(&head->smp_trigger);
} else {
- mwarn(" wating for sensor trigger(pc %d)", device, group->pcount);
+ mwarn(" wating for sensor trigger(pc %d)", device, head->pcount);
}
#ifdef ENABLE_SYNC_REPROCESSING
} else if (!test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state)) {
#endif
}
- mgwarn(" %d reqs waiting...(pc %d) smp_resource(%d)", device, group,
- framemgr->queued_count[FS_REQUEST], group->pcount,
+ mgwarn(" %d reqs waiting...(pc %d) smp_resource(%d)", device, head,
+ framemgr->queued_count[FS_REQUEST], head->pcount,
list_empty(>ask->smp_resource.wait_list));
msleep(20);
}
if (!retry) {
- mgerr(" waiting(until request empty) is fail(pc %d)", device, group, group->pcount);
+ mgerr(" waiting(until request empty) is fail(pc %d)", device, head, head->pcount);
errcnt++;
}
retry = 150;
while (--retry && framemgr->queued_count[FS_PROCESS]) {
- mgwarn(" %d pros waiting...(pc %d)", device, group, framemgr->queued_count[FS_PROCESS], group->pcount);
+ mgwarn(" %d pros waiting...(pc %d)", device, head, framemgr->queued_count[FS_PROCESS], head->pcount);
msleep(20);
}
if (!retry) {
- mgerr(" waiting(until process empty) is fail(pc %d)", device, group, group->pcount);
+ mgerr(" waiting(until process empty) is fail(pc %d)", device, head, head->pcount);
errcnt++;
}
- rcount = atomic_read(&group->rcount);
+ rcount = atomic_read(&head->rcount);
if (rcount) {
- mgerr(" request is NOT empty(%d) (pc %d)", device, group, rcount, group->pcount);
+ mgerr(" request is NOT empty(%d) (pc %d)", device, head, rcount, head->pcount);
errcnt++;
}
/* the count of request should be clear for next streaming */
- atomic_set(&group->rcount, 0);
+ atomic_set(&head->rcount, 0);
child = group;
while(child) {
child = child->child;
}
- fimc_is_gframe_flush(groupmgr, group);
+ fimc_is_gframe_flush(groupmgr, head);
if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state))
mginfo(" sensor fcount: %d, fcount: %d\n", device, group,