summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorAdrian Salido-Moreno <adrianm@codeaurora.org>2014-01-27 10:45:18 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:26:05 -0700
commit23797594f70a0870bbafbef37b6d2bbd61d0a20e (patch)
treeff713d5e347845b320da7a5fb4586888be1dd598 /drivers/video/fbdev
parent64e2503ef17d9c18f63784463e5da130657d6bae (diff)
msm: mdss: optimize MDP pipes cleanup
There are cases where pipe cleanup can happen without display commit. This means that the pipe was never programmed to hardware, in these cases the pipe can be cleaned up without the need of display commit cycle to happen. Also there is no need to access hardware to release resources such as SMPs since they have not been programmed yet. Change-Id: I57a46471dc1fba4e45e55c3543940ba4fba0540a Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org> Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_overlay.c12
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_pipe.c15
2 files changed, 19 insertions, 8 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
index c376abcf8637..7ea128f72569 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c
@@ -1103,7 +1103,7 @@ static int mdss_mdp_overlay_release(struct msm_fb_data_type *mfd, int ndx)
struct mdss_mdp_pipe *pipe;
struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd);
u32 pipe_ndx, unset_ndx = 0;
- int i;
+ int i, destroy_pipe;
for (i = 0; unset_ndx != ndx && i < MDSS_MDP_MAX_SSPP; i++) {
pipe_ndx = BIT(i);
@@ -1114,16 +1114,22 @@ static int mdss_mdp_overlay_release(struct msm_fb_data_type *mfd, int ndx)
pr_warn("unknown pipe ndx=%x\n", pipe_ndx);
continue;
}
+
mutex_lock(&mfd->lock);
pipe->pid = 0;
+ destroy_pipe = pipe->play_cnt == 0;
+
if (!list_empty(&pipe->used_list)) {
list_del_init(&pipe->used_list);
- list_add(&pipe->cleanup_list,
- &mdp5_data->pipes_cleanup);
+ if (!destroy_pipe)
+ list_add(&pipe->cleanup_list,
+ &mdp5_data->pipes_cleanup);
}
mutex_unlock(&mfd->lock);
mdss_mdp_mixer_pipe_unstage(pipe);
mdss_mdp_pipe_unmap(pipe);
+ if (destroy_pipe)
+ mdss_mdp_pipe_destroy(pipe);
}
}
return 0;
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
index 9af998fbcbe4..e51f0960c4d7 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
@@ -680,16 +680,20 @@ static int mdss_mdp_pipe_free(struct mdss_mdp_pipe *pipe)
pr_debug("ndx=%x pnum=%d ref_cnt=%d\n", pipe->ndx, pipe->num,
atomic_read(&pipe->ref_cnt));
- mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON, false);
- mdss_mdp_pipe_sspp_term(pipe);
- mdss_mdp_smp_free(pipe);
+ if (pipe->play_cnt) {
+ mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_ON, false);
+ mdss_mdp_pipe_sspp_term(pipe);
+ mdss_mdp_smp_free(pipe);
+ mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
+ } else {
+ mdss_mdp_smp_unreserve(pipe);
+ }
+
pipe->flags = 0;
pipe->bwc_mode = 0;
pipe->mfd = NULL;
memset(&pipe->scale, 0, sizeof(struct mdp_scale_data));
- mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
-
return 0;
}
@@ -823,6 +827,7 @@ int mdss_mdp_pipe_handoff(struct mdss_mdp_pipe *pipe)
pipe->src_fmt->bpp);
pipe->is_handed_off = true;
+ pipe->play_cnt = 1;
atomic_inc(&pipe->ref_cnt);
error: