From 1d8fdf56959240622073dd771dd9bfccf31b8f8e Mon Sep 17 00:00:00 2001 From: Bharat Nihalani Date: Fri, 29 May 2015 16:26:23 +0530 Subject: Revert "Revert "Revert "gpu: nvgpu: New allocator for VA space""" This reverts commit ce1cf06b9a8eb6314ba0ca294e8cb430e1e141c0 since it causes GPU pbdma interrupt to be generated. Bug 200106514 Change-Id: If3ed9a914c4e3e7f3f98c6609c6dbf57e1eb9aad Signed-off-by: Bharat Nihalani Reviewed-on: http://git-master/r/749291 --- drivers/gpu/nvgpu/gk20a/as_gk20a.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/as_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c index eb18fa65..63569008 100644 --- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c @@ -199,14 +199,21 @@ static int gk20a_as_ioctl_get_va_regions( for (i = 0; i < write_entries; ++i) { struct nvgpu_as_va_region region; + u32 base, limit; memset(®ion, 0, sizeof(struct nvgpu_as_va_region)); + if (!vm->vma[i].constraint.enable) { + base = vm->vma[i].base; + limit = vm->vma[i].limit; + } else { + base = vm->vma[i].constraint.base; + limit = vm->vma[i].constraint.limit; + } + region.page_size = vm->gmmu_page_sizes[i]; - region.offset = vm->vma[i].base; - /* No __aeabi_uldivmod() on some platforms... */ - region.pages = (vm->vma[i].end - vm->vma[i].start) >> - ilog2(region.page_size); + region.offset = (u64)base * region.page_size; + region.pages = limit - base; /* NOTE: limit is exclusive */ if (copy_to_user(user_region_ptr + i, ®ion, sizeof(region))) return -EFAULT; -- cgit v1.2.2