From 059322e52a00cc1078f6b66f3f1c198dec35f3b7 Mon Sep 17 00:00:00 2001 From: Ingrid Gallardo Date: Thu, 12 Feb 2015 20:24:26 -0800 Subject: [PATCH] msm: mdss: skip bw vote for same bw requests If the bandwidth requested is the same as the one from the previous vote, skip the call to bus driver in order to avoid an overhead due unnecessary calls to bus driver. Change-Id: I5e90f04a186d9d259e28c70783840294c86fcc98 Signed-off-by: Ingrid Gallardo (cherry picked from commit 7337a9e3df25b2ce22005001d95866a51738429b ) [veeras@codeaurora.org: Resolve merge conflict in mdss_dsi_host.c] Signed-off-by: Veera Sundaram Sankaran --- drivers/video/fbdev/msm/mdss_dsi_host.c | 2 +- drivers/video/fbdev/msm/mdss_mdp.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/msm/mdss_dsi_host.c b/drivers/video/fbdev/msm/mdss_dsi_host.c index 28164a9bd191..ac9c1ab307f3 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_host.c +++ b/drivers/video/fbdev/msm/mdss_dsi_host.c @@ -2024,7 +2024,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) ctrl->mdss_util->bus_bandwidth_ctrl(1); if (ctrl->mdss_util->bus_scale_set_quota) - ctrl->mdss_util->bus_scale_set_quota(MDSS_DSI_RT, SZ_1M, SZ_1M); + ctrl->mdss_util->bus_scale_set_quota(MDSS_DSI_RT, 0, SZ_1M); pr_debug("%s: from_mdp=%d pid=%d\n", __func__, from_mdp, current->pid); diff --git a/drivers/video/fbdev/msm/mdss_mdp.c b/drivers/video/fbdev/msm/mdss_mdp.c index d43cc68d87be..4dfb5c3e8aad 100644 --- a/drivers/video/fbdev/msm/mdss_mdp.c +++ b/drivers/video/fbdev/msm/mdss_mdp.c @@ -317,6 +317,7 @@ static int mdss_mdp_bus_scale_set_quota(u64 ab_quota_rt, u64 ab_quota_nrt, u32 nrt_axi_port_cnt = mdss_res->nrt_axi_port_cnt; u32 total_axi_port_cnt = mdss_res->axi_port_cnt; u32 rt_axi_port_cnt = total_axi_port_cnt - nrt_axi_port_cnt; + int match_cnt = 0; if (!bw_table || !total_axi_port_cnt || total_axi_port_cnt > MAX_AXI_PORT_COUNT) { @@ -357,6 +358,20 @@ static int mdss_mdp_bus_scale_set_quota(u64 ab_quota_rt, u64 ab_quota_nrt, } } + for (i = 0; i < total_axi_port_cnt; i++) { + vect = &bw_table->usecase + [mdss_res->curr_bw_uc_idx].vectors[i]; + /* avoid performing updates for small changes */ + if ((ab_quota[i] == vect->ab) && + (ib_quota[i] == vect->ib)) + match_cnt++; + } + + if (match_cnt == total_axi_port_cnt) { + pr_debug("skip BW vote\n"); + return 0; + } + new_uc_idx = (mdss_res->curr_bw_uc_idx % (bw_table->num_usecases - 1)) + 1;