]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: nvmap: skip iova gap
authorSri Krishna chowdary <schowdary@nvidia.com>
Wed, 5 Mar 2014 05:24:00 +0000 (10:54 +0530)
committerHiroshi Doyu <hdoyu@nvidia.com>
Fri, 7 Mar 2014 05:43:11 +0000 (21:43 -0800)
GPU maps chunks that are 258 pages (~1.008 MB) and these get aligned
on 2MB boundaries. So, for each 1MB texture, another 1MB of address space
is lost.
This change skips the iova gap pages from being mapped.
So for each 1 MB texture, only 1 MB of address space is used.

This reverts commit 19856f036d3316d8ef73ffb2a9f7fc0c9ca2f1a6.
This change is same as http://git-master/r/#/c/363230/.

Bug 1433460

Change-Id: I4c6515f1dad33a95b09ffc8329c4392c9e3c635a
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/377560
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com>
Tested-by: Hiroshi Doyu <hdoyu@nvidia.com>
drivers/video/tegra/nvmap/nvmap_dmabuf.c

index 124bd5aa0ff36a3e8f3596cab42f88e68f1630d8..370a6c702b262a482fbc91eb3eb8a0471cec7f4c 100644 (file)
@@ -207,6 +207,7 @@ static void __nvmap_dmabuf_free_sgt_locked(struct nvmap_handle_sgt *nvmap_sgt)
        list_del(&nvmap_sgt->maps_entry);
 
        if (info->handle->heap_pgalloc) {
+               dma_set_attr(DMA_ATTR_SKIP_IOVA_GAP, &attrs);
                dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs);
                dma_unmap_sg_attrs(nvmap_sgt->dev,
                                   nvmap_sgt->sgt->sgl, nvmap_sgt->sgt->nents,
@@ -365,6 +366,7 @@ static struct sg_table *nvmap_dmabuf_map_dma_buf(
        }
 
        if (info->handle->heap_pgalloc && info->handle->alloc) {
+               dma_set_attr(DMA_ATTR_SKIP_IOVA_GAP, &attrs);
                dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs);
                ents = dma_map_sg_attrs(attach->dev, sgt->sgl,
                                        sgt->nents, dir, &attrs);