summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/as_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-03-11 18:57:42 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-03-25 16:19:17 -0400
commitfbc21ed2ee1859dfe1814914a7b9367eee6b9f3d (patch)
tree4792971895aca65f74a5480e82d67e7f312151a8 /drivers/gpu/nvgpu/gk20a/as_gk20a.c
parent907a43831513c2863e2f7fefc2d051f396d02354 (diff)
gpu: nvgpu: split address space for fixed allocs
Allow a special address space node to be split out from the user adress space or fixed allocations. A debugfs node, /d/<gpu>/separate_fixed_allocs Controls this feature. To enable it: # echo <SPLIT_ADDR> > /d/<gpu>/separate_fixed_allocs Where <SPLIT_ADDR> is the address to do the split on in the GVA address range. This will cause the split to be made in all subsequent address space ranges that get created until it is turned off. To turn this off just echo 0x0 into the same debugfs node. Change-Id: I21a3f051c635a90a6bfa8deae53a54db400876f9 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1030303 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/as_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/as_gk20a.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c
index b6b38541..0571ca1f 100644
--- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c
@@ -279,13 +279,15 @@ static int gk20a_as_ioctl_get_va_regions(
279 279
280 for (i = 0; i < write_entries; ++i) { 280 for (i = 0; i < write_entries; ++i) {
281 struct nvgpu_as_va_region region; 281 struct nvgpu_as_va_region region;
282 struct gk20a_allocator *vma = vm->fixed.init ?
283 &vm->fixed : &vm->vma[i];
282 284
283 memset(&region, 0, sizeof(struct nvgpu_as_va_region)); 285 memset(&region, 0, sizeof(struct nvgpu_as_va_region));
284 286
285 region.page_size = vm->gmmu_page_sizes[i]; 287 region.page_size = vm->gmmu_page_sizes[i];
286 region.offset = vm->vma[i].base; 288 region.offset = vma->base;
287 /* No __aeabi_uldivmod() on some platforms... */ 289 /* No __aeabi_uldivmod() on some platforms... */
288 region.pages = (vm->vma[i].end - vm->vma[i].start) >> 290 region.pages = (vma->end - vma->start) >>
289 ilog2(region.page_size); 291 ilog2(region.page_size);
290 292
291 if (copy_to_user(user_region_ptr + i, &region, sizeof(region))) 293 if (copy_to_user(user_region_ptr + i, &region, sizeof(region)))