mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
media: rockchip: isp: first frame run double for isp32 fast mode
Change-Id: I56e63b76ef5b9fd13c00aa809399e110fd77af97 Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -1036,7 +1036,7 @@ static int mi_frame_start(struct rkisp_stream *stream, u32 mis)
|
||||
{
|
||||
unsigned long lock_flags = 0;
|
||||
|
||||
if (mis && stream->streaming) {
|
||||
if (stream->streaming) {
|
||||
rkisp_rockit_buf_done(stream, ROCKIT_DVBM_START);
|
||||
rkisp_rockit_ctrl_fps(stream);
|
||||
}
|
||||
|
||||
@@ -247,6 +247,7 @@ struct rkisp_device {
|
||||
bool is_bigmode;
|
||||
bool is_rdbk_auto;
|
||||
bool is_pre_on;
|
||||
bool is_first_double;
|
||||
|
||||
struct rkisp_vicap_input vicap_in;
|
||||
|
||||
|
||||
@@ -128,6 +128,12 @@ static int rkisp_params_vb2_queue_setup(struct vb2_queue *vq,
|
||||
params_vdev->ops->get_param_size(params_vdev, sizes);
|
||||
|
||||
INIT_LIST_HEAD(¶ms_vdev->params);
|
||||
|
||||
if (params_vdev->first_cfg_params) {
|
||||
params_vdev->first_cfg_params = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
params_vdev->first_params = true;
|
||||
|
||||
return 0;
|
||||
@@ -141,10 +147,10 @@ static void rkisp_params_vb2_buf_queue(struct vb2_buffer *vb)
|
||||
struct rkisp_isp_params_vdev *params_vdev = vq->drv_priv;
|
||||
void *first_param;
|
||||
unsigned long flags;
|
||||
|
||||
unsigned int cur_frame_id = -1;
|
||||
|
||||
cur_frame_id = atomic_read(¶ms_vdev->dev->isp_sdev.frm_sync_seq) - 1;
|
||||
if (params_vdev->first_params) {
|
||||
if (params_vdev->first_params || params_vdev->dev->is_first_double) {
|
||||
first_param = vb2_plane_vaddr(vb, 0);
|
||||
params_vdev->ops->save_first_param(params_vdev, first_param);
|
||||
params_vdev->is_first_cfg = true;
|
||||
@@ -152,7 +158,12 @@ static void rkisp_params_vb2_buf_queue(struct vb2_buffer *vb)
|
||||
vb2_buffer_done(¶ms_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
|
||||
params_vdev->first_params = false;
|
||||
wake_up(¶ms_vdev->dev->sync_onoff);
|
||||
dev_info(params_vdev->dev->dev, "first params buf queue\n");
|
||||
if (params_vdev->dev->is_first_double) {
|
||||
params_vdev->dev->is_first_double = false;
|
||||
rkisp_trigger_read_back(params_vdev->dev, false, false, false);
|
||||
} else {
|
||||
dev_info(params_vdev->dev->dev, "first params buf queue\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,6 +218,10 @@ static void rkisp_params_vb2_stop_streaming(struct vb2_queue *vq)
|
||||
params_vdev->cur_buf = NULL;
|
||||
}
|
||||
|
||||
if (dev->is_pre_on) {
|
||||
params_vdev->first_cfg_params = true;
|
||||
return;
|
||||
}
|
||||
rkisp_params_disable_isp(params_vdev);
|
||||
/* clean module params */
|
||||
params_vdev->ops->clear_first_param(params_vdev);
|
||||
|
||||
@@ -4395,6 +4395,9 @@ static void rkisp_save_first_param_v32(struct rkisp_isp_params_vdev *params_vdev
|
||||
(struct rkisp_isp_params_val_v32 *)params_vdev->priv_val;
|
||||
|
||||
memcpy(params_vdev->isp32_params, param, params_vdev->vdev_fmt.fmt.meta.buffersize);
|
||||
|
||||
if (!params_vdev->first_params)
|
||||
return;
|
||||
tasklet_enable(&priv_val->lsc_tasklet);
|
||||
rkisp_alloc_internal_buf(params_vdev, params_vdev->isp32_params);
|
||||
}
|
||||
|
||||
@@ -640,9 +640,6 @@ rkisp_stats_isr_v32(struct rkisp_isp_stats_vdev *stats_vdev,
|
||||
isp_mis_tmp, isp3a_ris);
|
||||
}
|
||||
|
||||
if (!stats_vdev->streamon)
|
||||
goto unlock;
|
||||
|
||||
if (isp_ris & ISP3X_FRAME) {
|
||||
work.readout = RKISP_ISP_READOUT_MEAS;
|
||||
work.frame_id = cur_frame_id;
|
||||
@@ -652,7 +649,6 @@ rkisp_stats_isr_v32(struct rkisp_isp_stats_vdev *stats_vdev,
|
||||
rkisp_stats_send_meas_v32(stats_vdev, &work);
|
||||
}
|
||||
|
||||
unlock:
|
||||
spin_unlock(&stats_vdev->irq_lock);
|
||||
}
|
||||
|
||||
|
||||
@@ -803,6 +803,8 @@ static void rkisp_rdbk_trigger_handle(struct rkisp_device *dev, u32 cmd)
|
||||
isp->sw_rd_cnt = 1;
|
||||
times = 0;
|
||||
}
|
||||
if (dev->is_pre_on && t.frame_id == 0)
|
||||
dev->is_first_double = true;
|
||||
}
|
||||
end:
|
||||
spin_unlock_irqrestore(&hw->rdbk_lock, lock_flags);
|
||||
@@ -859,6 +861,8 @@ void rkisp_check_idle(struct rkisp_device *dev, u32 irq)
|
||||
{
|
||||
u32 val = 0;
|
||||
|
||||
if (dev->is_first_double)
|
||||
return;
|
||||
if (dev->hw_dev->is_multi_overflow &&
|
||||
dev->sw_rd_cnt &&
|
||||
irq & ISP_FRAME_END)
|
||||
@@ -3260,7 +3264,7 @@ static long rkisp_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||
rkisp_get_info(isp_dev, arg);
|
||||
break;
|
||||
case RKISP_CMD_GET_TB_HEAD_V32:
|
||||
if (isp_dev->tb_head.complete != RKISP_TB_OK) {
|
||||
if (isp_dev->tb_head.complete != RKISP_TB_OK || !isp_dev->is_pre_on) {
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
@@ -3269,7 +3273,6 @@ static long rkisp_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||
sizeof(struct rkisp_thunderboot_resmem_head));
|
||||
memcpy(&tb_head_v32->cfg, isp_dev->params_vdev.isp32_params,
|
||||
sizeof(struct isp32_isp_params_cfg));
|
||||
isp_dev->tb_head.complete = 0;
|
||||
break;
|
||||
case RKISP_CMD_GET_SHARED_BUF:
|
||||
if (!IS_ENABLED(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP)) {
|
||||
|
||||
Reference in New Issue
Block a user