summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Schultz Zavin <rebecca@android.com>2010-11-04 14:12:37 -0700
committerRebecca Schultz Zavin <rebecca@android.com>2010-11-05 12:17:21 -0700
commitc0645e1f9588b135862510da040e0c5d2fb00f5b (patch)
tree2492097e0ce21910894f784eaebfd5cd507cab82
parent7fdc4142721e96a0bbedf2bad87e45fb760f6614 (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>
-rw-r--r--arch/arm/mach-tegra/include/mach/nvmap.h3
-rw-r--r--drivers/video/tegra/nvmap/nvmap.h1
-rw-r--r--drivers/video/tegra/nvmap/nvmap_dev.c9
3 files changed, 9 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/include/mach/nvmap.h b/arch/arm/mach-tegra/include/mach/nvmap.h
index 41f06f532c39..7422d1a44d8a 100644
--- a/arch/arm/mach-tegra/include/mach/nvmap.h
+++ b/arch/arm/mach-tegra/include/mach/nvmap.h
@@ -66,7 +66,8 @@ struct nvmap_pinarray_elem {
__u32 pin_offset;
};
-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_handle_ref *nvmap_alloc(struct nvmap_client *client, size_t size,
size_t align, unsigned int flags);
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,