summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2011-05-16 10:24:08 +0300
committerNiket Sirsi <nsirsi@nvidia.com>2011-06-14 16:08:46 -0700
commit03e9e008d1ee12afee36f717923677fa64c4b700 (patch)
tree211ef265007cf955b12a448d155c4443ef22b519
parent9faeefb558c22f65e96ad7294b86a01dd16aff15 (diff)
nvhost: Enable MPE powergating, except when open.
Enable MPE power gating, but keep it powered on when userspace has a channel open. Bug 809847 Change-Id: I30a297c079c0911fdaf9de528e3d5bf4a7cc1d72 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/32179 Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Niket Sirsi <nsirsi@nvidia.com> Tested-by: Niket Sirsi <nsirsi@nvidia.com>
-rw-r--r--drivers/video/tegra/host/nvhost_acm.c9
-rw-r--r--drivers/video/tegra/host/nvhost_channel.c9
-rw-r--r--drivers/video/tegra/host/nvhost_channel.h1
3 files changed, 10 insertions, 9 deletions
diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c
index 91a9b3b9c4dd..e7a890902feb 100644
--- a/drivers/video/tegra/host/nvhost_acm.c
+++ b/drivers/video/tegra/host/nvhost_acm.c
@@ -31,7 +31,6 @@
#define ACM_TIMEOUT_MSEC 25
#define DISABLE_3D_POWERGATING
-#define DISABLE_MPE_POWERGATING
void nvhost_module_busy(struct nvhost_module *mod)
{
@@ -190,14 +189,6 @@ int nvhost_module_init(struct nvhost_module *mod, const char *name,
}
#endif
#endif
-#ifdef DISABLE_MPE_POWERGATING
- if (mod->powergate_id == TEGRA_POWERGATE_MPE) {
- tegra_powergate_sequence_power_up(mod->powergate_id,
- mod->clk[0]);
- clk_disable(mod->clk[0]);
- mod->powergate_id = -1;
- }
-#endif
mutex_init(&mod->lock);
init_waitqueue_head(&mod->idle);
diff --git a/drivers/video/tegra/host/nvhost_channel.c b/drivers/video/tegra/host/nvhost_channel.c
index 896a5ea14362..f7776e63e68d 100644
--- a/drivers/video/tegra/host/nvhost_channel.c
+++ b/drivers/video/tegra/host/nvhost_channel.c
@@ -91,6 +91,7 @@ static const struct nvhost_channeldesc channelmap[] = {
.class = NV_VIDEO_ENCODE_MPEG_CLASS_ID,
.power = power_mpe,
.exclusive = true,
+ .keepalive = true,
},
{
/* channel 6 */
@@ -142,6 +143,10 @@ struct nvhost_channel *nvhost_getchannel(struct nvhost_channel *ch)
}
mutex_unlock(&ch->reflock);
+ /* Keep alive modules that needs to be when a channel is open */
+ if (!err && ch->desc->keepalive)
+ nvhost_module_busy(&ch->mod);
+
return err ? NULL : ch;
}
@@ -154,6 +159,10 @@ void nvhost_putchannel(struct nvhost_channel *ch, struct nvhost_hwctx *ctx)
mutex_unlock(&ch->submitlock);
}
+ /* Allow keep-alive'd module to be turned off */
+ if (ch->desc->keepalive)
+ nvhost_module_idle(&ch->mod);
+
mutex_lock(&ch->reflock);
if (ch->refcount == 1) {
nvhost_module_deinit(&ch->mod);
diff --git a/drivers/video/tegra/host/nvhost_channel.h b/drivers/video/tegra/host/nvhost_channel.h
index 31d5f470967f..b1515c4db6d9 100644
--- a/drivers/video/tegra/host/nvhost_channel.h
+++ b/drivers/video/tegra/host/nvhost_channel.h
@@ -46,6 +46,7 @@ struct nvhost_channeldesc {
u32 modulemutexes;
u32 class;
bool exclusive;
+ bool keepalive;
};
struct nvhost_channel {