summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/t20/t20.c
diff options
context:
space:
mode:
authorMayuresh Kulkarni <mkulkarni@nvidia.com>2012-05-14 14:38:22 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-05-17 06:13:18 -0700
commita3b39fa6020e7c53236a50bbda1ca0a2ab78b2c2 (patch)
tree26fcb40c85645ef6ad1004ee65a3e28da8061288 /drivers/video/tegra/host/t20/t20.c
parente6ce6a3069e2a83c0343d6de8656aee95c6b49f3 (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/t20/t20.c')
-rw-r--r--drivers/video/tegra/host/t20/t20.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/video/tegra/host/t20/t20.c b/drivers/video/tegra/host/t20/t20.c
index 02382cba50b7..673a81cd4966 100644
--- a/drivers/video/tegra/host/t20/t20.c
+++ b/drivers/video/tegra/host/t20/t20.c
@@ -43,7 +43,9 @@
#define NVMODMUTEX_VI (8)
#define NVMODMUTEX_DSI (9)
-#define NVHOST_NUMCHANNELS (NV_HOST1X_CHANNELS - 1)
+#define T20_NVHOST_NUMCHANNELS (NV_HOST1X_CHANNELS - 1)
+
+static int t20_num_alloc_channels = 0;
struct nvhost_device t20_devices[] = {
{
@@ -189,8 +191,6 @@ static int t20_channel_init(struct nvhost_channel *ch,
int nvhost_init_t20_channel_support(struct nvhost_master *host,
struct nvhost_chip_support *op)
{
- host->nb_channels = NVHOST_NUMCHANNELS;
-
op->channel.init = t20_channel_init;
op->channel.submit = host1x_channel_submit;
op->channel.read3dreg = host1x_channel_read_3d_reg;
@@ -198,8 +198,18 @@ int nvhost_init_t20_channel_support(struct nvhost_master *host,
return 0;
}
-struct nvhost_device *t20_get_nvhost_device(struct nvhost_master *host,
- char *name)
+static void t20_free_nvhost_channel(struct nvhost_channel *ch)
+{
+ nvhost_free_channel_internal(ch, &t20_num_alloc_channels);
+}
+
+static struct nvhost_channel *t20_alloc_nvhost_channel(int chindex)
+{
+ return nvhost_alloc_channel_internal(chindex,
+ T20_NVHOST_NUMCHANNELS, &t20_num_alloc_channels);
+}
+
+struct nvhost_device *t20_get_nvhost_device(char *name)
{
int i;
@@ -232,6 +242,10 @@ int nvhost_init_t20_support(struct nvhost_master *host,
err = nvhost_init_t20_intr_support(op);
if (err)
return err;
+
op->nvhost_dev.get_nvhost_device = t20_get_nvhost_device;
+ op->nvhost_dev.alloc_nvhost_channel = t20_alloc_nvhost_channel;
+ op->nvhost_dev.free_nvhost_channel = t20_free_nvhost_channel;
+
return 0;
}