summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-12-21 14:14:19 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-31 19:23:07 -0500
commit793791ebb7ddbb34f0aaf3e300b24ed24aa76661 (patch)
tree4f24f255fb8df2b0bd1b52a752b4a86f8d137d61 /drivers
parentdddeee54b640e4c28866354b7f2e4edd907e3344 (diff)
gpu: nvgpu: use map_offset for PTE size computation
Make sure that map_offset is set to the fixed map address or 0) before determining PTE size. Then use map_offset instead of offset_align for computing the PTE size since offset_align could be either an alignment ora fixed mapping offset. Also is the minimum of the buffer size and the buffer alignment for computing page size. This is necessary is the GMMU is doing page gathering (i.e the buffer does not appear as a continguous IOMMU range to the GPU). Is such cases a large page sized buffer may be made up of a bunch of discontiguous 4k pages. Bug 1396644 Bug 1729947 Change-Id: I6464ee6a4ccab2495ccb31cd1ddf1db467d2b215 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1271359 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 0e3eabc7..cdbaef79 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -2479,9 +2479,12 @@ u64 gk20a_vm_map(struct vm_gk20a *vm,
2479 goto clean_up; 2479 goto clean_up;
2480 } 2480 }
2481 2481
2482 bfr.align = gk20a_mm_get_align(g, sgl, aperture); 2482 if (flags & NVGPU_AS_MAP_BUFFER_FLAGS_FIXED_OFFSET)
2483 map_offset = offset_align;
2483 2484
2484 bfr.pgsz_idx = -1; 2485 bfr.align = gk20a_mm_get_align(g, sgl, aperture);
2486 bfr.pgsz_idx = __get_pte_size(vm, map_offset,
2487 min_t(u64, bfr.size, bfr.align));
2485 mapping_size = mapping_size ? mapping_size : bfr.size; 2488 mapping_size = mapping_size ? mapping_size : bfr.size;
2486 2489
2487 if (vm->big_pages) 2490 if (vm->big_pages)