static int mdss_mdp_ctl_perf_update(struct mdss_mdp_ctl *ctl) { int ret = MDSS_MDP_PERF_UPDATE_SKIP; u32 clk_rate, ab_quota, ib_quota; u32 max_clk_rate = 0, total_ab_quota = 0, total_ib_quota = 0; if (ctl->mixer_left) { mdss_mdp_perf_mixer_update(ctl->mixer_left, &ab_quota, &ib_quota, &clk_rate); total_ab_quota += ab_quota; total_ib_quota += ib_quota; max_clk_rate = clk_rate; } if (ctl->mixer_right) { mdss_mdp_perf_mixer_update(ctl->mixer_right, &ab_quota, &ib_quota, &clk_rate); total_ab_quota += ab_quota; total_ib_quota += ib_quota; if (clk_rate > max_clk_rate) max_clk_rate = clk_rate; if (ctl->intf_type) { clk_rate = mdss_mdp_get_pclk_rate(ctl); /* minimum clock rate due to inefficiency in 3dmux */ clk_rate = mult_frac(clk_rate >> 1, 9, 8); if (clk_rate > max_clk_rate) max_clk_rate = clk_rate; }
static void mdss_mdp_perf_calc_ctl(struct mdss_mdp_ctl *ctl, struct mdss_mdp_perf_params *perf) { struct mdss_mdp_perf_params tmp; memset(perf, 0, sizeof(*perf)); if (ctl->mixer_left) { mdss_mdp_perf_calc_mixer(ctl->mixer_left, &tmp); perf->ab_quota += tmp.ab_quota; perf->ib_quota += tmp.ib_quota; perf->mdp_clk_rate = tmp.mdp_clk_rate; } if (ctl->mixer_right) { mdss_mdp_perf_calc_mixer(ctl->mixer_right, &tmp); perf->ab_quota += tmp.ab_quota; perf->ib_quota += tmp.ib_quota; if (tmp.mdp_clk_rate > perf->mdp_clk_rate) perf->mdp_clk_rate = tmp.mdp_clk_rate; if (ctl->intf_type) { u32 clk_rate = mdss_mdp_get_pclk_rate(ctl); /* minimum clock rate due to inefficiency in 3dmux */ clk_rate = mult_frac(clk_rate >> 1, 9, 8); if (clk_rate > perf->mdp_clk_rate) perf->mdp_clk_rate = clk_rate; }