media: rockchip: isp: sync multi vir dev stream on/off

Change-Id: I851b0390952a4f3921405a7cd24b8af7fbaff532
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
Cai YiWei
2021-10-13 17:10:14 +08:00
committed by Tao Huang
parent 67a3dbc5af
commit e01e0fd967
8 changed files with 105 additions and 130 deletions

View File

@@ -1051,14 +1051,7 @@ static int bridge_start(struct rkisp_bridge_device *dev)
dev->ops->config(dev);
rkisp_start_spstream(sp_stream);
if (!dev->ispdev->hw_dev->is_mi_update) {
rkisp_config_dmatx_valid_buf(dev->ispdev);
force_cfg_update(dev->ispdev);
rkisp_update_spstream_buf(sp_stream);
hdr_update_dmatx_buf(dev->ispdev);
}
dev->ispdev->skip_frame = 0;
rkisp_stats_first_ddr_config(&dev->ispdev->stats_vdev);
dev->en = true;
ispdev->cap_dev.is_done_early = false;
@@ -1272,11 +1265,13 @@ static int bridge_s_rx_buffer(struct v4l2_subdev *sd,
static int bridge_s_stream(struct v4l2_subdev *sd, int on)
{
struct rkisp_bridge_device *dev = v4l2_get_subdevdata(sd);
struct rkisp_hw_dev *hw = dev->ispdev->hw_dev;
int ret = 0;
v4l2_dbg(1, rkisp_debug, sd,
"%s %d\n", __func__, on);
mutex_lock(&hw->dev_lock);
if (on) {
memset(&dev->dbg, 0, sizeof(dev->dbg));
atomic_inc(&dev->ispdev->cap_dev.refcnt);
@@ -1286,6 +1281,7 @@ static int bridge_s_stream(struct v4l2_subdev *sd, int on)
ret = bridge_stop_stream(sd);
atomic_dec(&dev->ispdev->cap_dev.refcnt);
}
mutex_unlock(&hw->dev_lock);
return ret;
}

View File

@@ -124,7 +124,9 @@ void hdr_destroy_buf(struct rkisp_device *dev)
if (atomic_read(&dev->cap_dev.refcnt) > 1 ||
!dev->active_sensor ||
(dev->active_sensor &&
dev->active_sensor->mbus.type != V4L2_MBUS_CSI2_DPHY))
dev->active_sensor->mbus.type != V4L2_MBUS_CSI2_DPHY) ||
(dev->isp_inp & INP_CIF) ||
(dev->isp_ver != ISP_V20 && dev->isp_ver != ISP_V21))
return;
atomic_set(&dev->hdr.refcnt, 0);
@@ -156,7 +158,8 @@ int hdr_update_dmatx_buf(struct rkisp_device *dev)
if (!dev->active_sensor ||
(dev->active_sensor &&
dev->active_sensor->mbus.type != V4L2_MBUS_CSI2_DPHY) ||
(dev->isp_inp & INP_CIF))
(dev->isp_inp & INP_CIF) ||
(dev->isp_ver != ISP_V20 && dev->isp_ver != ISP_V21))
return 0;
for (i = RKISP_STREAM_DMATX0; i <= RKISP_STREAM_DMATX2; i++) {
@@ -223,7 +226,8 @@ int hdr_config_dmatx(struct rkisp_device *dev)
!dev->active_sensor ||
(dev->active_sensor &&
dev->active_sensor->mbus.type != V4L2_MBUS_CSI2_DPHY) ||
(dev->isp_inp & INP_CIF))
(dev->isp_inp & INP_CIF) ||
(dev->isp_ver != ISP_V20 && dev->isp_ver != ISP_V21))
return 0;
rkisp_create_hdr_buf(dev);
@@ -291,7 +295,8 @@ void hdr_stop_dmatx(struct rkisp_device *dev)
!dev->active_sensor ||
(dev->active_sensor &&
dev->active_sensor->mbus.type != V4L2_MBUS_CSI2_DPHY) ||
(dev->isp_inp & INP_CIF))
(dev->isp_inp & INP_CIF) ||
(dev->isp_ver != ISP_V20 && dev->isp_ver != ISP_V21))
return;
if (dev->hdr.op_mode == HDR_FRAMEX2_DDR ||
@@ -343,7 +348,12 @@ void rkisp_config_dmatx_valid_buf(struct rkisp_device *dev)
struct rkisp_device *isp;
u32 i, j;
if (!hw->dummy_buf.mem_priv)
if (!hw->dummy_buf.mem_priv ||
!dev->active_sensor ||
(dev->active_sensor &&
dev->active_sensor->mbus.type != V4L2_MBUS_CSI2_DPHY) ||
(dev->isp_inp & INP_CIF) ||
(dev->isp_ver != ISP_V20 && dev->isp_ver != ISP_V21))
return;
/* dmatx buf update by mi force or oneself frame end,
* for async dmatx enable need to update to valid buf first.

View File

@@ -383,6 +383,7 @@ static struct streams_ops rkisp_mp_streams_ops = {
.set_data_path = mp_set_data_path,
.is_stream_stopped = mp_is_stream_stopped,
.update_mi = update_mi,
.frame_end = mi_frame_end,
};
static struct streams_ops rkisp_sp_streams_ops = {
@@ -393,6 +394,7 @@ static struct streams_ops rkisp_sp_streams_ops = {
.set_data_path = sp_set_data_path,
.is_stream_stopped = sp_is_stream_stopped,
.update_mi = update_mi,
.frame_end = mi_frame_end,
};
/*
@@ -516,17 +518,8 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
static int rkisp_start(struct rkisp_stream *stream)
{
void __iomem *base = stream->ispdev->base_addr;
struct rkisp_device *dev = stream->ispdev;
bool is_update = false;
int ret;
if (stream->id == RKISP_STREAM_MP ||
stream->id == RKISP_STREAM_SP) {
is_update = (stream->id == RKISP_STREAM_MP) ?
!dev->cap_dev.stream[RKISP_STREAM_SP].streaming :
!dev->cap_dev.stream[RKISP_STREAM_MP].streaming;
}
if (stream->ops->set_data_path)
stream->ops->set_data_path(base);
ret = stream->ops->config_mi(stream);
@@ -534,19 +527,6 @@ static int rkisp_start(struct rkisp_stream *stream)
return ret;
stream->ops->enable_mi(stream);
/* It's safe to config ACTIVE and SHADOW regs for the
* first stream. While when the second is starting, do NOT
* force_cfg_update() because it also update the first one.
*
* The latter case would drop one more buf(that is 2) since
* there's not buf in shadow when the second FE received. This's
* also required because the second FE maybe corrupt especially
* when run at 120fps.
*/
if (is_update) {
force_cfg_update(dev);
mi_frame_end(stream);
}
stream->streaming = true;
return 0;

View File

@@ -17,7 +17,6 @@
static int mi_frame_end(struct rkisp_stream *stream);
static void rkisp_buf_queue(struct vb2_buffer *vb);
static int rkisp_create_dummy_buf(struct rkisp_stream *stream);
static const struct capture_fmt dmatx_fmts[] = {
/* raw */
@@ -1068,8 +1067,10 @@ static int mi_frame_end(struct rkisp_stream *stream)
if (stream->id == RKISP_STREAM_MP || stream->id == RKISP_STREAM_SP)
stream->dbg.delay = ns - dev->isp_sdev.frm_timestamp;
if (is_rdbk_stream(stream) &&
dev->dmarx_dev.trigger == T_MANUAL) {
if (!stream->streaming) {
vb2_buffer_done(vb2_buf, VB2_BUF_STATE_ERROR);
} else if (is_rdbk_stream(stream) &&
dev->dmarx_dev.trigger == T_MANUAL) {
if (stream->id == RKISP_STREAM_DMATX0) {
if (cap->rdbk_buf[RDBK_L]) {
v4l2_err(&dev->v4l2_dev,
@@ -1216,29 +1217,8 @@ static int rkisp_start(struct rkisp_stream *stream)
{
void __iomem *base = stream->ispdev->base_addr;
struct rkisp_device *dev = stream->ispdev;
bool is_update = false;
int ret;
/*
* MP/SP/MPFBC/DMATX need mi_cfg_upd to update shadow reg
* MP/SP/MPFBC will update each other when frame end, but
* MPFBC will limit MP/SP function: resize need to close,
* output yuv format only 422 and 420 than two-plane mode,
* and 422 or 420 is limit to MPFBC output format,
* default 422. MPFBC need start before MP/SP.
* DMATX will not update MP/SP/MPFBC, so it need update
* togeter with other.
*/
if (stream->id == RKISP_STREAM_MP ||
stream->id == RKISP_STREAM_SP) {
is_update = (stream->id == RKISP_STREAM_MP) ?
!dev->cap_dev.stream[RKISP_STREAM_SP].streaming :
!dev->cap_dev.stream[RKISP_STREAM_MP].streaming;
}
if (stream->id == RKISP_STREAM_SP && stream->out_isp_fmt.fmt_type == FMT_FBCGAIN)
is_update = false;
/* only MP support HDR mode, SP want to with HDR need
* to start after MP.
*/
@@ -1252,22 +1232,6 @@ static int rkisp_start(struct rkisp_stream *stream)
return ret;
stream->ops->enable_mi(stream);
/* It's safe to config ACTIVE and SHADOW regs for the
* first stream. While when the second is starting, do NOT
* force_cfg_update() because it also update the first one.
*
* The latter case would drop one more buf(that is 2) since
* there's not buf in shadow when the second FE received. This's
* also required because the second FE maybe corrupt especially
* when run at 120fps.
*/
if (is_update && !dev->br_dev.en) {
rkisp_stats_first_ddr_config(&dev->stats_vdev);
rkisp_config_dmatx_valid_buf(dev);
force_cfg_update(dev);
mi_frame_end(stream);
hdr_update_dmatx_buf(dev);
}
stream->streaming = true;
return 0;
@@ -1317,7 +1281,7 @@ static int rkisp_queue_setup(struct vb2_queue *queue,
v4l2_dbg(1, rkisp_debug, &dev->v4l2_dev, "%s count %d, size %d\n",
v4l2_type_names[queue->type], *num_buffers, sizes[0]);
return rkisp_create_dummy_buf(stream);
return 0;
}
/*
@@ -1451,12 +1415,14 @@ static void rkisp_stop_streaming(struct vb2_queue *queue)
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
int ret;
mutex_lock(&dev->hw_dev->dev_lock);
v4l2_dbg(1, rkisp_debug, &dev->v4l2_dev,
"%s %d\n", __func__, stream->id);
if (stream->id != RKISP_STREAM_SP || stream->out_isp_fmt.fmt_type != FMT_FBCGAIN) {
if (!stream->streaming)
return;
goto end;
rkisp_stream_stop(stream);
}
@@ -1481,6 +1447,8 @@ static void rkisp_stop_streaming(struct vb2_queue *queue)
rkisp_destroy_dummy_buf(stream);
atomic_dec(&dev->cap_dev.refcnt);
stream->start_stream = false;
end:
mutex_unlock(&dev->hw_dev->dev_lock);
}
static int rkisp_stream_start(struct rkisp_stream *stream)
@@ -1530,12 +1498,16 @@ rkisp_start_streaming(struct vb2_queue *queue, unsigned int count)
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
int ret = -1;
mutex_lock(&dev->hw_dev->dev_lock);
v4l2_dbg(1, rkisp_debug, &dev->v4l2_dev,
"%s %d\n", __func__, stream->id);
if (stream->id != RKISP_STREAM_SP || stream->out_isp_fmt.fmt_type != FMT_FBCGAIN) {
if (WARN_ON(stream->streaming))
if (WARN_ON(stream->streaming)) {
mutex_unlock(&dev->hw_dev->dev_lock);
return -EBUSY;
}
}
memset(&stream->dbg, 0, sizeof(stream->dbg));
@@ -1571,6 +1543,10 @@ rkisp_start_streaming(struct vb2_queue *queue, unsigned int count)
stream->u.sp.field_rec = RKISP_FIELD_INVAL;
}
ret = rkisp_create_dummy_buf(stream);
if (ret < 0)
goto buffer_done;
/* enable clocks/power-domains */
ret = dev->pipe.open(&dev->pipe, &node->vdev.entity, true);
if (ret < 0) {
@@ -1604,6 +1580,8 @@ rkisp_start_streaming(struct vb2_queue *queue, unsigned int count)
}
stream->start_stream = true;
mutex_unlock(&dev->hw_dev->dev_lock);
return 0;
pipe_stream_off:
@@ -1618,6 +1596,7 @@ buffer_done:
destroy_buf_queue(stream, VB2_BUF_STATE_QUEUED);
atomic_dec(&dev->cap_dev.refcnt);
stream->streaming = false;
mutex_unlock(&dev->hw_dev->dev_lock);
return ret;
}
@@ -1642,7 +1621,7 @@ static int rkisp_init_vb2_queue(struct vb2_queue *q,
q->buf_struct_size = sizeof(struct rkisp_buffer);
q->min_buffers_needed = CIF_ISP_REQ_BUFS_MIN;
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
q->lock = &stream->ispdev->apilock;
q->lock = &stream->apilock;
q->dev = stream->ispdev->hw_dev->dev;
q->allow_cache_hints = 1;
q->bidirectional = 1;

View File

@@ -17,7 +17,6 @@
static int mi_frame_end(struct rkisp_stream *stream);
static void rkisp_buf_queue(struct vb2_buffer *vb);
static int rkisp_create_dummy_buf(struct rkisp_stream *stream);
static const struct capture_fmt dmatx_fmts[] = {
/* raw */
@@ -910,8 +909,10 @@ static int mi_frame_end(struct rkisp_stream *stream)
if (stream->id == RKISP_STREAM_MP || stream->id == RKISP_STREAM_SP)
stream->dbg.delay = ns - dev->isp_sdev.frm_timestamp;
if (is_rdbk_stream(stream) &&
dev->dmarx_dev.trigger == T_MANUAL) {
if (!stream->streaming) {
vb2_buffer_done(vb2_buf, VB2_BUF_STATE_ERROR);
} else if (is_rdbk_stream(stream) &&
dev->dmarx_dev.trigger == T_MANUAL) {
if (stream->id == RKISP_STREAM_DMATX0) {
if (cap->rdbk_buf[RDBK_L]) {
v4l2_err(&dev->v4l2_dev,
@@ -998,9 +999,12 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
if ((!dev->hw_dev->is_single && stream->id != RKISP_STREAM_MP &&
stream->id != RKISP_STREAM_SP) || dev->hw_dev->is_single)
stream->ops->stop_mi(stream);
if (atomic_read(&dev->cap_dev.refcnt) == 1)
if (stream->id == RKISP_STREAM_MP || stream->id == RKISP_STREAM_SP)
hdr_stop_dmatx(dev);
if (dev->isp_state & ISP_START) {
if (dev->isp_state & ISP_START &&
!stream->ops->is_stream_stopped(dev->base_addr)) {
ret = wait_event_timeout(stream->done,
!stream->streaming,
msecs_to_jiffies(500));
@@ -1052,29 +1056,11 @@ static int rkisp_start(struct rkisp_stream *stream)
return ret;
stream->ops->enable_mi(stream);
/* It's safe to config ACTIVE and SHADOW regs for the
* first stream. While when the second is starting, do NOT
* force_cfg_update() because it also update the first one.
*
* The latter case would drop one more buf(that is 2) since
* there's not buf in shadow when the second FE received. This's
* also required because the second FE maybe corrupt especially
* when run at 120fps.
*/
if (is_update) {
rkisp_stats_first_ddr_config(&dev->stats_vdev);
if (stream->id == RKISP_STREAM_MP || stream->id == RKISP_STREAM_SP)
hdr_config_dmatx(dev);
if (is_update)
dev->irq_ends_mask |=
(stream->id == RKISP_STREAM_MP) ? ISP_FRAME_MP : ISP_FRAME_SP;
}
mutex_lock(&dev->hw_dev->dev_lock);
if (!dev->hw_dev->is_mi_update && is_update) {
force_cfg_update(dev);
if (dev->hw_dev->is_single)
mi_frame_end(stream);
hdr_update_dmatx_buf(dev);
}
mutex_unlock(&dev->hw_dev->dev_lock);
stream->streaming = true;
return 0;
@@ -1113,7 +1099,7 @@ static int rkisp_queue_setup(struct vb2_queue *queue,
v4l2_dbg(1, rkisp_debug, &dev->v4l2_dev, "%s count %d, size %d\n",
v4l2_type_names[queue->type], *num_buffers, sizes[0]);
return rkisp_create_dummy_buf(stream);
return 0;
}
/*
@@ -1233,15 +1219,13 @@ static void rkisp_stop_streaming(struct vb2_queue *queue)
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
int ret;
mutex_lock(&dev->apilock);
mutex_lock(&dev->hw_dev->dev_lock);
v4l2_dbg(1, rkisp_debug, &dev->v4l2_dev,
"%s %d\n", __func__, stream->id);
if (!stream->streaming) {
mutex_unlock(&dev->apilock);
return;
}
if (!stream->streaming)
goto end;
rkisp_stream_stop(stream);
if (stream->id == RKISP_STREAM_MP ||
@@ -1263,7 +1247,8 @@ static void rkisp_stop_streaming(struct vb2_queue *queue)
rkisp_destroy_dummy_buf(stream);
atomic_dec(&dev->cap_dev.refcnt);
mutex_unlock(&dev->apilock);
end:
mutex_unlock(&dev->hw_dev->dev_lock);
}
static int rkisp_stream_start(struct rkisp_stream *stream)
@@ -1313,13 +1298,13 @@ rkisp_start_streaming(struct vb2_queue *queue, unsigned int count)
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
int ret = -1;
mutex_lock(&dev->apilock);
mutex_lock(&dev->hw_dev->dev_lock);
v4l2_dbg(1, rkisp_debug, &dev->v4l2_dev,
"%s %d\n", __func__, stream->id);
if (WARN_ON(stream->streaming)) {
mutex_unlock(&dev->apilock);
mutex_unlock(&dev->hw_dev->dev_lock);
return -EBUSY;
}
@@ -1355,6 +1340,10 @@ rkisp_start_streaming(struct vb2_queue *queue, unsigned int count)
stream->u.sp.field_rec = RKISP_FIELD_INVAL;
}
ret = rkisp_create_dummy_buf(stream);
if (ret < 0)
goto buffer_done;
/* enable clocks/power-domains */
ret = dev->pipe.open(&dev->pipe, &node->vdev.entity, true);
if (ret < 0) {
@@ -1384,7 +1373,7 @@ rkisp_start_streaming(struct vb2_queue *queue, unsigned int count)
}
}
mutex_unlock(&dev->apilock);
mutex_unlock(&dev->hw_dev->dev_lock);
return 0;
pipe_stream_off:
@@ -1399,7 +1388,7 @@ buffer_done:
destroy_buf_queue(stream, VB2_BUF_STATE_QUEUED);
atomic_dec(&dev->cap_dev.refcnt);
stream->streaming = false;
mutex_unlock(&dev->apilock);
mutex_unlock(&dev->hw_dev->dev_lock);
return ret;
}

View File

@@ -29,6 +29,8 @@ static inline int rkisp_register_stream_v20(struct rkisp_device *dev) { return 0
static inline void rkisp_unregister_stream_v20(struct rkisp_device *dev) {}
static inline void rkisp_mi_v20_isr(u32 mis_val, struct rkisp_device *dev) {}
static inline void rkisp_mipi_v20_isr(u32 phy, u32 packet, u32 overflow, u32 state, struct rkisp_device *dev) {}
static inline void rkisp_update_spstream_buf(struct rkisp_stream *stream) {}
#endif
#if IS_ENABLED(CONFIG_VIDEO_ROCKCHIP_ISP_VERSION_V21)

View File

@@ -272,7 +272,6 @@ int rkisp_alloc_common_dummy_buf(struct rkisp_device *dev)
u32 i, j, size = 0;
int ret = 0;
mutex_lock(&hw->dev_lock);
if (dummy_buf->mem_priv)
goto end;
@@ -306,7 +305,6 @@ int rkisp_alloc_common_dummy_buf(struct rkisp_device *dev)
end:
if (ret < 0)
v4l2_err(&dev->v4l2_dev, "%s failed:%d\n", __func__, ret);
mutex_unlock(&hw->dev_lock);
return ret;
}
@@ -314,15 +312,12 @@ void rkisp_free_common_dummy_buf(struct rkisp_device *dev)
{
struct rkisp_hw_dev *hw = dev->hw_dev;
mutex_lock(&hw->dev_lock);
if (atomic_read(&hw->refcnt) ||
atomic_read(&dev->cap_dev.refcnt) > 1)
goto end;
return;
if (hw->is_mmu)
rkisp_free_page_dummy_buf(dev);
else
rkisp_free_buffer(dev, &hw->dummy_buf);
end:
mutex_unlock(&hw->dev_lock);
}

View File

@@ -1420,7 +1420,7 @@ static void rkisp_start_3a_run(struct rkisp_device *dev)
struct v4l2_event ev = {
.type = CIFISP_V4L2_EVENT_STREAM_START,
};
int ret;
int ret = 1000;
if (!rkisp_is_need_3a(dev) || dev->isp_ver == ISP_V20 ||
!params_vdev->is_subs_evt)
@@ -1432,13 +1432,13 @@ static void rkisp_start_3a_run(struct rkisp_device *dev)
*/
ret = wait_event_timeout(dev->sync_onoff,
params_vdev->streamon && !params_vdev->first_params,
msecs_to_jiffies(1000));
msecs_to_jiffies(ret));
if (!ret)
v4l2_warn(&dev->v4l2_dev,
"waiting on params stream on event timeout\n");
else
v4l2_dbg(1, rkisp_debug, &dev->v4l2_dev,
"Waiting for 3A on use %d ms\n", 1000 - ret);
"Waiting for 3A on use %d ms\n", 1000 - jiffies_to_msecs(ret));
}
static void rkisp_stop_3a_run(struct rkisp_device *dev)
@@ -1448,7 +1448,7 @@ static void rkisp_stop_3a_run(struct rkisp_device *dev)
struct v4l2_event ev = {
.type = CIFISP_V4L2_EVENT_STREAM_STOP,
};
int ret;
int ret = 1000;
if (!rkisp_is_need_3a(dev) || dev->isp_ver == ISP_V20 ||
!params_vdev->is_subs_evt)
@@ -1456,13 +1456,13 @@ static void rkisp_stop_3a_run(struct rkisp_device *dev)
v4l2_event_queue(vdev, &ev);
ret = wait_event_timeout(dev->sync_onoff, !params_vdev->streamon,
msecs_to_jiffies(1000));
msecs_to_jiffies(ret));
if (!ret)
v4l2_warn(&dev->v4l2_dev,
"waiting on params stream off event timeout\n");
else
v4l2_dbg(1, rkisp_debug, &dev->v4l2_dev,
"Waiting for 3A off use %d ms\n", 1000 - ret);
"Waiting for 3A off use %d ms\n", 1000 - jiffies_to_msecs(ret));
}
/* Mess register operations to stop isp */
@@ -2216,6 +2216,33 @@ static void rkisp_isp_read_add_fifo_data(struct rkisp_device *dev)
dev->emd_data_fifo[idx].frame_id);
}
static void rkisp_global_update_mi(struct rkisp_device *dev)
{
struct rkisp_stream *stream;
int i;
if (dev->hw_dev->is_mi_update)
return;
rkisp_stats_first_ddr_config(&dev->stats_vdev);
rkisp_config_dmatx_valid_buf(dev);
force_cfg_update(dev);
hdr_update_dmatx_buf(dev);
if (dev->br_dev.en && dev->isp_ver == ISP_V20) {
stream = &dev->cap_dev.stream[RKISP_STREAM_SP];
rkisp_update_spstream_buf(stream);
}
if (dev->hw_dev->is_single) {
for (i = 0; i < RKISP_MAX_STREAM; i++) {
stream = &dev->cap_dev.stream[i];
if (stream->streaming && !stream->next_buf)
stream->ops->frame_end(stream);
}
}
}
static int rkisp_isp_sd_s_stream(struct v4l2_subdev *sd, int on)
{
struct rkisp_device *isp_dev = sd_to_isp_dev(sd);
@@ -2226,22 +2253,19 @@ static int rkisp_isp_sd_s_stream(struct v4l2_subdev *sd, int on)
isp_dev->irq_ends_mask == (ISP_FRAME_END | ISP_FRAME_IN) &&
(!IS_HDR_RDBK(isp_dev->rd_mode) ||
isp_dev->isp_state & ISP_STOP), msecs_to_jiffies(5));
mutex_lock(&isp_dev->hw_dev->dev_lock);
rkisp_isp_stop(isp_dev);
atomic_dec(&isp_dev->hw_dev->refcnt);
mutex_unlock(&isp_dev->hw_dev->dev_lock);
rkisp_params_stream_stop(&isp_dev->params_vdev);
return 0;
}
rkisp_start_3a_run(isp_dev);
memset(&isp_dev->isp_sdev.dbg, 0, sizeof(isp_dev->isp_sdev.dbg));
mutex_lock(&isp_dev->hw_dev->dev_lock);
atomic_inc(&isp_dev->hw_dev->refcnt);
atomic_set(&isp_dev->isp_sdev.frm_sync_seq, 0);
rkisp_global_update_mi(isp_dev);
rkisp_config_cif(isp_dev);
rkisp_isp_start(isp_dev);
mutex_unlock(&isp_dev->hw_dev->dev_lock);
rkisp_rdbk_trigger_event(isp_dev, T_CMD_QUEUE, NULL);
return 0;
}