mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
msm: kgsl: Add support to configure bus dcvs sampling interval
Add support to configure bus dcvs sampling interval through the sysfs entry. Also expose cur_ab vote value to sysfs. $ echo 25000 > /sys/class/devfreq/soc:qcom,kgsl-busmon/sampling_interval $ cat /sys/class/devfreq/soc:qcom,kgsl-busmon/cur_ab . Change-Id: I77df55de2766d3fd818c27f717cfc4ae598bb0bd Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
This commit is contained in:
parent
9e1aed8fb7
commit
72fc78c2f8
2 changed files with 66 additions and 1 deletions
|
|
@ -31,6 +31,61 @@ static void _update_cutoff(struct devfreq_msm_adreno_tz_data *priv,
|
|||
}
|
||||
}
|
||||
|
||||
static ssize_t cur_ab_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct devfreq *df = to_devfreq(dev);
|
||||
struct msm_busmon_extended_profile *bus_profile = container_of(
|
||||
(df->profile),
|
||||
struct msm_busmon_extended_profile,
|
||||
profile);
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "%llu\n", bus_profile->ab_mbytes);
|
||||
}
|
||||
|
||||
static ssize_t sampling_interval_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct devfreq *df = to_devfreq(dev);
|
||||
struct msm_busmon_extended_profile *bus_profile = container_of(
|
||||
(df->profile),
|
||||
struct msm_busmon_extended_profile,
|
||||
profile);
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", bus_profile->sampling_ms);
|
||||
}
|
||||
|
||||
static ssize_t sampling_interval_store(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct devfreq *df = to_devfreq(dev);
|
||||
struct msm_busmon_extended_profile *bus_profile = container_of(
|
||||
(df->profile),
|
||||
struct msm_busmon_extended_profile,
|
||||
profile);
|
||||
u32 value;
|
||||
int ret;
|
||||
|
||||
ret = kstrtou32(buf, 0, &value);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
bus_profile->sampling_ms = value;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static DEVICE_ATTR_RW(sampling_interval);
|
||||
static DEVICE_ATTR_RO(cur_ab);
|
||||
|
||||
static const struct device_attribute *gpubw_attr_list[] = {
|
||||
&dev_attr_sampling_interval,
|
||||
&dev_attr_cur_ab,
|
||||
NULL
|
||||
};
|
||||
|
||||
static int devfreq_gpubw_get_target(struct devfreq *df,
|
||||
unsigned long *freq)
|
||||
{
|
||||
|
|
@ -70,7 +125,7 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
|
|||
priv->bus.ram_time += b.ram_time;
|
||||
priv->bus.ram_wait += b.ram_wait;
|
||||
|
||||
if (priv->bus.total_time < LONG_FLOOR)
|
||||
if (priv->bus.total_time < bus_profile->sampling_ms)
|
||||
return result;
|
||||
|
||||
norm_max_cycles = (unsigned int)(priv->bus.ram_time) /
|
||||
|
|
@ -174,12 +229,21 @@ static int gpubw_start(struct devfreq *devfreq)
|
|||
priv->bus.p_up[priv->bus.num - 1] = 100;
|
||||
_update_cutoff(priv, priv->bus.max);
|
||||
|
||||
bus_profile->sampling_ms = LONG_FLOOR;
|
||||
|
||||
for (i = 0; gpubw_attr_list[i] != NULL; i++)
|
||||
device_create_file(&devfreq->dev, gpubw_attr_list[i]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gpubw_stop(struct devfreq *devfreq)
|
||||
{
|
||||
struct devfreq_msm_adreno_tz_data *priv = devfreq->data;
|
||||
int i;
|
||||
|
||||
for (i = 0; gpubw_attr_list[i] != NULL; i++)
|
||||
device_remove_file(&devfreq->dev, gpubw_attr_list[i]);
|
||||
|
||||
if (priv) {
|
||||
kfree(priv->bus.up);
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ struct msm_adreno_extended_profile {
|
|||
|
||||
struct msm_busmon_extended_profile {
|
||||
u32 flag;
|
||||
u32 sampling_ms;
|
||||
unsigned long percent_ab;
|
||||
unsigned long ab_mbytes;
|
||||
struct devfreq_msm_adreno_tz_data *private_data;
|
||||
|
|
|
|||
Loading…
Reference in a new issue