Пример #1
0
static int fimc_is_isp_start_streaming(struct vb2_queue *q)
{
	struct fimc_is_video_dev *video = vb2_get_drv_priv(q);
	struct fimc_is_dev	*is_dev = video->dev;
	int i, j;
	int buf_num, buf_plane, buf_index;

	if (test_bit(FIMC_IS_STATE_ISP_BUFFER_PREPARED, &is_dev->vb_state) &&
		!test_bit(FIMC_IS_STATE_ISP_STREAM_ON, &is_dev->vb_state)) {

		dbg("Start streaming!!\n");
		/* buffer addr setting */
		buf_num = is_dev->video[FIMC_IS_VIDEO_NUM_BAYER].num_buf;
		buf_plane = is_dev->video[FIMC_IS_VIDEO_NUM_BAYER].num_plane;
		for (i = 0; i < buf_num; i++)
			for (j = 0; j < buf_plane; j++) {
				buf_index = i*buf_plane + j;
				printk(KERN_INFO "(%d)set buf(%d:%d)= 0x%08x\n"
					, buf_index, i, j,
			is_dev->video[FIMC_IS_VIDEO_NUM_BAYER].buf[i][j]);
				is_dev->is_p_region->shared[32+buf_index]
			= is_dev->video[FIMC_IS_VIDEO_NUM_BAYER].buf[i][j];
			}

		printk(KERN_INFO "buf_num:%d buf_plane:%d shared[32]: 0x%08x\n",
			is_dev->video[FIMC_IS_VIDEO_NUM_BAYER].num_buf,
			is_dev->video[FIMC_IS_VIDEO_NUM_BAYER].num_plane,
			virt_to_phys(is_dev->is_p_region->shared) +
							32*sizeof(u32));

		IS_ISP_SET_PARAM_DMA_OUTPUT2_CMD(is_dev,
					DMA_OUTPUT_COMMAND_ENABLE);
		IS_ISP_SET_PARAM_DMA_OUTPUT2_BUFFER_NUMBER(is_dev,
				is_dev->video[FIMC_IS_VIDEO_NUM_BAYER].num_buf);
		IS_ISP_SET_PARAM_DMA_OUTPUT2_BUFFER_ADDRESS(is_dev,
				(u32)virt_to_phys(is_dev->is_p_region->shared)
				+ 32 * sizeof(u32));
		IS_ISP_SET_PARAM_DMA_OUTPUT2_NODIFY_DMA_DONE(is_dev,
				DMA_OUTPUT_NOTIFY_DMA_DONE_ENBABLE);
		/* All buffers are available to write image data */
		IS_ISP_SET_PARAM_DMA_OUTPUT2_MASK(is_dev, 0xFFFFFFFF);
		IS_SET_PARAM_BIT(is_dev, PARAM_ISP_DMA2_OUTPUT);
		IS_INC_PARAM_NUM(is_dev);

		fimc_is_mem_cache_clean((void *)is_dev->is_p_region,
			IS_PARAM_SIZE);
		fimc_is_hw_set_param(is_dev);
		set_bit(FIMC_IS_STATE_ISP_STREAM_ON, &is_dev->vb_state);
	}
	return 0;
}
Пример #2
0
int fimc_is_itf_s_param(struct fimc_is *is, bool update)
{
	int ret;

	if (update)
		__is_hw_update_params(is);

	fimc_is_mem_barrier();

	clear_bit(IS_ST_BLOCK_CMD_CLEARED, &is->state);
	fimc_is_hw_set_param(is);
	ret = fimc_is_wait_event(is, IS_ST_BLOCK_CMD_CLEARED, 1,
				FIMC_IS_CONFIG_TIMEOUT);
	if (ret < 0)
		dev_err(&is->pdev->dev, "%s() timeout\n", __func__);

	return ret;
}
Пример #3
0
static int fimc_is_isp_stop_streaming(struct vb2_queue *q)
{
	struct fimc_is_video_dev *video = vb2_get_drv_priv(q);
	struct fimc_is_dev	*is_dev = video->dev;

	IS_ISP_SET_PARAM_DMA_OUTPUT2_CMD(is_dev, DMA_OUTPUT_COMMAND_DISABLE);
	IS_ISP_SET_PARAM_DMA_OUTPUT2_NODIFY_DMA_DONE(is_dev,
					DMA_OUTPUT_NOTIFY_DMA_DONE_DISABLE);
	IS_SET_PARAM_BIT(is_dev, PARAM_ISP_DMA2_OUTPUT);
	IS_INC_PARAM_NUM(is_dev);

	fimc_is_mem_cache_clean((void *)is_dev->is_p_region,
			IS_PARAM_SIZE);
	fimc_is_hw_set_param(is_dev);

	clear_bit(FIMC_IS_STATE_ISP_STREAM_ON, &is_dev->vb_state);
	clear_bit(FIMC_IS_STATE_ISP_BUFFER_PREPARED, &is_dev->vb_state);
	return 0;
}