summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2012-03-05 09:02:30 +0200
committerSimone Willett <swillett@nvidia.com>2012-04-26 14:33:39 -0700
commitbc888e85389ee98c69e844b9cc14088539f7528b (patch)
tree096d0c313590b89797fa81f58a8d8b5494c4fb19
parentc0df55efeec575262e8a739851b0ea364dba69fa (diff)
video: tegra: host: Reset 3D after power on
Sometimes 3D unit comes up with incorrect scissor configuration. Earlier patch added the scissor registers to the context save list, but that did not solve the problem. Remove the extra registers, and reset 3D after powering it up. Bug 939307 Change-Id: Id795f2d99ec3c6b907da2785b1816ce753af7a3f Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/87654 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Graziano Misuraca <gmisuraca@nvidia.com> Tested-by: Graziano Misuraca <gmisuraca@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
-rw-r--r--drivers/video/tegra/host/gr3d/gr3d_t30.c1
-rw-r--r--drivers/video/tegra/host/nvhost_acm.c22
-rw-r--r--drivers/video/tegra/host/t30/t30.c3
-rw-r--r--include/linux/nvhost.h1
4 files changed, 17 insertions, 10 deletions
diff --git a/drivers/video/tegra/host/gr3d/gr3d_t30.c b/drivers/video/tegra/host/gr3d/gr3d_t30.c
index 8ca6b7b44b9e..ab4d04f89ab2 100644
--- a/drivers/video/tegra/host/gr3d/gr3d_t30.c
+++ b/drivers/video/tegra/host/gr3d/gr3d_t30.c
@@ -71,7 +71,6 @@ static const struct hwctx_reginfo ctxsave_regs_3d_global[] = {
HWCTX_REGINFO(0xa02, 10, DIRECT),
HWCTX_REGINFO(0xb04, 1, DIRECT),
HWCTX_REGINFO(0xb06, 13, DIRECT),
- HWCTX_REGINFO(0xe42, 2, DIRECT), /* HW bug workaround */
};
static const struct hwctx_reginfo ctxsave_regs_3d_perset[] = {
diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c
index f2a61a9547a0..015b7c4dbf66 100644
--- a/drivers/video/tegra/host/nvhost_acm.c
+++ b/drivers/video/tegra/host/nvhost_acm.c
@@ -55,15 +55,8 @@ static void do_unpowergate_locked(int id)
tegra_unpowergate_partition(id);
}
-void nvhost_module_reset(struct nvhost_device *dev)
+static void do_module_reset_locked(struct nvhost_device *dev)
{
- dev_dbg(&dev->dev,
- "%s: asserting %s module reset (id %d, id2 %d)\n",
- __func__, dev->name,
- dev->powergate_ids[0], dev->powergate_ids[1]);
-
- mutex_lock(&dev->lock);
-
/* assert module and mc client reset */
if (dev->powergate_ids[0] != -1) {
tegra_powergate_mc_disable(dev->powergate_ids[0]);
@@ -89,7 +82,17 @@ void nvhost_module_reset(struct nvhost_device *dev)
tegra_periph_reset_deassert(dev->clk[1]);
tegra_powergate_mc_enable(dev->powergate_ids[1]);
}
+}
+void nvhost_module_reset(struct nvhost_device *dev)
+{
+ dev_dbg(&dev->dev,
+ "%s: asserting %s module reset (id %d, id2 %d)\n",
+ __func__, dev->name,
+ dev->powergate_ids[0], dev->powergate_ids[1]);
+
+ mutex_lock(&dev->lock);
+ do_module_reset_locked(dev);
mutex_unlock(&dev->lock);
dev_dbg(&dev->dev, "%s: module %s out of reset\n",
@@ -108,6 +111,9 @@ static void to_state_clockgated_locked(struct nvhost_device *dev)
&& dev->can_powergate) {
do_unpowergate_locked(dev->powergate_ids[0]);
do_unpowergate_locked(dev->powergate_ids[1]);
+
+ if (dev->powerup_reset)
+ do_module_reset_locked(dev);
}
dev->powerstate = NVHOST_POWER_STATE_CLOCKGATED;
}
diff --git a/drivers/video/tegra/host/t30/t30.c b/drivers/video/tegra/host/t30/t30.c
index 8a8b1f4d9240..da56a9b66e11 100644
--- a/drivers/video/tegra/host/t30/t30.c
+++ b/drivers/video/tegra/host/t30/t30.c
@@ -82,7 +82,8 @@ struct nvhost_device t30_devices[] = {
.powergate_ids = { TEGRA_POWERGATE_3D,
TEGRA_POWERGATE_3D1 },
NVHOST_DEFAULT_CLOCKGATE_DELAY,
- .can_powergate = false,
+ .can_powergate = true,
+ .powerup_reset = true,
.powergate_delay = 250,
.moduleid = NVHOST_MODULE_NONE,
},
diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h
index da5e1e6862c6..faa183d40d6d 100644
--- a/include/linux/nvhost.h
+++ b/include/linux/nvhost.h
@@ -64,6 +64,7 @@ struct nvhost_device {
bool exclusive; /* True if only one user at a time */
bool keepalive; /* Do not power gate when opened */
bool waitbasesync; /* Force sync of wait bases */
+ bool powerup_reset; /* Do a reset after power un-gating */
int powergate_ids[NVHOST_MODULE_MAX_POWERGATE_IDS];
bool can_powergate; /* True if module can be power gated */