diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-02-10 07:05:58 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-03 11:55:19 -0400 |
commit | 0d8830394adf94fee8f69bc034293d1880e9d8db (patch) | |
tree | c708df6bc3bdd65fccbf4a6bea6e80a128318380 /drivers/gpu/nvgpu/include | |
parent | 1e355ca52e2b3ac5f4e433e1bb115f6fd8499954 (diff) |
gpu: nvgpu: use nvgpu list for page chunks
Use nvgpu list APIs instead of linux list APIs
to store chunks of page allocator
Jira NVGPU-13
Change-Id: I63375fc2df683e018c48a90b76eca368438cc32f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1326814
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/page_allocator.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h index fa586dba..92f48ac5 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <nvgpu/allocator.h> | 23 | #include <nvgpu/allocator.h> |
24 | #include <nvgpu/kmem.h> | 24 | #include <nvgpu/kmem.h> |
25 | #include <nvgpu/list.h> | ||
25 | 26 | ||
26 | struct nvgpu_allocator; | 27 | struct nvgpu_allocator; |
27 | 28 | ||
@@ -78,19 +79,26 @@ struct page_alloc_slab_page { | |||
78 | }; | 79 | }; |
79 | 80 | ||
80 | struct page_alloc_chunk { | 81 | struct page_alloc_chunk { |
81 | struct list_head list_entry; | 82 | struct nvgpu_list_node list_entry; |
82 | 83 | ||
83 | u64 base; | 84 | u64 base; |
84 | u64 length; | 85 | u64 length; |
85 | }; | 86 | }; |
86 | 87 | ||
88 | static inline struct page_alloc_chunk * | ||
89 | page_alloc_chunk_from_list_entry(struct nvgpu_list_node *node) | ||
90 | { | ||
91 | return (struct page_alloc_chunk *) | ||
92 | ((uintptr_t)node - offsetof(struct page_alloc_chunk, list_entry)); | ||
93 | }; | ||
94 | |||
87 | /* | 95 | /* |
88 | * Struct to handle internal management of page allocation. It holds a list | 96 | * Struct to handle internal management of page allocation. It holds a list |
89 | * of the chunks of pages that make up the overall allocation - much like a | 97 | * of the chunks of pages that make up the overall allocation - much like a |
90 | * scatter gather table. | 98 | * scatter gather table. |
91 | */ | 99 | */ |
92 | struct nvgpu_page_alloc { | 100 | struct nvgpu_page_alloc { |
93 | struct list_head alloc_chunks; | 101 | struct nvgpu_list_node alloc_chunks; |
94 | 102 | ||
95 | int nr_chunks; | 103 | int nr_chunks; |
96 | u64 length; | 104 | u64 length; |