summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-06-30 19:05:32 -0400
committerAlex Waterman <alexw@nvidia.com>2016-07-19 14:31:50 -0400
commit0793de62b28bf8dcc655628129fd664862ac9909 (patch)
tree5938d45151d723c91b37dd3460ceacc33c1b3512 /drivers
parent5672cbdf6d8e7b8b93a08cd388097e2d1f0a8843 (diff)
gpu: nvgpu: Change the allocator flag naming scheme
Move to a more generic name of GPU_ALLOC_*. Change-Id: Icbbd366847a9d74f83f578e4d9ea917a6e8ea3e2 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1176445 Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/buddy_allocator_priv.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c12
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c8
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c6
5 files changed, 15 insertions, 15 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/buddy_allocator_priv.h b/drivers/gpu/nvgpu/gk20a/buddy_allocator_priv.h
index bed0492c..55de9bc9 100644
--- a/drivers/gpu/nvgpu/gk20a/buddy_allocator_priv.h
+++ b/drivers/gpu/nvgpu/gk20a/buddy_allocator_priv.h
@@ -137,7 +137,7 @@ struct gk20a_buddy_allocator {
137 137
138 /* 138 /*
139 * This is for when the allocator is managing a GVA space (the 139 * This is for when the allocator is managing a GVA space (the
140 * GPU_BALLOC_GVA_SPACE bit is set in @flags). This requires 140 * GPU_ALLOC_GVA_SPACE bit is set in @flags). This requires
141 * that we group like sized allocations into PDE blocks. 141 * that we group like sized allocations into PDE blocks.
142 */ 142 */
143 u64 pte_blk_order; 143 u64 pte_blk_order;
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.h b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.h
index 06819700..a25f9850 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.h
@@ -74,7 +74,7 @@ struct gk20a_allocator {
74/* 74/*
75 * Allocator flags. 75 * Allocator flags.
76 */ 76 */
77#define GPU_BALLOC_GVA_SPACE 0x1 77#define GPU_ALLOC_GVA_SPACE 0x1
78 78
79static inline void alloc_lock(struct gk20a_allocator *a) 79static inline void alloc_lock(struct gk20a_allocator *a)
80{ 80{
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
index 4a1df339..c006480b 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
@@ -131,7 +131,7 @@ static void __balloc_buddy_list_add(struct gk20a_buddy_allocator *a,
131 * This lets the code that checks if there are available blocks check 131 * This lets the code that checks if there are available blocks check
132 * without cycling through the entire list. 132 * without cycling through the entire list.
133 */ 133 */
134 if (a->flags & GPU_BALLOC_GVA_SPACE && 134 if (a->flags & GPU_ALLOC_GVA_SPACE &&
135 b->pte_size == BALLOC_PTE_SIZE_BIG) 135 b->pte_size == BALLOC_PTE_SIZE_BIG)
136 list_add_tail(&b->buddy_entry, list); 136 list_add_tail(&b->buddy_entry, list);
137 else 137 else
@@ -383,7 +383,7 @@ static int balloc_split_buddy(struct gk20a_buddy_allocator *a,
383 right->parent = b; 383 right->parent = b;
384 384
385 /* PTE considerations. */ 385 /* PTE considerations. */
386 if (a->flags & GPU_BALLOC_GVA_SPACE && 386 if (a->flags & GPU_ALLOC_GVA_SPACE &&
387 left->order <= a->pte_blk_order) { 387 left->order <= a->pte_blk_order) {
388 left->pte_size = pte_size; 388 left->pte_size = pte_size;
389 right->pte_size = pte_size; 389 right->pte_size = pte_size;
@@ -473,7 +473,7 @@ static struct gk20a_buddy *__balloc_find_buddy(struct gk20a_buddy_allocator *a,
473 list_empty(balloc_get_order_list(a, order))) 473 list_empty(balloc_get_order_list(a, order)))
474 return NULL; 474 return NULL;
475 475
476 if (a->flags & GPU_BALLOC_GVA_SPACE && 476 if (a->flags & GPU_ALLOC_GVA_SPACE &&
477 pte_size == BALLOC_PTE_SIZE_BIG) 477 pte_size == BALLOC_PTE_SIZE_BIG)
478 bud = list_last_entry(balloc_get_order_list(a, order), 478 bud = list_last_entry(balloc_get_order_list(a, order),
479 struct gk20a_buddy, buddy_entry); 479 struct gk20a_buddy, buddy_entry);
@@ -823,7 +823,7 @@ static u64 gk20a_buddy_balloc(struct gk20a_allocator *__a, u64 len)
823 * TODO: once userspace supports a unified address space pass 0 for 823 * TODO: once userspace supports a unified address space pass 0 for
824 * the base. This will make only 'len' affect the PTE size. 824 * the base. This will make only 'len' affect the PTE size.
825 */ 825 */
826 if (a->flags & GPU_BALLOC_GVA_SPACE) 826 if (a->flags & GPU_ALLOC_GVA_SPACE)
827 pte_size = __get_pte_size(a->vm, a->base, len); 827 pte_size = __get_pte_size(a->vm, a->base, len);
828 else 828 else
829 pte_size = BALLOC_PTE_SIZE_ANY; 829 pte_size = BALLOC_PTE_SIZE_ANY;
@@ -1112,7 +1112,7 @@ int __gk20a_buddy_allocator_init(struct gk20a_allocator *__a,
1112 return -EINVAL; 1112 return -EINVAL;
1113 1113
1114 /* If this is to manage a GVA space we need a VM. */ 1114 /* If this is to manage a GVA space we need a VM. */
1115 if (flags & GPU_BALLOC_GVA_SPACE && !vm) 1115 if (flags & GPU_ALLOC_GVA_SPACE && !vm)
1116 return -EINVAL; 1116 return -EINVAL;
1117 1117
1118 a = kzalloc(sizeof(struct gk20a_buddy_allocator), GFP_KERNEL); 1118 a = kzalloc(sizeof(struct gk20a_buddy_allocator), GFP_KERNEL);
@@ -1139,7 +1139,7 @@ int __gk20a_buddy_allocator_init(struct gk20a_allocator *__a,
1139 } 1139 }
1140 1140
1141 a->vm = vm; 1141 a->vm = vm;
1142 if (flags & GPU_BALLOC_GVA_SPACE) 1142 if (flags & GPU_ALLOC_GVA_SPACE)
1143 a->pte_blk_order = balloc_get_order(a, vm->big_page_size << 10); 1143 a->pte_blk_order = balloc_get_order(a, vm->big_page_size << 10);
1144 1144
1145 a->flags = flags; 1145 a->flags = flags;
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index ffc695f5..750ce10c 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -3548,7 +3548,7 @@ int gk20a_init_vm(struct mm_gk20a *mm,
3548 g->separate_fixed_allocs, 3548 g->separate_fixed_allocs,
3549 SZ_4K, 3549 SZ_4K,
3550 GPU_BALLOC_MAX_ORDER, 3550 GPU_BALLOC_MAX_ORDER,
3551 GPU_BALLOC_GVA_SPACE); 3551 GPU_ALLOC_GVA_SPACE);
3552 if (err) 3552 if (err)
3553 goto clean_up_ptes; 3553 goto clean_up_ptes;
3554 3554
@@ -3566,7 +3566,7 @@ int gk20a_init_vm(struct mm_gk20a *mm,
3566 small_vma_limit - small_vma_start, 3566 small_vma_limit - small_vma_start,
3567 SZ_4K, 3567 SZ_4K,
3568 GPU_BALLOC_MAX_ORDER, 3568 GPU_BALLOC_MAX_ORDER,
3569 GPU_BALLOC_GVA_SPACE); 3569 GPU_ALLOC_GVA_SPACE);
3570 if (err) 3570 if (err)
3571 goto clean_up_ptes; 3571 goto clean_up_ptes;
3572 } 3572 }
@@ -3581,7 +3581,7 @@ int gk20a_init_vm(struct mm_gk20a *mm,
3581 large_vma_limit - large_vma_start, 3581 large_vma_limit - large_vma_start,
3582 big_page_size, 3582 big_page_size,
3583 GPU_BALLOC_MAX_ORDER, 3583 GPU_BALLOC_MAX_ORDER,
3584 GPU_BALLOC_GVA_SPACE); 3584 GPU_ALLOC_GVA_SPACE);
3585 if (err) 3585 if (err)
3586 goto clean_up_small_allocator; 3586 goto clean_up_small_allocator;
3587 } 3587 }
@@ -3597,7 +3597,7 @@ int gk20a_init_vm(struct mm_gk20a *mm,
3597 kernel_vma_limit - kernel_vma_start, 3597 kernel_vma_limit - kernel_vma_start,
3598 SZ_4K, 3598 SZ_4K,
3599 GPU_BALLOC_MAX_ORDER, 3599 GPU_BALLOC_MAX_ORDER,
3600 GPU_BALLOC_GVA_SPACE); 3600 GPU_ALLOC_GVA_SPACE);
3601 if (err) 3601 if (err)
3602 goto clean_up_big_allocator; 3602 goto clean_up_big_allocator;
3603 3603
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index c6f42703..6b741cd4 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -381,7 +381,7 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
381 small_vma_limit - small_vma_start, 381 small_vma_limit - small_vma_start,
382 SZ_4K, 382 SZ_4K,
383 GPU_BALLOC_MAX_ORDER, 383 GPU_BALLOC_MAX_ORDER,
384 GPU_BALLOC_GVA_SPACE); 384 GPU_ALLOC_GVA_SPACE);
385 if (err) 385 if (err)
386 goto clean_up_share; 386 goto clean_up_share;
387 } 387 }
@@ -396,7 +396,7 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
396 large_vma_limit - large_vma_start, 396 large_vma_limit - large_vma_start,
397 big_page_size, 397 big_page_size,
398 GPU_BALLOC_MAX_ORDER, 398 GPU_BALLOC_MAX_ORDER,
399 GPU_BALLOC_GVA_SPACE); 399 GPU_ALLOC_GVA_SPACE);
400 if (err) 400 if (err)
401 goto clean_up_small_allocator; 401 goto clean_up_small_allocator;
402 } 402 }
@@ -412,7 +412,7 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
412 kernel_vma_limit - kernel_vma_start, 412 kernel_vma_limit - kernel_vma_start,
413 SZ_4K, 413 SZ_4K,
414 GPU_BALLOC_MAX_ORDER, 414 GPU_BALLOC_MAX_ORDER,
415 GPU_BALLOC_GVA_SPACE); 415 GPU_ALLOC_GVA_SPACE);
416 if (err) 416 if (err)
417 goto clean_up_big_allocator; 417 goto clean_up_big_allocator;
418 418