mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 05:17:10 +09:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user