diff options
author | Mayuresh Kulkarni <mkulkarni@nvidia.com> | 2012-05-14 14:38:22 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-05-17 06:13:18 -0700 |
commit | a3b39fa6020e7c53236a50bbda1ca0a2ab78b2c2 (patch) | |
tree | 26fcb40c85645ef6ad1004ee65a3e28da8061288 /drivers/video/tegra/host/dev.c | |
parent | e6ce6a3069e2a83c0343d6de8656aee95c6b49f3 (diff) |
video: tegra: host: remove nvhost_channel from nvhost_master
- nvhost_master holds a reference to all the channels for
a chip architecture
- however, nvhost_master is a private data of host1x hardware
device. so it should contain only members needed by host1x
hardware device
- add chip specific apis to allocate and free channels
- this will also help to remove the static binding between
nvhost_device and a channel per SoC in future
Bug 871237
Change-Id: I2148db57b995b4cb60954ebb6e670f588552eca4
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/91687
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/dev.c')
-rw-r--r-- | drivers/video/tegra/host/dev.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c index 9142b52f72f2..f215b532d2bb 100644 --- a/drivers/video/tegra/host/dev.c +++ b/drivers/video/tegra/host/dev.c @@ -353,14 +353,23 @@ fail: struct nvhost_device *nvhost_get_device(char *name) { BUG_ON(!host_device_op().get_nvhost_device); - return host_device_op().get_nvhost_device(nvhost, name); + return host_device_op().get_nvhost_device(name); } -static void nvhost_free_resources(struct nvhost_master *host) +struct nvhost_channel *nvhost_alloc_channel(int index) +{ + BUG_ON(!host_device_op().alloc_nvhost_channel); + return host_device_op().alloc_nvhost_channel(index); +} + +void nvhost_free_channel(struct nvhost_channel *ch) { - kfree(host->channels); - host->channels = 0; + BUG_ON(!host_device_op().free_nvhost_channel); + host_device_op().free_nvhost_channel(ch); +} +static void nvhost_free_resources(struct nvhost_master *host) +{ kfree(host->intr.syncpt); host->intr.syncpt = 0; } @@ -373,14 +382,10 @@ static int __devinit nvhost_alloc_resources(struct nvhost_master *host) if (err) return err; - /* allocate items sized in chip specific support init */ - host->channels = kzalloc(sizeof(struct nvhost_channel) * - host->nb_channels, GFP_KERNEL); - host->intr.syncpt = kzalloc(sizeof(struct nvhost_intr_syncpt) * host->syncpt.nb_pts, GFP_KERNEL); - if (!(host->channels && host->intr.syncpt)) { + if (!host->intr.syncpt) { /* frees happen in the support removal phase */ return -ENOMEM; } |