diff options
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_overlay.c | 1 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_pp.c | 37 |
2 files changed, 29 insertions, 9 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c index c69ca87fd3d0..e1cf9fe14fc0 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c +++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c @@ -1818,6 +1818,7 @@ static void mdss_mdp_overlay_pan_display(struct msm_fb_data_type *mfd, if (is_mdss_iommu_attached()) { if (!mfd->iova) { pr_err("mfd iova is zero\n"); + mdss_mdp_pipe_unmap(pipe); goto attach_err; } buf->p[0].addr = mfd->iova; diff --git a/drivers/video/fbdev/msm/mdss_mdp_pp.c b/drivers/video/fbdev/msm/mdss_mdp_pp.c index b46b7f672779..0e0970cdb1e9 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pp.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pp.c @@ -3252,9 +3252,10 @@ int mdss_mdp_hist_start(struct mdp_histogram_start_req *req) pipe = mdss_mdp_pipe_get(mdata, BIT(i)); if (IS_ERR_OR_NULL(pipe)) continue; - if (!pipe || pipe->num > MDSS_MDP_SSPP_VIG2) { + if (pipe->num > MDSS_MDP_SSPP_VIG2) { ret = -EINVAL; pr_warn("Invalid Hist pipe (%d)", i); + mdss_mdp_pipe_unmap(pipe); goto hist_stop_clk; } hist_info = &pipe->pp_res.hist; @@ -3353,8 +3354,11 @@ int mdss_mdp_hist_stop(u32 block) if (!PP_ARG(i, block)) continue; pipe = mdss_mdp_pipe_get(mdata, BIT(i)); - if (IS_ERR_OR_NULL(pipe) || - pipe->num > MDSS_MDP_SSPP_VIG2) { + if (IS_ERR_OR_NULL(pipe)) { + pr_warn("Invalid Hist pipe (%d)", i); + continue; + } else if (pipe->num > MDSS_MDP_SSPP_VIG2) { + mdss_mdp_pipe_unmap(pipe); pr_warn("Invalid Hist pipe (%d)", i); continue; } @@ -3764,8 +3768,11 @@ int mdss_mdp_hist_collect(struct mdp_histogram_data *hist) continue; pipe_cnt++; pipe = mdss_mdp_pipe_get(mdata, BIT(i)); - if (IS_ERR_OR_NULL(pipe) || - pipe->num > MDSS_MDP_SSPP_VIG2) { + if (IS_ERR_OR_NULL(pipe)) { + pr_warn("Invalid Hist pipe (%d)", i); + continue; + } else if (pipe->num > MDSS_MDP_SSPP_VIG2) { + mdss_mdp_pipe_unmap(pipe); pr_warn("Invalid Hist pipe (%d)", i); continue; } @@ -3773,14 +3780,18 @@ int mdss_mdp_hist_collect(struct mdp_histogram_data *hist) spin_lock_irqsave(&hist_info->hist_lock, flag); hist_info->read_request = 1; spin_unlock_irqrestore(&hist_info->hist_lock, flag); + mdss_mdp_pipe_unmap(pipe); } for (i = pipe_num; i < MDSS_PP_ARG_NUM; i++) { if (!PP_ARG(i, hist->block)) continue; pipe_cnt++; pipe = mdss_mdp_pipe_get(mdata, BIT(i)); - if (IS_ERR_OR_NULL(pipe) || - pipe->num > MDSS_MDP_SSPP_VIG2) { + if (IS_ERR_OR_NULL(pipe)) { + pr_warn("Invalid Hist pipe (%d)", i); + continue; + } else if (pipe->num > MDSS_MDP_SSPP_VIG2) { + mdss_mdp_pipe_unmap(pipe); pr_warn("Invalid Hist pipe (%d)", i); continue; } @@ -3802,8 +3813,11 @@ int mdss_mdp_hist_collect(struct mdp_histogram_data *hist) continue; pipe_cnt++; pipe = mdss_mdp_pipe_get(mdata, BIT(i)); - if (IS_ERR_OR_NULL(pipe) || - pipe->num > MDSS_MDP_SSPP_VIG2) { + if (IS_ERR_OR_NULL(pipe)) { + pr_warn("Invalid Hist pipe (%d)", i); + continue; + } else if (pipe->num > MDSS_MDP_SSPP_VIG2) { + mdss_mdp_pipe_unmap(pipe); pr_warn("Invalid Hist pipe (%d)", i); continue; } @@ -3812,6 +3826,7 @@ int mdss_mdp_hist_collect(struct mdp_histogram_data *hist) hist_info->read_request = 0; INIT_COMPLETION(hist_info->comp); spin_unlock_irqrestore(&hist_info->hist_lock, flag); + mdss_mdp_pipe_unmap(pipe); } if (ret || temp_ret) { ret = ret ? ret : temp_ret; @@ -3837,6 +3852,10 @@ int mdss_mdp_hist_collect(struct mdp_histogram_data *hist) if (!PP_ARG(i, hist->block)) continue; pipe = mdss_mdp_pipe_get(mdata, BIT(i)); + if (IS_ERR_OR_NULL(pipe)) { + pr_warn("Invalid Hist pipe (%d)", i); + continue; + } hist_info = &pipe->pp_res.hist; off = HIST_V_SIZE * i; mutex_lock(&hist_info->hist_mutex); |
