video: tegra: nvmap: Use nvmap.h include file from kernel/include
[linux-2.6.git] / drivers / video / tegra / nvmap / nvmap_dev.c
index c353505..c788187 100644 (file)
@@ -3,7 +3,7 @@
  *
  * User-space interface to nvmap
  *
- * Copyright (c) 2011, NVIDIA Corporation.
+ * Copyright (c) 2011-2012, NVIDIA Corporation.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@
 #include <asm/tlbflush.h>
 
 #include <mach/iovmm.h>
-#include <mach/nvmap.h>
+#include <linux/nvmap.h>
 
 #include "nvmap.h"
 #include "nvmap_ioctl.h"
@@ -983,11 +983,11 @@ 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 %8lx\n", "", "",
+                       seq_printf(s, "%-18s %-18s %8lx %10u %8x\n", "", "",
                                        (unsigned long)(handle->carveout->base),
                                        handle->size, handle->userflags);
                } else if (handle->alloc && handle->heap_pgalloc) {
-                       seq_printf(s, "%-18s %-18s %8lx %10u %8lx\n", "", "",
+                       seq_printf(s, "%-18s %-18s %8lx %10u %8x\n", "", "",
                                        base, handle->size, handle->userflags);
                }
        }
@@ -1182,6 +1182,11 @@ static int nvmap_probe(struct platform_device *pdev)
 
        init_waitqueue_head(&dev->iovmm_master.pin_wait);
        mutex_init(&dev->iovmm_master.pin_lock);
+#ifdef CONFIG_NVMAP_PAGE_POOLS
+       for (i = 0; i < NVMAP_NUM_POOLS; i++)
+               nvmap_page_pool_init(&dev->iovmm_master.pools[i], i);
+#endif
+
        dev->iovmm_master.iovmm =
                tegra_iovmm_alloc_client(dev_name(&pdev->dev), NULL,
                        &(dev->dev_user));
@@ -1308,6 +1313,18 @@ static int nvmap_probe(struct platform_device *pdev)
                                dev, &debug_iovmm_clients_fops);
                        debugfs_create_file("allocations", 0664, iovmm_root,
                                dev, &debug_iovmm_allocations_fops);
+#ifdef CONFIG_NVMAP_PAGE_POOLS
+                       for (i = 0; i < NVMAP_NUM_POOLS; i++) {
+                               char name[40];
+                               char *memtype_string[] = {"uc", "wc",
+                                                         "iwb", "wb"};
+                               sprintf(name, "%s_page_pool_available_pages",
+                                       memtype_string[i]);
+                               debugfs_create_u32(name, S_IRUGO|S_IWUSR,
+                                       iovmm_root,
+                                       &dev->iovmm_master.pools[i].npages);
+                       }
+#endif
                }
        }