diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/buddy_allocator_priv.h | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c | 5 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/buddy_allocator_priv.h b/drivers/gpu/nvgpu/gk20a/buddy_allocator_priv.h index 55de9bc9..1a6aed48 100644 --- a/drivers/gpu/nvgpu/gk20a/buddy_allocator_priv.h +++ b/drivers/gpu/nvgpu/gk20a/buddy_allocator_priv.h | |||
@@ -46,11 +46,10 @@ struct gk20a_buddy { | |||
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Size of the PDE this buddy is using. This allows for grouping like | 48 | * Size of the PDE this buddy is using. This allows for grouping like |
49 | * sized allocations into the same PDE. | 49 | * sized allocations into the same PDE. This uses the gmmu_pgsz_gk20a |
50 | * enum except for the BALLOC_PTE_SIZE_ANY specifier. | ||
50 | */ | 51 | */ |
51 | #define BALLOC_PTE_SIZE_ANY 0x0 | 52 | #define BALLOC_PTE_SIZE_ANY -1 |
52 | #define BALLOC_PTE_SIZE_SMALL 0x1 | ||
53 | #define BALLOC_PTE_SIZE_BIG 0x2 | ||
54 | int pte_size; | 53 | int pte_size; |
55 | }; | 54 | }; |
56 | 55 | ||
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, | |||
111 | new_buddy->start = start; | 111 | new_buddy->start = start; |
112 | new_buddy->order = order; | 112 | new_buddy->order = order; |
113 | new_buddy->end = start + (1 << order) * a->blk_size; | 113 | new_buddy->end = start + (1 << order) * a->blk_size; |
114 | new_buddy->pte_size = BALLOC_PTE_SIZE_ANY; | ||
114 | 115 | ||
115 | return new_buddy; | 116 | return new_buddy; |
116 | } | 117 | } |
@@ -132,7 +133,7 @@ static void __balloc_buddy_list_add(struct gk20a_buddy_allocator *a, | |||
132 | * without cycling through the entire list. | 133 | * without cycling through the entire list. |
133 | */ | 134 | */ |
134 | if (a->flags & GPU_ALLOC_GVA_SPACE && | 135 | if (a->flags & GPU_ALLOC_GVA_SPACE && |
135 | b->pte_size == BALLOC_PTE_SIZE_BIG) | 136 | b->pte_size == gmmu_page_size_big) |
136 | list_add_tail(&b->buddy_entry, list); | 137 | list_add_tail(&b->buddy_entry, list); |
137 | else | 138 | else |
138 | list_add(&b->buddy_entry, list); | 139 | list_add(&b->buddy_entry, list); |
@@ -474,7 +475,7 @@ static struct gk20a_buddy *__balloc_find_buddy(struct gk20a_buddy_allocator *a, | |||
474 | return NULL; | 475 | return NULL; |
475 | 476 | ||
476 | if (a->flags & GPU_ALLOC_GVA_SPACE && | 477 | if (a->flags & GPU_ALLOC_GVA_SPACE && |
477 | pte_size == BALLOC_PTE_SIZE_BIG) | 478 | pte_size == gmmu_page_size_big) |
478 | bud = list_last_entry(balloc_get_order_list(a, order), | 479 | bud = list_last_entry(balloc_get_order_list(a, order), |
479 | struct gk20a_buddy, buddy_entry); | 480 | struct gk20a_buddy, buddy_entry); |
480 | else | 481 | else |