summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/dev.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2012-02-21 10:21:18 +0200
committerSimone Willett <swillett@nvidia.com>2012-03-15 20:08:56 -0700
commitae5255b1fdd60fda4c31aab929de5c9b395ed064 (patch)
tree147fc8acd0375d4f3400b24f7438dd34c4dc68bb /drivers/video/tegra/host/dev.c
parent2be9ecb9df0fd3861cb33278a28c71447a0eee0b (diff)
video: tegra: host: Refactor context handling logic
Currently nvhost hard codes usage of context handler and sync point id. Split the context handler and context structures into generic and host1x specific parts, and move the allocation to happen via a function pointer in nvhost_device. Also updates gr3d and mpe to use sync point id and waitbase from nvhost_device. Bug 926690 Change-Id: I7f00b450cac99f3816baa27b37ee4e4cf68cfe24 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/84901 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/dev.c')
-rw-r--r--drivers/video/tegra/host/dev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c
index 38efa0975a2e..4ab0f1e0c106 100644
--- a/drivers/video/tegra/host/dev.c
+++ b/drivers/video/tegra/host/dev.c
@@ -125,7 +125,7 @@ static int nvhost_channelrelease(struct inode *inode, struct file *filp)
nvhost_putchannel(priv->ch, priv->hwctx);
if (priv->hwctx)
- priv->ch->ctxhandler.put(priv->hwctx);
+ priv->ch->ctxhandler->put(priv->hwctx);
if (priv->job)
nvhost_job_put(priv->job);
@@ -155,8 +155,8 @@ static int nvhost_channelopen(struct inode *inode, struct file *filp)
priv->ch = ch;
nvhost_module_add_client(ch->dev, priv);
- if (ch->ctxhandler.alloc) {
- priv->hwctx = ch->ctxhandler.alloc(ch);
+ if (ch->ctxhandler && ch->ctxhandler->alloc) {
+ priv->hwctx = ch->ctxhandler->alloc(ch->ctxhandler, ch);
if (!priv->hwctx)
goto fail;
}