diff options
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/isp/msm_isp.h | 1 | ||||
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c | 30 |
2 files changed, 27 insertions, 4 deletions
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp.h b/drivers/media/platform/msm/camera_v2/isp/msm_isp.h index 139a4c9b49ee..a334f080b186 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp.h +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp.h @@ -497,6 +497,7 @@ struct msm_vfe_src_info { enum msm_vfe_dual_hw_type dual_hw_type; struct msm_vfe_dual_hw_ms_info dual_hw_ms_info; bool accept_frame; + uint32_t lpm; }; struct msm_vfe_fetch_engine_info { diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c index ebd3a32281d7..dce474e40470 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c @@ -2421,6 +2421,7 @@ int msm_isp_ab_ib_update_lpm_mode(struct vfe_device *vfe_dev, void *arg) int i, rc = 0; uint64_t total_bandwidth = 0; int vfe_idx; + uint32_t intf; unsigned long flags; struct msm_vfe_axi_stream *stream_info; struct msm_vfe_dual_lpm_mode *ab_ib_vote = NULL; @@ -2436,7 +2437,13 @@ int msm_isp_ab_ib_update_lpm_mode(struct vfe_device *vfe_dev, void *arg) stream_info = msm_isp_get_stream_common_data(vfe_dev, ab_ib_vote->stream_src[i]); + if (stream_info == NULL) + continue; + /* loop all stream on current session */ spin_lock_irqsave(&stream_info->lock, flags); + intf = SRC_TO_INTF(stream_info->stream_src); + vfe_dev->axi_data.src_info[intf].lpm = + ab_ib_vote->lpm_mode; if (stream_info->state == ACTIVE) { vfe_idx = msm_isp_get_vfe_idx_for_stream(vfe_dev, @@ -2457,7 +2464,12 @@ int msm_isp_ab_ib_update_lpm_mode(struct vfe_device *vfe_dev, void *arg) stream_info = msm_isp_get_stream_common_data(vfe_dev, ab_ib_vote->stream_src[i]); + if (stream_info == NULL) + continue; spin_lock_irqsave(&stream_info->lock, flags); + intf = SRC_TO_INTF(stream_info->stream_src); + vfe_dev->axi_data.src_info[intf].lpm = + ab_ib_vote->lpm_mode; if (stream_info->state == PAUSED) { vfe_idx = msm_isp_get_vfe_idx_for_stream(vfe_dev, @@ -2883,7 +2895,9 @@ static void __msm_isp_stop_axi_streams(struct vfe_device *vfe_dev, * those state transitions instead of directly forcing stream to * be INACTIVE */ - if (stream_info->state != PAUSED) { + intf = SRC_TO_INTF(stream_info->stream_src); + if ((!vfe_dev->axi_data.src_info[intf].lpm) || + stream_info->state != PAUSED) { while (stream_info->state != ACTIVE) __msm_isp_axi_stream_update(stream_info, ×tamp); @@ -2900,10 +2914,12 @@ static void __msm_isp_stop_axi_streams(struct vfe_device *vfe_dev, vfe_dev->hw_info->vfe_ops.axi_ops. clear_wm_irq_mask(vfe_dev, stream_info); } - if (stream_info->state == ACTIVE) { + if (stream_info->state == ACTIVE && + !vfe_dev->axi_data.src_info[intf].lpm) { init_completion(&stream_info->inactive_comp); stream_info->state = STOP_PENDING; - } else if (stream_info->state == PAUSED) { + } else if (vfe_dev->axi_data.src_info[intf].lpm || + stream_info->state == PAUSED) { /* don't wait for reg update */ stream_info->state = STOP_PENDING; msm_isp_axi_stream_enable_cfg(stream_info); @@ -3018,6 +3034,7 @@ static int msm_isp_start_axi_stream(struct vfe_device *vfe_dev_ioctl, int k; struct vfe_device *vfe_dev; struct msm_vfe_axi_shared_data *axi_data = &vfe_dev_ioctl->axi_data; + uint32_t intf; if (stream_cfg_cmd->num_streams > MAX_NUM_STREAM) return -EINVAL; @@ -3081,7 +3098,7 @@ static int msm_isp_start_axi_stream(struct vfe_device *vfe_dev_ioctl, cfg_wm_irq_mask(vfe_dev, stream_info); } } - + intf = SRC_TO_INTF(stream_info->stream_src); init_completion(&stream_info->active_comp); stream_info->state = START_PENDING; msm_isp_update_intf_stream_cnt(stream_info, 1); @@ -3091,6 +3108,11 @@ static int msm_isp_start_axi_stream(struct vfe_device *vfe_dev_ioctl, vfe_dev_ioctl->pdev->id); if (src_state) { src_mask |= (1 << SRC_TO_INTF(stream_info->stream_src)); + if (vfe_dev_ioctl->axi_data.src_info[intf].lpm) { + while (stream_info->state != ACTIVE) + __msm_isp_axi_stream_update( + stream_info, ×tamp); + } } else { for (k = 0; k < stream_info->num_isp; k++) { vfe_dev = stream_info->vfe_dev[k]; |
