From 649fad848a7141aaf7129c74ab9e011179542a6d Mon Sep 17 00:00:00 2001 From: Ingrid Gallardo Date: Fri, 18 Jul 2014 20:07:59 -0700 Subject: [PATCH] msm: mdss: always apply BW fudge factor when video mode present If there is a video mode controller enabled and other controllers non-video mode, current display driver apply the bw fudge factor only to the controller that it is video mode. This change will apply the fudge factor to all the controllers enabled if any of those is video mode to fix some of the underruns observed in the video interfaces. Change-Id: I0d01477dc45edbef2a25ccd540aa06b3c43073a4 Signed-off-by: Ingrid Gallardo --- drivers/video/fbdev/msm/mdss_mdp_ctl.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c index af482322b286..74244d44acbe 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c +++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c @@ -791,6 +791,28 @@ static u32 mdss_mdp_get_vbp_factor_max(struct mdss_mdp_ctl *ctl) return vbp_max; } +static bool mdss_mdp_video_mode_intf_connected(struct mdss_mdp_ctl *ctl) +{ + 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; + + if (ctl->is_video_mode && mdss_mdp_ctl_is_power_on(ctl)) { + pr_debug("video interface connected ctl:%d\n", + ctl->num); + return true; + } + } + + return false; +} + static void __mdss_mdp_perf_calc_ctl_helper(struct mdss_mdp_ctl *ctl, struct mdss_mdp_perf_params *perf, struct mdss_mdp_pipe **left_plist, int left_cnt, @@ -935,7 +957,7 @@ static void mdss_mdp_perf_calc_ctl(struct mdss_mdp_ctl *ctl, __mdss_mdp_perf_calc_ctl_helper(ctl, perf, left_plist, left_cnt, right_plist, right_cnt, 0); - if (ctl->is_video_mode) { + if (ctl->is_video_mode || mdss_mdp_video_mode_intf_connected(ctl)) { perf->bw_ctl = max(apply_fudge_factor(perf->bw_overlap, &mdss_res->ib_factor_overlap),