diff --git a/drivers/video/fbdev/msm/mdss_mdp_pipe.c b/drivers/video/fbdev/msm/mdss_mdp_pipe.c index 22b9a2b6a242..a80f206452aa 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pipe.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pipe.c @@ -119,6 +119,20 @@ static void mdss_mdp_pipe_nrt_vbif_setup(struct mdss_data_type *mdata, return; } +static inline bool is_unused_smp_allowed(void) +{ + struct mdss_data_type *mdata = mdss_mdp_get_mdata(); + + switch (MDSS_GET_MAJOR_MINOR(mdata->mdp_rev)) { + case MDSS_GET_MAJOR_MINOR(MDSS_MDP_HW_REV_103): + case MDSS_GET_MAJOR_MINOR(MDSS_MDP_HW_REV_105): + case MDSS_GET_MAJOR_MINOR(MDSS_MDP_HW_REV_109): + return true; + default: + return false; + } +} + static u32 mdss_mdp_smp_mmb_reserve(struct mdss_mdp_pipe_smp_map *smp_map, size_t n, bool force_alloc) { @@ -138,7 +152,8 @@ 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 && !force_alloc) { + if (i != 0 && !force_alloc && + (((n < i) && !is_unused_smp_allowed()) || (n > i))) { pr_debug("Can't change mmb config, num_blks: %zu alloc: %d\n", n, i); return 0; @@ -485,20 +500,6 @@ static u32 mdss_mdp_calc_per_plane_num_blks(u32 ystride, return num_blks; } -static inline bool is_unused_smp_allowed(void) -{ - struct mdss_data_type *mdata = mdss_mdp_get_mdata(); - - switch (MDSS_GET_MAJOR_MINOR(mdata->mdp_rev)) { - case MDSS_GET_MAJOR_MINOR(MDSS_MDP_HW_REV_103): - case MDSS_GET_MAJOR_MINOR(MDSS_MDP_HW_REV_105): - case MDSS_GET_MAJOR_MINOR(MDSS_MDP_HW_REV_109): - return true; - default: - return false; - } -} - int mdss_mdp_smp_reserve(struct mdss_mdp_pipe *pipe) { struct mdss_data_type *mdata = mdss_mdp_get_mdata();