summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/as_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/as_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/as_gk20a.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c
index 0571ca1f..8144ec6e 100644
--- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c
@@ -279,16 +279,17 @@ static int gk20a_as_ioctl_get_va_regions(
279 279
280 for (i = 0; i < write_entries; ++i) { 280 for (i = 0; i < write_entries; ++i) {
281 struct nvgpu_as_va_region region; 281 struct nvgpu_as_va_region region;
282 struct gk20a_allocator *vma = vm->fixed.init ? 282 struct gk20a_allocator *vma =
283 gk20a_alloc_initialized(&vm->fixed) ?
283 &vm->fixed : &vm->vma[i]; 284 &vm->fixed : &vm->vma[i];
284 285
285 memset(&region, 0, sizeof(struct nvgpu_as_va_region)); 286 memset(&region, 0, sizeof(struct nvgpu_as_va_region));
286 287
287 region.page_size = vm->gmmu_page_sizes[i]; 288 region.page_size = vm->gmmu_page_sizes[i];
288 region.offset = vma->base; 289 region.offset = gk20a_alloc_base(vma);
289 /* No __aeabi_uldivmod() on some platforms... */ 290 /* No __aeabi_uldivmod() on some platforms... */
290 region.pages = (vma->end - vma->start) >> 291 region.pages = (gk20a_alloc_end(vma) -
291 ilog2(region.page_size); 292 gk20a_alloc_base(vma)) >> ilog2(region.page_size);
292 293
293 if (copy_to_user(user_region_ptr + i, &region, sizeof(region))) 294 if (copy_to_user(user_region_ptr + i, &region, sizeof(region)))
294 return -EFAULT; 295 return -EFAULT;