mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
media: rockchip: isp: fix stream off just close isp
Fixes: 39c3a52c25 ("media: rockchip: isp: stop without waiting if isp idle for readback mode")
Change-Id: I80446449bf705819b0266e6a0cbdc9e2ee67b57e
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -1331,6 +1331,7 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
|
||||
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
|
||||
unsigned long lock_flags = 0;
|
||||
int ret = 0;
|
||||
bool is_wait = true;
|
||||
|
||||
if (!dev->dmarx_dev.trigger &&
|
||||
(is_rdbk_stream(stream) || is_hdr_stream(stream))) {
|
||||
@@ -1348,12 +1349,13 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
|
||||
if (IS_HDR_RDBK(dev->rd_mode)) {
|
||||
spin_lock_irqsave(&dev->hw_dev->rdbk_lock, lock_flags);
|
||||
if (dev->hw_dev->cur_dev_id != dev->dev_id || dev->hw_dev->is_idle)
|
||||
is_wait = false;
|
||||
if (atomic_read(&dev->cap_dev.refcnt) == 1 && !is_wait)
|
||||
dev->isp_state = ISP_STOP;
|
||||
spin_unlock_irqrestore(&dev->hw_dev->rdbk_lock, lock_flags);
|
||||
}
|
||||
}
|
||||
if (dev->isp_state & ISP_START &&
|
||||
!stream->ops->is_stream_stopped(stream)) {
|
||||
if (is_wait && !stream->ops->is_stream_stopped(stream)) {
|
||||
ret = wait_event_timeout(stream->done,
|
||||
!stream->streaming,
|
||||
msecs_to_jiffies(500));
|
||||
|
||||
@@ -966,6 +966,7 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
|
||||
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
|
||||
unsigned long lock_flags = 0;
|
||||
int ret = 0;
|
||||
bool is_wait = true;
|
||||
|
||||
stream->stopping = true;
|
||||
if (dev->hw_dev->is_single)
|
||||
@@ -973,11 +974,12 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
|
||||
if (IS_HDR_RDBK(dev->rd_mode)) {
|
||||
spin_lock_irqsave(&dev->hw_dev->rdbk_lock, lock_flags);
|
||||
if (dev->hw_dev->cur_dev_id != dev->dev_id || dev->hw_dev->is_idle)
|
||||
is_wait = false;
|
||||
if (atomic_read(&dev->cap_dev.refcnt) == 1 && !is_wait)
|
||||
dev->isp_state = ISP_STOP;
|
||||
spin_unlock_irqrestore(&dev->hw_dev->rdbk_lock, lock_flags);
|
||||
}
|
||||
if (dev->isp_state & ISP_START &&
|
||||
!stream->ops->is_stream_stopped(stream)) {
|
||||
if (is_wait && !stream->ops->is_stream_stopped(stream)) {
|
||||
ret = wait_event_timeout(stream->done,
|
||||
!stream->streaming,
|
||||
msecs_to_jiffies(500));
|
||||
|
||||
@@ -1299,6 +1299,7 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
|
||||
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
|
||||
unsigned long lock_flags = 0;
|
||||
int ret = 0;
|
||||
bool is_wait = true;
|
||||
|
||||
stream->stopping = true;
|
||||
stream->is_pause = false;
|
||||
@@ -1307,11 +1308,12 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
|
||||
if (IS_HDR_RDBK(dev->rd_mode)) {
|
||||
spin_lock_irqsave(&dev->hw_dev->rdbk_lock, lock_flags);
|
||||
if (dev->hw_dev->cur_dev_id != dev->dev_id || dev->hw_dev->is_idle)
|
||||
is_wait = false;
|
||||
if (atomic_read(&dev->cap_dev.refcnt) == 1 && !is_wait)
|
||||
dev->isp_state = ISP_STOP;
|
||||
spin_unlock_irqrestore(&dev->hw_dev->rdbk_lock, lock_flags);
|
||||
}
|
||||
if (dev->isp_state & ISP_START &&
|
||||
!stream->ops->is_stream_stopped(stream)) {
|
||||
if (is_wait && !stream->ops->is_stream_stopped(stream)) {
|
||||
ret = wait_event_timeout(stream->done,
|
||||
!stream->streaming,
|
||||
msecs_to_jiffies(500));
|
||||
|
||||
Reference in New Issue
Block a user