media: rockchip: vpss: limit vpss start first if online

Change-Id: I71acdf32ff4c2af9592320d38bd28ea53d8cd95f
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
Cai YiWei
2025-05-20 10:42:29 +08:00
parent 412920a441
commit 635bb96ec0
3 changed files with 16 additions and 3 deletions

View File

@@ -78,9 +78,20 @@ void rkvpss_pipeline_default_fmt(struct rkvpss_device *dev)
int rkvpss_pipeline_open(struct rkvpss_device *dev)
{
int isp_working = 0;
if (atomic_inc_return(&dev->pipe_power_cnt) > 1)
return 0;
if (!atomic_read(&dev->hw_dev->refcnt)) {
v4l2_subdev_call(dev->remote_sd, core, ioctl,
RKISP_VPSS_GET_ISP_WORKING, &isp_working);
if (isp_working) {
atomic_dec(&dev->pipe_power_cnt);
v4l2_err(&dev->v4l2_dev,
"no support isp working then vpss start, make sure vpss stream on first\n");
return -EINVAL;
}
}
return 0;
}

View File

@@ -1871,7 +1871,8 @@ static int rkvpss_start_streaming(struct vb2_queue *queue, unsigned int count)
goto free_buf_queue;
}
rkvpss_pipeline_open(dev);
if (rkvpss_pipeline_open(dev) < 0)
goto free_buf_queue;
ret = rkvpss_stream_start(stream);
if (ret < 0) {

View File

@@ -2094,7 +2094,8 @@ static int rkvpss_start_streaming(struct vb2_queue *queue, unsigned int count)
goto free_buf_queue;
}
rkvpss_pipeline_open(dev);
if (rkvpss_pipeline_open(dev) < 0)
goto free_buf_queue;
ret = rkvpss_stream_start(stream);
if (ret < 0) {