summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/nvmap
diff options
context:
space:
mode:
authorKirill Artamonov <kartamonov@nvidia.com>2011-11-01 16:37:14 +0200
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:50:12 -0800
commit1b033e7882422714d4afe8bd621a8628aa05db40 (patch)
treeef501c12265b9a2c08b19c84f354b8e9035b1ff6 /drivers/video/tegra/nvmap
parent9e9acaf50905ad1c485123b98368f3169bf4b17d (diff)
video: tegra: nvmap: expose allocation flags in debugfs
Allocation flags provide useful information about how allocations were created. Expose allocation flags in allocation debugfs list. bug 882345 bug 889003 Reviewed-on: http://git-master/r/61517 (cherry picked from commit 5100f1b09584f079a1547f65ac8b49b27df73292) Signed-off-by: Kirill Artamonov <kartamonov@nvidia.com> Change-Id: I2aed0150fe76791550daa1f37d1b5a238af50e1e Reviewed-on: http://git-master/r/64939 Reviewed-by: Kirill Artamonov <kartamonov@nvidia.com> Tested-by: Kirill Artamonov <kartamonov@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: R38ccb94a1d41207b1fe92d345e626963912b2379
Diffstat (limited to 'drivers/video/tegra/nvmap')
-rw-r--r--drivers/video/tegra/nvmap/nvmap.h1
-rw-r--r--drivers/video/tegra/nvmap/nvmap_dev.c12
-rw-r--r--drivers/video/tegra/nvmap/nvmap_handle.c1
3 files changed, 8 insertions, 6 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.h b/drivers/video/tegra/nvmap/nvmap.h
index d8e66567aa5d..037814d2e756 100644
--- a/drivers/video/tegra/nvmap/nvmap.h
+++ b/drivers/video/tegra/nvmap/nvmap.h
@@ -84,6 +84,7 @@ struct nvmap_handle {
bool secure; /* zap IOVMM area on unpin */
bool heap_pgalloc; /* handle is page allocated (sysmem / iovmm) */
bool alloc; /* handle has memory allocated */
+ unsigned int userflags; /* flags passed from userspace */
struct mutex lock;
};
diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c
index c3a5f7f0de36..a5b6e9e5ba77 100644
--- a/drivers/video/tegra/nvmap/nvmap_dev.c
+++ b/drivers/video/tegra/nvmap/nvmap_dev.c
@@ -983,12 +983,12 @@ static void allocations_stringify(struct nvmap_client *client,
rb_entry(n, struct nvmap_handle_ref, node);
struct nvmap_handle *handle = ref->handle;
if (handle->alloc && !handle->heap_pgalloc) {
- seq_printf(s, "%-18s %-18s %8lx %10u\n", "", "",
+ seq_printf(s, "%-18s %-18s %8lx %10u %8lx\n", "", "",
(unsigned long)(handle->carveout->base),
- handle->size);
+ handle->size, handle->userflags);
} else if (handle->alloc && handle->heap_pgalloc) {
- seq_printf(s, "%-18s %-18s %8lx %10u\n", "", "",
- base, handle->size);
+ seq_printf(s, "%-18s %-18s %8lx %10u %8lx\n", "", "",
+ base, handle->size, handle->userflags);
}
}
}
@@ -1001,8 +1001,8 @@ static int nvmap_debug_allocations_show(struct seq_file *s, void *unused)
unsigned int total = 0;
spin_lock_irqsave(&node->clients_lock, flags);
- seq_printf(s, "%-18s %18s %8s %10s\n", "CLIENT", "PROCESS", "PID",
- "SIZE");
+ seq_printf(s, "%-18s %18s %8s %10s %8s\n", "CLIENT", "PROCESS", "PID",
+ "SIZE", "FLAGS");
seq_printf(s, "%-18s %18s %8s %10s\n", "", "",
"BASE", "SIZE");
list_for_each_entry(commit, &node->clients, list) {
diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c
index a1c5b956efc9..4a0709c55581 100644
--- a/drivers/video/tegra/nvmap/nvmap_handle.c
+++ b/drivers/video/tegra/nvmap/nvmap_handle.c
@@ -344,6 +344,7 @@ int nvmap_alloc_handle_id(struct nvmap_client *client,
if (h->alloc)
goto out;
+ h->userflags = flags;
nr_page = ((h->size + PAGE_SIZE - 1) >> PAGE_SHIFT);
h->secure = !!(flags & NVMAP_HANDLE_SECURE);
h->flags = (flags & NVMAP_HANDLE_CACHE_FLAG);