summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/latency_allowance.c
diff options
context:
space:
mode:
authorMichael Frydrych <mfrydrych@nvidia.com>2012-07-11 11:43:42 +0300
committerLokesh Pathak <lpathak@nvidia.com>2012-07-30 08:40:51 -0700
commit935adef53692ab73a02a7d09876756b30beb5206 (patch)
tree5eba41c8b9311556bd1202235d4321d52749afff /arch/arm/mach-tegra/latency_allowance.c
parente9e4bc232f2698d166f7c63bd5434c352083682a (diff)
arm: tegra: la: hack latency allowance formula
Remove the ad-hoc scale factor of final latency allowance. Scale the fifo size to pretend that our FIFO is only as deep as the lowest fullness we expect to see. Bug 995270 Change-Id: I78ed2246d2031a2303f81a19fe05c95572a692b0 Signed-off-by: Michael Frydrych <mfrydrych@nvidia.com> Reviewed-on: http://git-master/r/118816 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-by: Graziano Misuraca <gmisuraca@nvidia.com> Tested-by: Graziano Misuraca <gmisuraca@nvidia.com> Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/latency_allowance.c')
-rw-r--r--arch/arm/mach-tegra/latency_allowance.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/latency_allowance.c b/arch/arm/mach-tegra/latency_allowance.c
index 7698ba39f4ca..f8e5ce579200 100644
--- a/arch/arm/mach-tegra/latency_allowance.c
+++ b/arch/arm/mach-tegra/latency_allowance.c
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/latency_allowance.c
*
- * Copyright (C) 2011 NVIDIA Corporation
+ * Copyright (C) 2011-2012, NVIDIA CORPORATION. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -100,6 +100,9 @@
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__); \
}
+/* Bug 995270 */
+#define HACK_LA_FIFO 1
+
static struct dentry *latency_debug_dir;
struct la_client_info {
@@ -384,7 +387,9 @@ int tegra_set_latency_allowance(enum tegra_la_id id,
int la_to_set;
unsigned long reg_read;
unsigned long reg_write;
+ unsigned int fifo_size_in_atoms;
int bytes_per_atom = normal_atom_size;
+ const int fifo_scale = 4; /* 25% of the FIFO */
struct la_client_info *ci;
VALIDATE_ID(id);
@@ -394,11 +399,19 @@ int tegra_set_latency_allowance(enum tegra_la_id id,
bytes_per_atom = fdc_atom_size;
ci = &la_info[id];
+ fifo_size_in_atoms = ci->fifo_size_in_atoms;
+
+#if HACK_LA_FIFO
+ /* pretend that our FIFO is only as deep as the lowest fullness
+ * we expect to see */
+ if (id >= ID(DISPLAY_0A) && id <= ID(DISPLAY_HCB))
+ fifo_size_in_atoms /= fifo_scale;
+#endif
if (bandwidth_in_mbps == 0) {
la_to_set = MC_LA_MAX_VALUE;
} else {
- ideal_la = (ci->fifo_size_in_atoms * bytes_per_atom * 1000) /
+ ideal_la = (fifo_size_in_atoms * bytes_per_atom * 1000) /
(bandwidth_in_mbps * ns_per_tick);
la_to_set = ideal_la - (ci->expiration_in_ns/ns_per_tick) - 1;
}
@@ -409,11 +422,6 @@ int tegra_set_latency_allowance(enum tegra_la_id id,
la_to_set = (la_to_set > MC_LA_MAX_VALUE) ? MC_LA_MAX_VALUE : la_to_set;
scaling_info[id].actual_la_to_set = la_to_set;
- /* until display can use latency allowance scaling, use a more
- * aggressive LA setting. Bug 862709 */
- if (id >= ID(DISPLAY_0A) && id <= ID(DISPLAY_HCB))
- la_to_set /= 3;
-
spin_lock(&safety_lock);
reg_read = readl(ci->reg_addr);
reg_write = (reg_read & ~ci->mask) |