]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: nvmap: fix incorrect use of pgalloc.contig
authorKrishna Reddy <vdumpa@nvidia.com>
Fri, 11 Apr 2014 00:43:25 +0000 (17:43 -0700)
committerKrishna Reddy <vdumpa@nvidia.com>
Fri, 11 Apr 2014 05:31:11 +0000 (22:31 -0700)
Fix incorrect use of pgalloc.contig flag.

Change-Id: Id207053d5a9df43bf44ba96421903ce2ef2256a6
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/394931

drivers/video/tegra/nvmap/nvmap.c
drivers/video/tegra/nvmap/nvmap_handle.c
drivers/video/tegra/nvmap/nvmap_ioctl.c

index a0cd97eff47f8210771ee04f33d1fa4688af2fce..ea34a1957d5a9253dbaadb4a847a91dee2b47ee3 100644 (file)
@@ -46,9 +46,7 @@ static phys_addr_t handle_phys(struct nvmap_handle *h)
 {
        phys_addr_t addr;
 
-       if (h->heap_pgalloc && h->pgalloc.contig) {
-               addr = page_to_phys(h->pgalloc.pages[0]);
-       } else if (h->heap_pgalloc) {
+       if (h->heap_pgalloc) {
                BUG_ON(!h->attachment->priv);
                addr = sg_dma_address(
                                ((struct sg_table *)h->attachment->priv)->sgl);
index 6c3f457e2f0b96497f3088df94ab3ac813dd1030..b92660794cc00c3fd37eec66bb2e67ecbdfbbcba 100644 (file)
@@ -409,8 +409,8 @@ void nvmap_free_handle(struct nvmap_client *client,
        rb_erase(&ref->node, &client->handle_refs);
        client->handle_count--;
 
-       if (h->alloc && h->heap_pgalloc && !h->pgalloc.contig)
-               atomic_sub_return(h->size, &client->iovm_commit);
+       if (h->alloc && h->heap_pgalloc)
+               atomic_sub(h->size, &client->iovm_commit);
 
        if (h->alloc && !h->heap_pgalloc) {
                mutex_lock(&h->lock);
@@ -590,7 +590,7 @@ struct nvmap_handle_ref *nvmap_duplicate_handle(struct nvmap_client *client,
                        nvmap_heap_to_arg(nvmap_block_to_heap(h->carveout)),
                        h->size);
                mutex_unlock(&h->lock);
-       } else if (!h->pgalloc.contig) {
+       } else {
                atomic_add(h->size, &client->iovm_commit);
        }
 
@@ -764,9 +764,7 @@ int __nvmap_get_handle_param(struct nvmap_client *client,
                        mutex_lock(&h->lock);
                        *result = h->carveout->base;
                        mutex_unlock(&h->lock);
-               } else if (h->pgalloc.contig)
-                       *result = page_to_phys(h->pgalloc.pages[0]);
-               else if (h->attachment->priv)
+               } else if (h->attachment->priv)
                        *result = sg_dma_address(
                                ((struct sg_table *)h->attachment->priv)->sgl);
                else
index fdfbd6abd43004d360315051d7633ad6a89427bb..3c124de56f0cc15fd6eff21b17f593afbff71b95 100644 (file)
@@ -211,9 +211,7 @@ int nvmap_ioctl_pinop(struct file *filp, bool is_pin, void __user *arg,
                unsigned long addr;
 
                h = refs[i];
-               if (h->heap_pgalloc && h->pgalloc.contig)
-                       addr = page_to_phys(h->pgalloc.pages[0]);
-               else if (h->heap_pgalloc)
+               if (h->heap_pgalloc)
                        addr = sg_dma_address(
                                ((struct sg_table *)h->attachment->priv)->sgl);
                else