From bc888e85389ee98c69e844b9cc14088539f7528b Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 5 Mar 2012 09:02:30 +0200 Subject: 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 Reviewed-on: http://git-master/r/87654 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Graziano Misuraca Tested-by: Graziano Misuraca Reviewed-by: Juha Tukkinen Reviewed-by: Mayuresh Kulkarni --- drivers/video/tegra/host/nvhost_acm.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'drivers/video/tegra/host/nvhost_acm.c') 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; } -- cgit v1.2.3