summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorAdrian Salido-Moreno <adrianm@codeaurora.org>2014-04-15 19:04:51 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:29:09 -0700
commitbc6c77aef2f4e900b01c8383055065fcb1a983dd (patch)
tree88616a267c38fc3e6ebab313db0cd22dfcaf9fbc /drivers/video/fbdev
parent17f419e70900f74d37780f2e0343bd45afea1476 (diff)
msm: mdss: add proper pipe unmap calls for pipe references
For every pipe get/map call there needs to be a related unmap call. These are missing in some cases. Change-Id: I85f8897be6d34ef217102ef922a48afb6e6cc838 Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_overlay.c1
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_pp.c37
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);