From cbd31a3ca65a70609e49d697ff05d538d25840d6 Mon Sep 17 00:00:00 2001 From: Ujwal Patel Date: Tue, 23 Sep 2014 17:12:41 -0700 Subject: [PATCH] msm: mdss: allow extra SMPs during pipe reuse on high tier targets There are use-cases where pipe is reused with a lower resolution than previous one. In such cases, it is possible that SMP requirement is lower than before. Current implementation will reject pipe configuration where any SMP change is requested. This may lead to GPU fall-back option and eventually consume more power. But on high end targets we have enough number of SMPs available for use such that we can still allow the use-case and not run out of SMPs to use. Based on this knowledge, change the logic to allow extra SMPs during pipe reuse. Change-Id: Icad5ca284a6b5ec1810d65bb1755d2f9572db7f0 Signed-off-by: Ujwal Patel --- drivers/video/fbdev/msm/mdss_mdp_pipe.c | 31 +++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) 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();