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>
This commit is contained in:
Alex Waterman
2016-03-11 15:57:42 -08:00
committed by Terje Bergstrom
parent 907a438315
commit fbc21ed2ee
5 changed files with 66 additions and 7 deletions

View File

@@ -279,13 +279,15 @@ static int gk20a_as_ioctl_get_va_regions(
for (i = 0; i < write_entries; ++i) {
struct nvgpu_as_va_region region;
struct gk20a_allocator *vma = vm->fixed.init ?
&vm->fixed : &vm->vma[i];
memset(&region, 0, sizeof(struct nvgpu_as_va_region));
region.page_size = vm->gmmu_page_sizes[i];
region.offset = vm->vma[i].base;
region.offset = vma->base;
/* No __aeabi_uldivmod() on some platforms... */
region.pages = (vm->vma[i].end - vm->vma[i].start) >>
region.pages = (vma->end - vma->start) >>
ilog2(region.page_size);
if (copy_to_user(user_region_ptr + i, &region, sizeof(region)))