diff options
author | Krishna Reddy <vdumpa@nvidia.com> | 2014-04-10 17:43:25 -0700 |
---|---|---|
committer | Krishna Reddy <vdumpa@nvidia.com> | 2014-04-10 22:31:11 -0700 |
commit | 7c6faa33b698498a673b5e2599d886a29f2f6ee5 (patch) | |
tree | 462d2f41f1b749c23112a628a60a278402d04e5b /drivers/video | |
parent | a99272f6e83cffd28b231b9d5c0750e9c21f9ccc (diff) |
video: tegra: nvmap: fix incorrect use of pgalloc.contig
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
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap.c | 4 | ||||
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_handle.c | 10 | ||||
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_ioctl.c | 4 |
3 files changed, 6 insertions, 12 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.c b/drivers/video/tegra/nvmap/nvmap.c index a0cd97eff47f..ea34a1957d5a 100644 --- a/drivers/video/tegra/nvmap/nvmap.c +++ b/drivers/video/tegra/nvmap/nvmap.c @@ -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); diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index 6c3f457e2f0b..b92660794cc0 100644 --- a/drivers/video/tegra/nvmap/nvmap_handle.c +++ b/drivers/video/tegra/nvmap/nvmap_handle.c @@ -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 diff --git a/drivers/video/tegra/nvmap/nvmap_ioctl.c b/drivers/video/tegra/nvmap/nvmap_ioctl.c index fdfbd6abd430..3c124de56f0c 100644 --- a/drivers/video/tegra/nvmap/nvmap_ioctl.c +++ b/drivers/video/tegra/nvmap/nvmap_ioctl.c @@ -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 |