diff options
author | Rebecca Schultz Zavin <rebecca@android.com> | 2010-11-04 14:12:37 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:36:37 -0800 |
commit | ec87a7c63aa764c800318476740727a633ffb806 (patch) | |
tree | e7708ed10d755086100ff7eb3fedae8fdbee67f4 /drivers/video/tegra/nvmap | |
parent | 6eaa9e9c71eeec6dead39a12d07d15b8f27daa5b (diff) |
video: tegra: nvmap: Add names to nvmap client
This modifies the api to allow the user to specify a name
for their clients. This will allow the system to track
allocations from the kernel by name.
Change-Id: I44aad209bc54e72126be3bebfe416b30291d206c
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Diffstat (limited to 'drivers/video/tegra/nvmap')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap.h | 1 | ||||
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_dev.c | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.h b/drivers/video/tegra/nvmap/nvmap.h index 1e5b800baf7a..9bb7da77a501 100644 --- a/drivers/video/tegra/nvmap/nvmap.h +++ b/drivers/video/tegra/nvmap/nvmap.h @@ -100,6 +100,7 @@ struct nvmap_carveout_commit { }; struct nvmap_client { + const char *name; struct nvmap_device *dev; struct nvmap_share *share; struct rb_root handle_refs; diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c index cbf126bafe60..a899bb4ef1b9 100644 --- a/drivers/video/tegra/nvmap/nvmap_dev.c +++ b/drivers/video/tegra/nvmap/nvmap_dev.c @@ -427,7 +427,8 @@ struct nvmap_handle *nvmap_validate_get(struct nvmap_client *client, return NULL; } -struct nvmap_client *nvmap_create_client(struct nvmap_device *dev) +struct nvmap_client *nvmap_create_client(struct nvmap_device *dev, + const char *name) { struct nvmap_client *client; int i; @@ -440,6 +441,7 @@ struct nvmap_client *nvmap_create_client(struct nvmap_device *dev) if (!client) return NULL; + client->name = name; client->super = true; client->dev = dev; /* TODO: allocate unique IOVMM client for each nvmap client */ @@ -554,7 +556,7 @@ static int nvmap_open(struct inode *inode, struct file *filp) return ret; BUG_ON(dev != nvmap_dev); - priv = nvmap_create_client(dev); + priv = nvmap_create_client(dev, "user"); if (!priv) return -ENOMEM; @@ -755,7 +757,8 @@ static void client_stringify(struct nvmap_client *client, struct seq_file *s) { char task_comm[sizeof(client->task->comm)]; get_task_comm(task_comm, client->task); - seq_printf(s, "%16s %8u", task_comm, client->task->pid); + seq_printf(s, "%8s %16s %8u", client->name, task_comm, + client->task->pid); } static void allocations_stringify(struct nvmap_client *client, |