static int fimc_is_sen_start_streaming(struct vb2_queue *q, unsigned int count) { int ret = 0; struct fimc_is_video_ctx *vctx = q->drv_priv; struct fimc_is_queue *queue; struct fimc_is_device_sensor *device; BUG_ON(!vctx); mdbgv_sensor("%s\n", vctx, __func__); queue = GET_DST_QUEUE(vctx); device = vctx->device; if (!test_bit(FIMC_IS_QUEUE_STREAM_ON, &queue->state) && test_bit(FIMC_IS_QUEUE_BUFFER_READY, &queue->state)) { set_bit(FIMC_IS_QUEUE_STREAM_ON, &queue->state); fimc_is_sensor_back_start(device); } else { err("already stream on or buffer is not ready(%ld)", queue->state); clear_bit(FIMC_IS_QUEUE_BUFFER_READY, &queue->state); clear_bit(FIMC_IS_QUEUE_BUFFER_PREPARED, &queue->state); fimc_is_sensor_back_stop(device); ret = -EINVAL; } return 0; }
static int fimc_is_bayer_start_streaming(struct vb2_queue *q, unsigned int count) { int ret = 0; struct fimc_is_video_sensor *video = q->drv_priv; struct fimc_is_video_common *common = &video->common; struct fimc_is_device_sensor *sensor = common->device; dbg_sensor("%s\n", __func__); if (!test_bit(FIMC_IS_VIDEO_STREAM_ON, &common->state) && test_bit(FIMC_IS_VIDEO_BUFFER_READY, &common->state)) { set_bit(FIMC_IS_VIDEO_STREAM_ON, &common->state); fimc_is_sensor_back_start(sensor, common); } else { err("already stream on or buffer is not ready(%ld)", common->state); clear_bit(FIMC_IS_VIDEO_BUFFER_READY, &common->state); clear_bit(FIMC_IS_VIDEO_BUFFER_PREPARED, &common->state); fimc_is_sensor_back_stop(sensor); ret = -EINVAL; } return 0; }