devfreq: Weight stall cycles more for GPU bus DCVS
Update GPU Bus DCVS to weight high stall cycles (as a percentage of total bus usage) heavier in order to vote up the bus when the GPU is stalling a lot waiting for data. Change-Id: I8a331a48a1ab737c51f1001ea1991f09af9ef900 Signed-off-by: Kyle Piefer <kpiefer@codeaurora.org>
This commit is contained in:
parent
fd8c86a98e
commit
1b90dac849
1 changed files with 6 additions and 1 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#define HIST 5
|
||||
#define TARGET 80
|
||||
#define CAP 75
|
||||
#define WAIT_THRESHOLD 10
|
||||
/* AB vote is in multiple of BW_STEP Mega bytes */
|
||||
#define BW_STEP 160
|
||||
|
||||
|
|
@ -67,6 +68,7 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
|
|||
int act_level;
|
||||
int norm_max_cycles;
|
||||
int norm_cycles;
|
||||
int wait_active_percent;
|
||||
int gpu_percent;
|
||||
/*
|
||||
* Normalized AB should at max usage be the gpu_bimc frequency in MHz.
|
||||
|
|
@ -99,6 +101,8 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
|
|||
(unsigned int) priv->bus.total_time;
|
||||
norm_cycles = (unsigned int)(priv->bus.ram_time + priv->bus.ram_wait) /
|
||||
(unsigned int) priv->bus.total_time;
|
||||
wait_active_percent = (100 * (unsigned int)priv->bus.ram_wait) /
|
||||
(unsigned int) priv->bus.ram_time;
|
||||
gpu_percent = (100 * (unsigned int)priv->bus.gpu_time) /
|
||||
(unsigned int) priv->bus.total_time;
|
||||
|
||||
|
|
@ -117,7 +121,8 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
|
|||
act_level = (act_level < 0) ? 0 : act_level;
|
||||
act_level = (act_level >= priv->bus.num) ?
|
||||
(priv->bus.num - 1) : act_level;
|
||||
if (norm_cycles > priv->bus.up[act_level] &&
|
||||
if ((norm_cycles > priv->bus.up[act_level] ||
|
||||
wait_active_percent > WAIT_THRESHOLD) &&
|
||||
gpu_percent > CAP)
|
||||
bus_profile->flag = DEVFREQ_FLAG_FAST_HINT;
|
||||
else if (norm_cycles < priv->bus.down[act_level] && level)
|
||||
|
|
|
|||
Loading…
Reference in a new issue