summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/nvhost_acm.c
diff options
context:
space:
mode:
authorChris Johnson <cwj@nvidia.com>2011-07-01 18:47:12 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:34 -0800
commitc9af9a888b86aa93247ab0ee01bc05796961e7f6 (patch)
treed0eaa0c2dbfd85d95f90b097c2f587734bd8ca7a /drivers/video/tegra/host/nvhost_acm.c
parenta38747fc890692d850aa2001f0430e479762bad9 (diff)
video: tegra: host: separate the different kinds of ACM timeouts
Let the delay in making sure a module is idle for some amount of time before powering it down be module specific. This typically occurs at the end of a INTR_ACTION_SUBMIT_COMPLETLETE. Some modules have more work (e.g. 3D) to power down, so should have a longer delay than a module with a lower latency (e.g. 2D). This change adds the infrastructure a subsequent change will assign different values. Make use of a separate #define for the timeout used in waiting for a system suspend to go idle. Original-Change-Id: I4d675375e7c2ad841168449bd7f6db3d38d6d6c3 Reviewed-on: http://git-master/r/40044 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rdacbc9caab0bf60064d6c27a7c919b9a759da97a
Diffstat (limited to 'drivers/video/tegra/host/nvhost_acm.c')
-rw-r--r--drivers/video/tegra/host/nvhost_acm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c
index 725aebfc0c9a..0d2ea693b4db 100644
--- a/drivers/video/tegra/host/nvhost_acm.c
+++ b/drivers/video/tegra/host/nvhost_acm.c
@@ -28,7 +28,8 @@
#include <mach/powergate.h>
#include <mach/clk.h>
-#define ACM_TIMEOUT_MSEC 25
+#define ACM_POWERDOWN_HANDLER_DELAY_MSEC 25
+#define ACM_SUSPEND_WAIT_FOR_IDLE_TIMEOUT (2 * HZ)
#define DISABLE_3D_POWERGATING
@@ -84,8 +85,8 @@ void nvhost_module_idle_mult(struct nvhost_module *mod, int refs)
mutex_lock(&mod->lock);
if (atomic_sub_return(refs, &mod->refcount) == 0) {
BUG_ON(!mod->powered);
- schedule_delayed_work(
- &mod->powerdown, msecs_to_jiffies(ACM_TIMEOUT_MSEC));
+ schedule_delayed_work(&mod->powerdown,
+ msecs_to_jiffies(mod->powerdown_delay));
kick = true;
}
mutex_unlock(&mod->lock);
@@ -155,6 +156,7 @@ int nvhost_module_init(struct nvhost_module *mod, const char *name,
mod->powered = false;
mod->powergate_id = -1;
mod->powergate_id2 = -1;
+ mod->powerdown_delay = ACM_POWERDOWN_HANDLER_DELAY_MSEC;
if (strcmp(name, "gr3d") == 0) {
mod->powergate_id = TEGRA_POWERGATE_3D;
@@ -237,7 +239,7 @@ void nvhost_module_suspend(struct nvhost_module *mod, bool system_suspend)
}
ret = wait_event_timeout(mod->idle, is_module_idle(mod),
- msecs_to_jiffies(ACM_TIMEOUT_MSEC + 500));
+ ACM_SUSPEND_WAIT_FOR_IDLE_TIMEOUT);
if (ret == 0)
nvhost_debug_dump(dev);