diff options
author | Bharat Nihalani <bnihalani@nvidia.com> | 2015-05-29 06:56:23 -0400 |
---|---|---|
committer | Bharat Nihalani <bnihalani@nvidia.com> | 2015-06-02 23:18:55 -0400 |
commit | 1d8fdf56959240622073dd771dd9bfccf31b8f8e (patch) | |
tree | 5c670e604825ddc25d6b6b0cce32cb3e7dc6871a /drivers/gpu/nvgpu/gk20a/as_gk20a.c | |
parent | 38cee4d7effe5a2079a08b3c9a216b3197893959 (diff) |
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 <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/749291
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/as_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/as_gk20a.c | 15 |
1 files changed, 11 insertions, 4 deletions
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( | |||
199 | 199 | ||
200 | for (i = 0; i < write_entries; ++i) { | 200 | for (i = 0; i < write_entries; ++i) { |
201 | struct nvgpu_as_va_region region; | 201 | struct nvgpu_as_va_region region; |
202 | u32 base, limit; | ||
202 | 203 | ||
203 | memset(®ion, 0, sizeof(struct nvgpu_as_va_region)); | 204 | memset(®ion, 0, sizeof(struct nvgpu_as_va_region)); |
204 | 205 | ||
206 | if (!vm->vma[i].constraint.enable) { | ||
207 | base = vm->vma[i].base; | ||
208 | limit = vm->vma[i].limit; | ||
209 | } else { | ||
210 | base = vm->vma[i].constraint.base; | ||
211 | limit = vm->vma[i].constraint.limit; | ||
212 | } | ||
213 | |||
205 | region.page_size = vm->gmmu_page_sizes[i]; | 214 | region.page_size = vm->gmmu_page_sizes[i]; |
206 | region.offset = vm->vma[i].base; | 215 | region.offset = (u64)base * region.page_size; |
207 | /* No __aeabi_uldivmod() on some platforms... */ | 216 | region.pages = limit - base; /* NOTE: limit is exclusive */ |
208 | region.pages = (vm->vma[i].end - vm->vma[i].start) >> | ||
209 | ilog2(region.page_size); | ||
210 | 217 | ||
211 | if (copy_to_user(user_region_ptr + i, ®ion, sizeof(region))) | 218 | if (copy_to_user(user_region_ptr + i, ®ion, sizeof(region))) |
212 | return -EFAULT; | 219 | return -EFAULT; |