mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-21 03:43:03 +00:00
Merge "msm: kgsl: Add a dynamic AB bandwidth vote"
This commit is contained in:
commit
5c7ba6daab
|
@ -53,6 +53,12 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
|
|||
int act_level;
|
||||
int norm_cycles;
|
||||
int gpu_percent;
|
||||
/*
|
||||
* Normalized AB should at max usage be the gpu_bimc frequency in MHz.
|
||||
* Start with a reasonable value and let the system push it up to max.
|
||||
*/
|
||||
static int norm_ab_max = 300;
|
||||
int norm_ab;
|
||||
|
||||
stats.private_data = &b;
|
||||
|
||||
|
@ -97,6 +103,15 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
|
|||
bus_profile->flag = DEVFREQ_FLAG_SLOW_HINT;
|
||||
}
|
||||
|
||||
/* Re-calculate the AB percentage for a new IB vote */
|
||||
if (bus_profile->flag) {
|
||||
norm_ab = (unsigned int)priv->bus.ram_time /
|
||||
(unsigned int) priv->bus.total_time;
|
||||
if (norm_ab > norm_ab_max)
|
||||
norm_ab_max = norm_ab;
|
||||
bus_profile->percent_ab = (100 * norm_ab) / norm_ab_max;
|
||||
}
|
||||
|
||||
priv->bus.total_time = 0;
|
||||
priv->bus.gpu_time = 0;
|
||||
priv->bus.ram_time = 0;
|
||||
|
|
Loading…
Reference in a new issue