diff options
author | Alex Waterman <alexw@nvidia.com> | 2015-05-15 12:13:28 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-05-19 16:09:00 -0400 |
commit | 01f359f3f1bbf95d7ac4453a6c1de811bf0aee11 (patch) | |
tree | c35c928fcacaae7be13b4601538032dae9f672c6 /drivers/gpu/nvgpu/gk20a/as_gk20a.c | |
parent | 7ddd6e261ed620dbb388202be89ca4e6843e3947 (diff) |
Revert "Revert "gpu: nvgpu: New allocator for VA space""
This reverts commit 7eb42bc239dbd207208ff491c3fb65c3d83274d8.
The original commit was actually fine.
Change-Id: I564ce6530ac73fcfad17dcec9c53f0353b4f02d4
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/743300
(cherry picked from commit e99aa2485f8992eabe3556f3ebcb57bdc8ad91ff)
Reviewed-on: http://git-master/r/743301
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-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.c | 15 |
1 files changed, 4 insertions, 11 deletions
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( | |||
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; | ||
203 | 202 | ||
204 | memset(®ion, 0, sizeof(struct nvgpu_as_va_region)); | 203 | memset(®ion, 0, sizeof(struct nvgpu_as_va_region)); |
205 | 204 | ||
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 | |||
214 | region.page_size = vm->gmmu_page_sizes[i]; | 205 | region.page_size = vm->gmmu_page_sizes[i]; |
215 | region.offset = (u64)base * region.page_size; | 206 | region.offset = vm->vma[i].base; |
216 | region.pages = limit - base; /* NOTE: limit is exclusive */ | 207 | /* No __aeabi_uldivmod() on some platforms... */ |
208 | region.pages = (vm->vma[i].end - vm->vma[i].start) >> | ||
209 | ilog2(region.page_size); | ||
217 | 210 | ||
218 | if (copy_to_user(user_region_ptr + i, ®ion, sizeof(region))) | 211 | if (copy_to_user(user_region_ptr + i, ®ion, sizeof(region))) |
219 | return -EFAULT; | 212 | return -EFAULT; |