summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Philip <jphili@codeaurora.org>2014-06-03 16:03:24 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:30:36 -0700
commit0ffbb1fe5c283fb53d1486b1035f0cd8036e2d5b (patch)
treee91198742cc3d8e5e129a88763048601ada2198f
parent2bda05c8b03aab41bdb41418fbe8917e663fcb3d (diff)
msm: mdss: Allow smp change during composition switch
The composition fallback mechanism might not ensure unsetting of the pipe whose prepare call failed due to smp configuration change, typically in the cases where change in composition requests same pipe. This scenario is a deadlock where composition switch does not happen, due to these pipe failures. To handle such cases, for changed SMP request for a pipe doing non backend composition, allow smp configuration to happen, so that the composition could be successfully switched, thereby preventing the deadlock. Change-Id: I2d29ac6591671494abc7c4caf7c6c53f058d12f6 Signed-off-by: Justin Philip <jphili@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_pipe.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
index 71fa29a4d1ae..b2bb6a2f47e6 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c
@@ -75,7 +75,7 @@ end:
}
static u32 mdss_mdp_smp_mmb_reserve(struct mdss_mdp_pipe_smp_map *smp_map,
- size_t n)
+ size_t n, bool force_alloc)
{
u32 i, mmb;
u32 fixed_cnt = bitmap_weight(smp_map->fixed, SMP_MB_CNT);
@@ -93,7 +93,7 @@ static u32 mdss_mdp_smp_mmb_reserve(struct mdss_mdp_pipe_smp_map *smp_map,
* that calls for change in smp configuration (addition/removal
* of smp blocks), so that fallback solution happens.
*/
- if (i != 0 && n != i) {
+ if (i != 0 && n != i && !force_alloc) {
pr_debug("Can't change mmb config, num_blks: %zu alloc: %d\n",
n, i);
return 0;
@@ -256,6 +256,7 @@ int mdss_mdp_smp_reserve(struct mdss_mdp_pipe *pipe)
struct mdss_mdp_plane_sizes ps;
int i;
int rc = 0, rot_mode = 0, wb_mixer = 0;
+ bool force_alloc = 0;
u32 nlines, format, seg_w;
u16 width;
@@ -342,6 +343,13 @@ int mdss_mdp_smp_reserve(struct mdss_mdp_pipe *pipe)
if (pipe->mixer_left->type == MDSS_MDP_MIXER_TYPE_WRITEBACK)
wb_mixer = 1;
+ /*
+ * Don't want to allow SMP changes for backend composition pipes
+ * inorder to preserve SMPs as much as possible.
+ * On the contrary for non backend composition pipes we should
+ * allow SMP allocations to prevent composition failures.
+ */
+ force_alloc = !(pipe->flags & MDP_BACKEND_COMPOSITION);
mutex_lock(&mdss_mdp_smp_lock);
for (i = (MAX_PLANES - 1); i >= ps.num_planes; i--) {
if (bitmap_weight(pipe->smp_map[i].allocated, SMP_MB_CNT)) {
@@ -371,7 +379,7 @@ int mdss_mdp_smp_reserve(struct mdss_mdp_pipe *pipe)
pr_debug("reserving %d mmb for pnum=%d plane=%d\n",
num_blks, pipe->num, i);
reserved = mdss_mdp_smp_mmb_reserve(&pipe->smp_map[i],
- num_blks);
+ num_blks, force_alloc);
if (reserved < num_blks)
break;
}