diff options
| author | Jayant Shekhar <jshekhar@codeaurora.org> | 2015-09-23 12:06:50 +0530 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:12:14 -0700 |
| commit | 27dabc15e9262b1fb6d1771fd86251eae8efc278 (patch) | |
| tree | 8091701ba159ecea251593ab3c2fb78965c9374e /drivers/video/fbdev | |
| parent | ccaec924ed344c62c5ec4370c8872849928b9fa8 (diff) | |
msm: mdss: Generalize per pipe bw limit implementation
Currently per pipe bandwidth limit implementation takes
care of only HFLip and VFLip case. Make it generic such
that it takes care of Camera usecase as well.
Change-Id: I6642bdb0611aa973a7563df019bf2dcdd5e4e584
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_ctl.c | 60 |
1 files changed, 23 insertions, 37 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c index 7435166dbfcb..54fbcd697b29 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c +++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c @@ -1475,29 +1475,20 @@ int mdss_mdp_perf_bw_check(struct mdss_mdp_ctl *ctl, return 0; } -static u32 mdss_mdp_get_bw_by_mode(struct mdss_max_bw_settings *settings, - int count, int key) -{ - u32 value = 0, i = 0; - - while (i < count) { - if (settings[i].mdss_max_bw_mode == key) { - value = settings[i].mdss_max_bw_val; - break; - } - ++i; - } - return value; -} - static u32 mdss_mdp_get_max_pipe_bw(struct mdss_mdp_pipe *pipe) { - struct mdss_data_type *mdata = pipe->mixer_left->ctl->mdata; struct mdss_mdp_ctl *ctl = pipe->mixer_left->ctl; + struct mdss_max_bw_settings *max_per_pipe_bw_settings; u32 flags = 0, threshold = 0, panel_orientation; + u32 i, max = INT_MAX; + + if (!ctl->mdata->mdss_per_pipe_bw_cnt + && !ctl->mdata->max_per_pipe_bw_settings) + return 0; panel_orientation = ctl->mfd->panel_orientation; + max_per_pipe_bw_settings = ctl->mdata->max_per_pipe_bw_settings; /* Check for panel orienatation */ panel_orientation = ctl->mfd->panel_orientation; @@ -1512,22 +1503,17 @@ static u32 mdss_mdp_get_max_pipe_bw(struct mdss_mdp_pipe *pipe) if (pipe->flags & MDP_FLIP_UD) flags |= MDSS_MAX_BW_LIMIT_VFLIP; - if ((flags & MDSS_MAX_BW_LIMIT_HFLIP) && - (flags & MDSS_MAX_BW_LIMIT_VFLIP)) { - threshold = mdata->min_bw_per_pipe; - } else if (flags & MDSS_MAX_BW_LIMIT_HFLIP) { - threshold = mdss_mdp_get_bw_by_mode( - mdata->max_per_pipe_bw_settings, - mdata->mdss_per_pipe_bw_cnt, - MDSS_MAX_BW_LIMIT_HFLIP); - } else if (flags & MDSS_MAX_BW_LIMIT_VFLIP) { - threshold = mdss_mdp_get_bw_by_mode( - mdata->max_per_pipe_bw_settings, - mdata->mdss_per_pipe_bw_cnt, - MDSS_MAX_BW_LIMIT_VFLIP); - } - - return threshold ? threshold : mdata->max_bw_per_pipe; + flags |= ctl->mdata->bw_mode_bitmap; + + for (i = 0; i < ctl->mdata->mdss_per_pipe_bw_cnt; i++) { + if (max_per_pipe_bw_settings[i].mdss_max_bw_mode & flags) { + threshold = max_per_pipe_bw_settings[i].mdss_max_bw_val; + if (threshold < max) + max = threshold; + } + } + + return max; } int mdss_mdp_perf_bw_check_pipe(struct mdss_mdp_perf_params *perf, @@ -1536,7 +1522,7 @@ int mdss_mdp_perf_bw_check_pipe(struct mdss_mdp_perf_params *perf, struct mdss_data_type *mdata = pipe->mixer_left->ctl->mdata; struct mdss_mdp_ctl *ctl = pipe->mixer_left->ctl; u32 vbp_fac, threshold; - u64 prefill_bw, pipe_bw; + u64 prefill_bw, pipe_bw, max_pipe_bw; /* we only need bandwidth check on real-time clients (interfaces) */ if (ctl->intf_type == MDSS_MDP_NO_INTF) @@ -1555,11 +1541,11 @@ int mdss_mdp_perf_bw_check_pipe(struct mdss_mdp_perf_params *perf, /* convert bandwidth to kb */ pipe_bw = DIV_ROUND_UP_ULL(pipe_bw, 1000); + threshold = mdata->max_bw_per_pipe; + max_pipe_bw = mdss_mdp_get_max_pipe_bw(pipe); - if (!mdata->max_per_pipe_bw_settings) - threshold = mdata->max_bw_per_pipe; - else - threshold = mdss_mdp_get_max_pipe_bw(pipe); + if (max_pipe_bw && (max_pipe_bw < threshold)) + threshold = max_pipe_bw; pr_debug("bw=%llu threshold=%u\n", pipe_bw, threshold); |
