diff options
author | Sourab Gupta <sourabg@nvidia.com> | 2017-10-11 04:16:28 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-17 07:28:25 -0400 |
commit | 47fe66a461db349a884c4eed64a07377bbdb2a91 (patch) | |
tree | d500956d7d85751df6efd14b8278167f606a6720 | |
parent | 2269a8675c9e6dfb02379487c45676d1bf84dfcc (diff) |
gpu: nvgpu: compile nvgpu allocator for QNX
The patch has the changes for compilation of
common nvgpu allocator for QNX.
This includes some cross-OS compilation changes
and removing some Linux'isms from the allocator.
Change-Id: Ib1ecceec77b497513a196597bff4441615577548
Signed-off-by: Sourab Gupta <sourabg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1540306
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/buddy_allocator.c | 17 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/page_allocator.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/allocator.h | 1 |
3 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c index 75c4f427..c6f10a69 100644 --- a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <nvgpu/barrier.h> | 27 | #include <nvgpu/barrier.h> |
28 | 28 | ||
29 | #include "gk20a/mm_gk20a.h" | 29 | #include "gk20a/mm_gk20a.h" |
30 | #include "gk20a/platform_gk20a.h" | ||
31 | 30 | ||
32 | #include "buddy_allocator_priv.h" | 31 | #include "buddy_allocator_priv.h" |
33 | 32 | ||
@@ -304,17 +303,20 @@ static void nvgpu_buddy_allocator_destroy(struct nvgpu_allocator *__a) | |||
304 | } | 303 | } |
305 | 304 | ||
306 | if (a->buddy_list_len[i] != 0) { | 305 | if (a->buddy_list_len[i] != 0) { |
307 | pr_info("Excess buddies!!! (%d: %llu)\n", | 306 | nvgpu_info(__a->g, |
307 | "Excess buddies!!! (%d: %llu)\n", | ||
308 | i, a->buddy_list_len[i]); | 308 | i, a->buddy_list_len[i]); |
309 | BUG(); | 309 | BUG(); |
310 | } | 310 | } |
311 | if (a->buddy_list_split[i] != 0) { | 311 | if (a->buddy_list_split[i] != 0) { |
312 | pr_info("Excess split nodes!!! (%d: %llu)\n", | 312 | nvgpu_info(__a->g, |
313 | "Excess split nodes!!! (%d: %llu)\n", | ||
313 | i, a->buddy_list_split[i]); | 314 | i, a->buddy_list_split[i]); |
314 | BUG(); | 315 | BUG(); |
315 | } | 316 | } |
316 | if (a->buddy_list_alloced[i] != 0) { | 317 | if (a->buddy_list_alloced[i] != 0) { |
317 | pr_info("Excess alloced nodes!!! (%d: %llu)\n", | 318 | nvgpu_info(__a->g, |
319 | "Excess alloced nodes!!! (%d: %llu)\n", | ||
318 | i, a->buddy_list_alloced[i]); | 320 | i, a->buddy_list_alloced[i]); |
319 | BUG(); | 321 | BUG(); |
320 | } | 322 | } |
@@ -882,7 +884,8 @@ static u64 __nvgpu_balloc_fixed_buddy(struct nvgpu_allocator *__a, | |||
882 | 884 | ||
883 | balloc_alloc_fixed(a, falloc); | 885 | balloc_alloc_fixed(a, falloc); |
884 | 886 | ||
885 | list_for_each_entry(bud, &falloc->buddies, buddy_entry) | 887 | nvgpu_list_for_each_entry(bud, &falloc->buddies, |
888 | nvgpu_buddy, buddy_entry) | ||
886 | real_bytes += (bud->end - bud->start); | 889 | real_bytes += (bud->end - bud->start); |
887 | 890 | ||
888 | a->bytes_alloced += len; | 891 | a->bytes_alloced += len; |
@@ -1014,7 +1017,9 @@ static int nvgpu_buddy_reserve_co(struct nvgpu_allocator *__a, | |||
1014 | addr = __nvgpu_balloc_fixed_buddy(__a, co->base, co->length, 0); | 1017 | addr = __nvgpu_balloc_fixed_buddy(__a, co->base, co->length, 0); |
1015 | if (!addr) { | 1018 | if (!addr) { |
1016 | err = -ENOMEM; | 1019 | err = -ENOMEM; |
1017 | pr_warn("%s: Failed to reserve a valid carveout!\n", __func__); | 1020 | nvgpu_warn(__a->g, |
1021 | "%s: Failed to reserve a valid carveout!\n", | ||
1022 | __func__); | ||
1018 | goto done; | 1023 | goto done; |
1019 | } | 1024 | } |
1020 | 1025 | ||
diff --git a/drivers/gpu/nvgpu/common/mm/page_allocator.c b/drivers/gpu/nvgpu/common/mm/page_allocator.c index 2b5a595d..d5ce5d8e 100644 --- a/drivers/gpu/nvgpu/common/mm/page_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/page_allocator.c | |||
@@ -38,6 +38,9 @@ | |||
38 | */ | 38 | */ |
39 | #ifdef PAGE_SIZE | 39 | #ifdef PAGE_SIZE |
40 | #undef PAGE_SIZE | 40 | #undef PAGE_SIZE |
41 | #endif | ||
42 | |||
43 | #ifdef PAGE_ALIGN | ||
41 | #undef PAGE_ALIGN | 44 | #undef PAGE_ALIGN |
42 | #endif | 45 | #endif |
43 | 46 | ||
diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h index a39ae44e..1e7ab38f 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <nvgpu/log.h> | 35 | #include <nvgpu/log.h> |
36 | #include <nvgpu/lock.h> | 36 | #include <nvgpu/lock.h> |
37 | #include <nvgpu/list.h> | 37 | #include <nvgpu/list.h> |
38 | #include <nvgpu/types.h> | ||
38 | 39 | ||
39 | /* #define ALLOCATOR_DEBUG */ | 40 | /* #define ALLOCATOR_DEBUG */ |
40 | 41 | ||