diff options
author | Bharat Nihalani <bnihalani@nvidia.com> | 2015-06-04 08:08:59 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-06-04 13:41:00 -0400 |
commit | b8aa486109a43a8c92159b0845a4adc9f6a84654 (patch) | |
tree | 9086e63713df6a63d4ad152503c49e238d23c7d3 /drivers/gpu/nvgpu/vgpu | |
parent | 56d7896731c91595db3205777f308fbcaeac7340 (diff) |
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 <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/752503
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/ltc_vgpu.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/mm_vgpu.c | 36 |
2 files changed, 16 insertions, 25 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/ltc_vgpu.c b/drivers/gpu/nvgpu/vgpu/ltc_vgpu.c index 1beac216..211e34b5 100644 --- a/drivers/gpu/nvgpu/vgpu/ltc_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/ltc_vgpu.c | |||
@@ -41,9 +41,8 @@ static int vgpu_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) | |||
41 | if (max_comptag_lines < 2) | 41 | if (max_comptag_lines < 2) |
42 | return -ENXIO; | 42 | return -ENXIO; |
43 | 43 | ||
44 | gk20a_allocator_init(&gr->comp_tags, "comptag", | 44 | __gk20a_allocator_init(&gr->comp_tags, NULL, "comptag", |
45 | 1, /* start */ | 45 | 1, max_comptag_lines - 1, 1, 10, 0); /* length*/ |
46 | max_comptag_lines - 1); /* length*/ | ||
47 | return 0; | 46 | return 0; |
48 | } | 47 | } |
49 | 48 | ||
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c index 94e4602f..855aac0d 100644 --- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c | |||
@@ -243,11 +243,9 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share, | |||
243 | struct tegra_vgpu_as_share_params *p = &msg.params.as_share; | 243 | struct tegra_vgpu_as_share_params *p = &msg.params.as_share; |
244 | struct mm_gk20a *mm = &g->mm; | 244 | struct mm_gk20a *mm = &g->mm; |
245 | struct vm_gk20a *vm; | 245 | struct vm_gk20a *vm; |
246 | u32 num_small_pages, num_large_pages, low_hole_pages; | ||
247 | u64 small_vma_size, large_vma_size; | 246 | u64 small_vma_size, large_vma_size; |
248 | char name[32]; | 247 | char name[32]; |
249 | int err, i; | 248 | int err, i; |
250 | u32 start; | ||
251 | 249 | ||
252 | /* note: keep the page sizes sorted lowest to highest here */ | 250 | /* note: keep the page sizes sorted lowest to highest here */ |
253 | u32 gmmu_page_sizes[gmmu_nr_page_sizes] = { | 251 | u32 gmmu_page_sizes[gmmu_nr_page_sizes] = { |
@@ -294,33 +292,27 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share, | |||
294 | small_vma_size = (u64)16 << 30; | 292 | small_vma_size = (u64)16 << 30; |
295 | large_vma_size = vm->va_limit - small_vma_size; | 293 | large_vma_size = vm->va_limit - small_vma_size; |
296 | 294 | ||
297 | num_small_pages = (u32)(small_vma_size >> | ||
298 | ilog2(vm->gmmu_page_sizes[gmmu_page_size_small])); | ||
299 | |||
300 | /* num_pages above is without regard to the low-side hole. */ | ||
301 | low_hole_pages = (vm->va_start >> | ||
302 | ilog2(vm->gmmu_page_sizes[gmmu_page_size_small])); | ||
303 | |||
304 | snprintf(name, sizeof(name), "gk20a_as_%d-%dKB", as_share->id, | 295 | snprintf(name, sizeof(name), "gk20a_as_%d-%dKB", as_share->id, |
305 | gmmu_page_sizes[gmmu_page_size_small]>>10); | 296 | gmmu_page_sizes[gmmu_page_size_small]>>10); |
306 | err = gk20a_allocator_init(&vm->vma[gmmu_page_size_small], | 297 | err = __gk20a_allocator_init(&vm->vma[gmmu_page_size_small], |
307 | name, | 298 | vm, name, |
308 | low_hole_pages, /*start*/ | 299 | vm->va_start, |
309 | num_small_pages - low_hole_pages);/* length*/ | 300 | small_vma_size - vm->va_start, |
301 | SZ_4K, | ||
302 | GPU_BALLOC_MAX_ORDER, | ||
303 | GPU_BALLOC_GVA_SPACE); | ||
310 | if (err) | 304 | if (err) |
311 | goto clean_up_share; | 305 | goto clean_up_share; |
312 | 306 | ||
313 | start = (u32)(small_vma_size >> | ||
314 | ilog2(vm->gmmu_page_sizes[gmmu_page_size_big])); | ||
315 | num_large_pages = (u32)(large_vma_size >> | ||
316 | ilog2(vm->gmmu_page_sizes[gmmu_page_size_big])); | ||
317 | |||
318 | snprintf(name, sizeof(name), "gk20a_as_%d-%dKB", as_share->id, | 307 | snprintf(name, sizeof(name), "gk20a_as_%d-%dKB", as_share->id, |
319 | gmmu_page_sizes[gmmu_page_size_big]>>10); | 308 | gmmu_page_sizes[gmmu_page_size_big]>>10); |
320 | err = gk20a_allocator_init(&vm->vma[gmmu_page_size_big], | 309 | err = __gk20a_allocator_init(&vm->vma[gmmu_page_size_big], |
321 | name, | 310 | vm, name, |
322 | start, /* start */ | 311 | small_vma_size, |
323 | num_large_pages); /* length */ | 312 | large_vma_size, |
313 | big_page_size, | ||
314 | GPU_BALLOC_MAX_ORDER, | ||
315 | GPU_BALLOC_GVA_SPACE); | ||
324 | if (err) | 316 | if (err) |
325 | goto clean_up_small_allocator; | 317 | goto clean_up_small_allocator; |
326 | 318 | ||