summaryrefslogtreecommitdiff
path: root/drivers/media/video/tegra/nvavp/nvavp_dev.c
diff options
context:
space:
mode:
authorSachin Nikam <snikam@nvidia.com>2011-12-27 14:01:57 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-30 10:46:42 +0530
commitc163ad14962bf18269d01457ca02ed0b6eb53fc0 (patch)
tree4ab2509ddd352d3b16d3e8941cb308e735bb51b7 /drivers/media/video/tegra/nvavp/nvavp_dev.c
parent5066709a14daa7f440d252313a2df36aad73fb07 (diff)
media: video: tegra: nvavp: busy and idle hint for host1x
When nvavp driver is opened hint host1x busy and on release hint idle. When going to suspend hint idle and on resume hint busy. Bug 904555 Change-Id: I18218190cfd7c9ee9540813a8dcaead4556583dc Signed-off-by: Sachin Nikam <snikam@nvidia.com> Reviewed-on: http://git-master/r/72187 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Mandar Potdar <mpotdar@nvidia.com>
Diffstat (limited to 'drivers/media/video/tegra/nvavp/nvavp_dev.c')
-rw-r--r--drivers/media/video/tegra/nvavp/nvavp_dev.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/media/video/tegra/nvavp/nvavp_dev.c b/drivers/media/video/tegra/nvavp/nvavp_dev.c
index 87f9b9d302f4..c0e8d683d894 100644
--- a/drivers/media/video/tegra/nvavp/nvavp_dev.c
+++ b/drivers/media/video/tegra/nvavp/nvavp_dev.c
@@ -45,6 +45,8 @@
#include "../../../../video/tegra/nvmap/nvmap.h"
#include "../../../../video/tegra/host/t20/syncpt_t20.h"
#include "../../../../video/tegra/host/dev.h"
+#include "../../../../video/tegra/host/nvhost_acm.h"
+
#if defined(CONFIG_TEGRA_AVP_KERNEL_ON_MMU)
#include "../avp/headavp.h"
#endif
@@ -991,7 +993,6 @@ err_reloc_info:
err_cmdbuf_mmap:
nvmap_unpin(nvavp->nvmap, cmdbuf_dupe);
nvmap_free(nvavp->nvmap, cmdbuf_dupe);
-
return ret;
}
@@ -1023,6 +1024,7 @@ static int tegra_nvavp_open(struct inode *inode, struct file *filp)
filp->private_data = clientctx;
+ nvhost_module_busy(&nvavp->nvhost_dev->host->mod);
mutex_unlock(&nvavp->open_lock);
return ret;
@@ -1037,6 +1039,7 @@ static int tegra_nvavp_release(struct inode *inode, struct file *filp)
dev_dbg(&nvavp->nvhost_dev->dev, "%s: ++\n", __func__);
filp->private_data = NULL;
+ nvhost_module_idle(&nvavp->nvhost_dev->host->mod);
mutex_lock(&nvavp->open_lock);
@@ -1353,11 +1356,19 @@ static int tegra_nvavp_remove(struct nvhost_device *ndev)
#ifdef CONFIG_PM
static int tegra_nvavp_suspend(struct nvhost_device *ndev, pm_message_t state)
{
+ struct nvavp_info *nvavp = nvhost_get_drvdata(ndev);
+
+ if (nvavp->refcount)
+ nvhost_module_idle(&ndev->host->mod);
return 0;
}
static int tegra_nvavp_resume(struct nvhost_device *ndev)
{
+ struct nvavp_info *nvavp = nvhost_get_drvdata(ndev);
+
+ if (nvavp->refcount)
+ nvhost_module_busy(&ndev->host->mod);
return 0;
}
#endif