msm: mdss: calculate prefill bandwidth using the worst case vbp
The blanking period of a panel is determined by vbp factor: vertical
back porch plus vsync pulse width. The larger vbp, the larger blanking
time, and the smaller prefill bandwidth request. When two or more
types of interfaces/panels are involved, although each panel has its
own vbp, there is an option to calculate the prefill bandwidth for
each panel with the worst case vbp of all panels. This way there is no
need to increase fudge factor to avoid underruns.
Change-Id: I60dda6ad41bbb353c58ef93cf97787c4da3929dc
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
diff --git a/drivers/video/msm/mdss/mdss_mdp_ctl.c b/drivers/video/msm/mdss/mdss_mdp_ctl.c
index 81f315b..eafa31e 100644
--- a/drivers/video/msm/mdss/mdss_mdp_ctl.c
+++ b/drivers/video/msm/mdss/mdss_mdp_ctl.c
@@ -493,6 +493,29 @@
return vbp_fac;
}
+static u32 mdss_mdp_get_vbp_factor_max(struct mdss_mdp_ctl *ctl)
+{
+ u32 vbp_max = 0;
+ int i;
+ struct mdss_data_type *mdata;
+
+ if (!ctl || !ctl->mdata)
+ return 0;
+
+ mdata = ctl->mdata;
+ for (i = 0; i < mdata->nctl; i++) {
+ struct mdss_mdp_ctl *ctl = mdata->ctl_off + i;
+ u32 vbp_fac;
+
+ if (ctl->power_on) {
+ vbp_fac = mdss_mdp_get_vbp_factor(ctl);
+ vbp_max = max(vbp_max, vbp_fac);
+ }
+ }
+
+ return vbp_max;
+}
+
static void mdss_mdp_perf_calc_ctl(struct mdss_mdp_ctl *ctl,
struct mdss_mdp_perf_params *perf)
{
@@ -528,7 +551,8 @@
perf->bw_overlap = SZ_16M;
if (ctl->intf_type != MDSS_MDP_NO_INTF) {
- u32 vbp_fac = mdss_mdp_get_vbp_factor(ctl);
+ u32 vbp_fac = mdss_mdp_get_vbp_factor_max(ctl);
+
perf->bw_prefill = perf->prefill_bytes;
/*
* Prefill bandwidth equals the amount of data (number