]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: nvmap: expose allocation flags in debugfs
authorKirill Artamonov <kartamonov@nvidia.com>
Tue, 1 Nov 2011 14:37:14 +0000 (16:37 +0200)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 08:21:35 +0000 (01:21 -0700)
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

drivers/video/tegra/nvmap/nvmap.h
drivers/video/tegra/nvmap/nvmap_dev.c
drivers/video/tegra/nvmap/nvmap_handle.c

index d8e66567aa5d90acc454a1341c04e85297109c84..037814d2e756fff63b4ea64500105f525aab95d9 100644 (file)
@@ -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;
 };
 
index c50ac0b6b464fe3fa362dc274194cbec8710a794..4d4e274193a3f9033d6e58a63e68d07a39e97eda 100644 (file)
@@ -984,12 +984,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);
                }
        }
 }
@@ -1002,8 +1002,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) {
index a1c5b956efc9e22f933f5d58647aa123f968b1d3..4a0709c5558153219d589aa660929be83547f248 100644 (file)
@@ -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);