From b8aa486109a43a8c92159b0845a4adc9f6a84654 Mon Sep 17 00:00:00 2001 From: Bharat Nihalani Date: Thu, 4 Jun 2015 05:08:59 -0700 Subject: Revert "Revert "Revert "Revert "gpu: nvgpu: New allocator for VA space"""" This reverts commit 2e5803d0f2b7d7a1577a40f45ab9f3b22ef2df80 since the issue seen with bug 200106514 is fixed with change http://git-master/r/#/c/752080/. Bug 200112195 Change-Id: I588151c2a7ea74bd89dc3fd48bb81ff2c49f5a0a Signed-off-by: Bharat Nihalani Reviewed-on: http://git-master/r/752503 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/as_gk20a.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 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 63569008..eb18fa65 100644 --- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c @@ -199,21 +199,14 @@ 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 = (u64)base * region.page_size; - region.pages = limit - base; /* NOTE: limit is exclusive */ + 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); if (copy_to_user(user_region_ptr + i, ®ion, sizeof(region))) return -EFAULT; -- cgit v1.2.2