mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
media: rockchip: isp: stop without waiting if isp idle for readback mode
Change-Id: Iba8f4f16a270deb209c022f9cbbf192496388288 Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -1329,6 +1329,7 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
|
|||||||
{
|
{
|
||||||
struct rkisp_device *dev = stream->ispdev;
|
struct rkisp_device *dev = stream->ispdev;
|
||||||
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
|
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
|
||||||
|
unsigned long lock_flags = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!dev->dmarx_dev.trigger &&
|
if (!dev->dmarx_dev.trigger &&
|
||||||
@@ -1342,9 +1343,15 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
|
|||||||
stream->id != RKISP_STREAM_SP) || dev->hw_dev->is_single)
|
stream->id != RKISP_STREAM_SP) || dev->hw_dev->is_single)
|
||||||
stream->ops->stop_mi(stream);
|
stream->ops->stop_mi(stream);
|
||||||
|
|
||||||
if (stream->id == RKISP_STREAM_MP || stream->id == RKISP_STREAM_SP)
|
if (stream->id == RKISP_STREAM_MP || stream->id == RKISP_STREAM_SP) {
|
||||||
hdr_stop_dmatx(dev);
|
hdr_stop_dmatx(dev);
|
||||||
|
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)
|
||||||
|
dev->isp_state = ISP_STOP;
|
||||||
|
spin_unlock_irqrestore(&dev->hw_dev->rdbk_lock, lock_flags);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (dev->isp_state & ISP_START &&
|
if (dev->isp_state & ISP_START &&
|
||||||
!stream->ops->is_stream_stopped(stream)) {
|
!stream->ops->is_stream_stopped(stream)) {
|
||||||
ret = wait_event_timeout(stream->done,
|
ret = wait_event_timeout(stream->done,
|
||||||
|
|||||||
@@ -964,11 +964,18 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
|
|||||||
{
|
{
|
||||||
struct rkisp_device *dev = stream->ispdev;
|
struct rkisp_device *dev = stream->ispdev;
|
||||||
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
|
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
|
||||||
|
unsigned long lock_flags = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
stream->stopping = true;
|
stream->stopping = true;
|
||||||
if (dev->hw_dev->is_single)
|
if (dev->hw_dev->is_single)
|
||||||
stream->ops->disable_mi(stream);
|
stream->ops->disable_mi(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)
|
||||||
|
dev->isp_state = ISP_STOP;
|
||||||
|
spin_unlock_irqrestore(&dev->hw_dev->rdbk_lock, lock_flags);
|
||||||
|
}
|
||||||
if (dev->isp_state & ISP_START &&
|
if (dev->isp_state & ISP_START &&
|
||||||
!stream->ops->is_stream_stopped(stream)) {
|
!stream->ops->is_stream_stopped(stream)) {
|
||||||
ret = wait_event_timeout(stream->done,
|
ret = wait_event_timeout(stream->done,
|
||||||
|
|||||||
@@ -1297,12 +1297,19 @@ static void rkisp_stream_stop(struct rkisp_stream *stream)
|
|||||||
{
|
{
|
||||||
struct rkisp_device *dev = stream->ispdev;
|
struct rkisp_device *dev = stream->ispdev;
|
||||||
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
|
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
|
||||||
|
unsigned long lock_flags = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
stream->stopping = true;
|
stream->stopping = true;
|
||||||
stream->is_pause = false;
|
stream->is_pause = false;
|
||||||
if (dev->hw_dev->is_single && stream->ops->disable_mi)
|
if (dev->hw_dev->is_single && stream->ops->disable_mi)
|
||||||
stream->ops->disable_mi(stream);
|
stream->ops->disable_mi(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)
|
||||||
|
dev->isp_state = ISP_STOP;
|
||||||
|
spin_unlock_irqrestore(&dev->hw_dev->rdbk_lock, lock_flags);
|
||||||
|
}
|
||||||
if (dev->isp_state & ISP_START &&
|
if (dev->isp_state & ISP_START &&
|
||||||
!stream->ops->is_stream_stopped(stream)) {
|
!stream->ops->is_stream_stopped(stream)) {
|
||||||
ret = wait_event_timeout(stream->done,
|
ret = wait_event_timeout(stream->done,
|
||||||
|
|||||||
Reference in New Issue
Block a user