summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-06-24 17:12:24 -0400
committerAlex Waterman <alexw@nvidia.com>2016-07-19 14:21:46 -0400
commitb6569319c772d84087a0a1a6d7146bdcae8e9aab (patch)
tree16e7bae422279925301d9116b1e7f4d8aa656483 /drivers/gpu/nvgpu/gk20a/mm_gk20a.h
parentf4b77e465648e87b19a7df4bb2a121ac8ac1b851 (diff)
gpu: nvgpu: Support multiple types of allocators
Support multiple types of allocation backends. Currently there is only one allocator implementation available: a buddy allocator. Buddy allocators have certain limitations though. For one the allocator requires metadata to be allocated from the kernel's system memory. This causes a given buddy allocation to potentially sleep on a kmalloc() call. This patch has been created so that a new backend can be created which will avoid any dynamic system memory management routines from being called. Bug 1781897 Change-Id: I98d6c8402c049942f13fee69c6901a166f177f65 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1172115 GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index 2e9172c7..66e46480 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -424,12 +424,13 @@ static inline u64 __nv_gmmu_va_small_page_limit(void)
424 424
425static inline int __nv_gmmu_va_is_big_page_region(struct vm_gk20a *vm, u64 addr) 425static inline int __nv_gmmu_va_is_big_page_region(struct vm_gk20a *vm, u64 addr)
426{ 426{
427 struct gk20a_allocator *a = &vm->vma[gmmu_page_size_big];
428
427 if (!vm->big_pages) 429 if (!vm->big_pages)
428 return 0; 430 return 0;
429 431
430 return addr >= vm->vma[gmmu_page_size_big].base && 432 return addr >= gk20a_alloc_base(a) &&
431 addr < vm->vma[gmmu_page_size_big].base + 433 addr < gk20a_alloc_base(a) + gk20a_alloc_length(a);
432 vm->vma[gmmu_page_size_big].length;
433} 434}
434 435
435/* 436/*