adrenoboost: finetuning algorithm - scale it a bit down

Values range from 0-3, 0 off, 3 most aggressive.
Scales back nicely in 2d to 133mhz.
Only scale up and count if MIN_VALUE crossed

Signed-off-by: engstk <eng.stk@sapo.pt>

Conflicts:
	drivers/devfreq/governor_msm_adreno_tz.c

Signed-off-by: Pierre2324 <pdbbasketball@gmail.com>
This commit is contained in:
tbalden
2016-07-30 12:48:59 -07:00
committed by theshaenix
parent 80306296ec
commit efea70d619

View File

@@ -58,7 +58,10 @@ static DEFINE_SPINLOCK(suspend_lock);
#define TAG "msm_adreno_tz: "
static unsigned int adrenoboost = 10000;
#if 1
static unsigned int adrenoboost = 1;
#endif
static u64 suspend_time;
static u64 suspend_start;
static unsigned long acc_total, acc_relative_busy;
@@ -81,6 +84,7 @@ u64 suspend_time_ms(void)
return time_diff;
}
#if 1
static ssize_t adrenoboost_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -95,7 +99,7 @@ static ssize_t adrenoboost_save(struct device *dev,
{
int input;
sscanf(buf, "%d ", &input);
if (input < 0 || input > 50000) {
if (input < 0 || input > 3) {
adrenoboost = 0;
} else {
adrenoboost = input;
@@ -103,7 +107,7 @@ static ssize_t adrenoboost_save(struct device *dev,
return count;
}
#endif
static ssize_t gpu_load_show(struct device *dev,
struct device_attribute *attr,
@@ -151,8 +155,10 @@ static ssize_t suspend_time_show(struct device *dev,
return snprintf(buf, PAGE_SIZE, "%llu\n", time_diff);
}
#if 1
static DEVICE_ATTR(adrenoboost, 0644,
adrenoboost_show, adrenoboost_save);
#endif
static DEVICE_ATTR(gpu_load, 0444, gpu_load_show, NULL);
@@ -163,7 +169,9 @@ static DEVICE_ATTR(suspend_time, 0444,
static const struct device_attribute *adreno_tz_attr_list[] = {
&dev_attr_gpu_load,
&dev_attr_suspend_time,
#if 1
&dev_attr_adrenoboost,
#endif
NULL
};
@@ -382,7 +390,16 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq)
*freq = stats.current_frequency;
priv->bin.total_time += stats.total_time;
#if 1
// scale busy time up based on adrenoboost parameter, only if MIN_BUSY exceeded...
if ((unsigned int)(priv->bin.busy_time + stats.busy_time) >= MIN_BUSY) {
priv->bin.busy_time += stats.busy_time * (1 + (adrenoboost*3)/2);
} else {
priv->bin.busy_time += stats.busy_time;
}
#else
priv->bin.busy_time += stats.busy_time;
#endif
if (stats.private_data)
context_count = *((int *)stats.private_data);
@@ -418,7 +435,7 @@ static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq)
scm_data[0] = level;
scm_data[1] = priv->bin.total_time;
scm_data[2] = priv->bin.busy_time + (level * adrenoboost);
scm_data[2] = priv->bin.busy_time;
scm_data[3] = context_count;
__secure_tz_update_entry3(scm_data, sizeof(scm_data),
&val, sizeof(val), priv);