mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user