From 7a2e30267bdb9ab2ff15a1e9d7e57bb7ea9bd3a3 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 21 Jul 2016 13:46:44 -0700 Subject: gpu: nvgpu: Use consistent definition for PTE size In the buddy allocator the BALLOC_PTE_SIZE_* macros are inconsistent with the gmmu_page_size_* enum. This patch makes the buddy allocator use the gmmu_page_size_* fields and now has only BALLOC_PTE_SIZE_ANY for when the allocator does not care about PTE size. Change-Id: Idbe727b8208e1ace2b947d67f698c471782d5587 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1185136 Reviewed-by: Konsta Holtta GVS: Gerrit_Virtual_Submit Reviewed-by: Yu-Huan Hsu --- drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c index 97605800..4ed55971 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c @@ -111,6 +111,7 @@ static struct gk20a_buddy *balloc_new_buddy(struct gk20a_buddy_allocator *a, new_buddy->start = start; new_buddy->order = order; new_buddy->end = start + (1 << order) * a->blk_size; + new_buddy->pte_size = BALLOC_PTE_SIZE_ANY; return new_buddy; } @@ -132,7 +133,7 @@ static void __balloc_buddy_list_add(struct gk20a_buddy_allocator *a, * without cycling through the entire list. */ if (a->flags & GPU_ALLOC_GVA_SPACE && - b->pte_size == BALLOC_PTE_SIZE_BIG) + b->pte_size == gmmu_page_size_big) list_add_tail(&b->buddy_entry, list); else list_add(&b->buddy_entry, list); @@ -474,7 +475,7 @@ static struct gk20a_buddy *__balloc_find_buddy(struct gk20a_buddy_allocator *a, return NULL; if (a->flags & GPU_ALLOC_GVA_SPACE && - pte_size == BALLOC_PTE_SIZE_BIG) + pte_size == gmmu_page_size_big) bud = list_last_entry(balloc_get_order_list(a, order), struct gk20a_buddy, buddy_entry); else -- cgit v1.2.2