summaryrefslogtreecommitdiff
path: root/drivers/edp
diff options
context:
space:
mode:
authorSivaram Nair <sivaramn@nvidia.com>2013-05-27 17:25:12 +0300
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 13:15:56 -0700
commitb0ef51952bbd83616f8fb5cd96a8ab1cdf18591d (patch)
tree47d6527a440ab2d691da0a165ed4a5e469941465 /drivers/edp
parent89efa878a00724d017235d4676e01eec4edd9ea5 (diff)
EDP: tegra: filter out isolated gpu peaks
Isolated gpu load peaks degrade CPU performance without benefitting the GPU use case. This patch implements a filter to detect such events by requiring the GPU load to be above gpu_high_threshold for at least gpu_high_count (default is 2) number of consecutive notifications. Bug 1293353 Change-Id: Ia14aa1d121c665251b6299cbe8b78a81f1f4c8d3 Signed-off-by: Sivaram Nair <sivaramn@nvidia.com> Reviewed-on: http://git-master/r/233597 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Diffstat (limited to 'drivers/edp')
-rw-r--r--drivers/edp/tegra_core.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/edp/tegra_core.c b/drivers/edp/tegra_core.c
index 21bbc854f899..33f8661d82fb 100644
--- a/drivers/edp/tegra_core.c
+++ b/drivers/edp/tegra_core.c
@@ -34,6 +34,8 @@ struct freqcap {
static unsigned int gpu_high_threshold = 500;
static unsigned int gpu_window = 80;
+static unsigned int gpu_high_hist;
+static unsigned int gpu_high_count = 2;
static unsigned int online_cpu_count;
static bool gpu_busy;
static unsigned int core_state;
@@ -225,12 +227,29 @@ static void core_worker(struct work_struct *work)
do_cap_control();
}
+/*
+ * Return true if load was above threshold for at least
+ * gpu_high_count number of notifications
+ */
+static bool calc_gpu_busy(unsigned int load)
+{
+ unsigned int mask;
+
+ mask = (1 << gpu_high_count) - 1;
+
+ gpu_high_hist <<= 1;
+ if (load >= gpu_high_threshold)
+ gpu_high_hist |= 1;
+
+ return (gpu_high_hist & mask) == mask;
+}
+
void tegra_edp_notify_gpu_load(unsigned int load)
{
bool old;
old = gpu_busy;
- gpu_busy = load >= gpu_high_threshold;
+ gpu_busy = calc_gpu_busy(load);
if (gpu_busy == old || force_gpu_pri || !core_platdata)
return;
@@ -359,6 +378,7 @@ static void init_debug(void)
create_attr("force_emc", core_client.dentry, &forced_caps.emc);
create_attr("gpu_window", core_client.dentry, &gpu_window);
create_attr("gain", core_client.dentry, &core_platdata->core_gain);
+ create_attr("gpu_high_count", core_client.dentry, &gpu_high_count);
}
#else
static inline void init_debug(void) {}