summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
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/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
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/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c12
1 files changed, 6 insertions, 6 deletions
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;