diff options
author | Alex Waterman <alexw@nvidia.com> | 2016-07-21 16:46:44 -0400 |
---|---|---|
committer | Alex Waterman <alexw@nvidia.com> | 2016-07-22 14:24:12 -0400 |
commit | 7a2e30267bdb9ab2ff15a1e9d7e57bb7ea9bd3a3 (patch) | |
tree | 4175aa989b8d15ced3e672e14d989a44688bc3ad /drivers/gpu/nvgpu | |
parent | b2a86525278423b60797bb25b3bd89aeefba77d4 (diff) |
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 <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1185136
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-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 |