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/gk20a/mm_gk20a.c | |
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/gk20a/mm_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 94d31273..3cda3034 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <nvgpu/kmem.h> | 33 | #include <nvgpu/kmem.h> |
34 | #include <nvgpu/timers.h> | 34 | #include <nvgpu/timers.h> |
35 | #include <nvgpu/pramin.h> | 35 | #include <nvgpu/pramin.h> |
36 | #include <nvgpu/list.h> | ||
36 | #include <nvgpu/allocator.h> | 37 | #include <nvgpu/allocator.h> |
37 | #include <nvgpu/semaphore.h> | 38 | #include <nvgpu/semaphore.h> |
38 | #include <nvgpu/page_allocator.h> | 39 | #include <nvgpu/page_allocator.h> |
@@ -2174,7 +2175,8 @@ static u64 gk20a_mm_get_align(struct gk20a *g, struct scatterlist *sgl, | |||
2174 | struct nvgpu_page_alloc *alloc = get_vidmem_page_alloc(sgl); | 2175 | struct nvgpu_page_alloc *alloc = get_vidmem_page_alloc(sgl); |
2175 | struct page_alloc_chunk *chunk = NULL; | 2176 | struct page_alloc_chunk *chunk = NULL; |
2176 | 2177 | ||
2177 | list_for_each_entry(chunk, &alloc->alloc_chunks, list_entry) { | 2178 | nvgpu_list_for_each_entry(chunk, &alloc->alloc_chunks, |
2179 | page_alloc_chunk, list_entry) { | ||
2178 | chunk_align = 1ULL << __ffs(chunk->base | chunk->length); | 2180 | chunk_align = 1ULL << __ffs(chunk->base | chunk->length); |
2179 | 2181 | ||
2180 | if (align) | 2182 | if (align) |
@@ -2875,7 +2877,8 @@ static int gk20a_gmmu_clear_vidmem_mem(struct gk20a *g, struct mem_desc *mem) | |||
2875 | 2877 | ||
2876 | alloc = get_vidmem_page_alloc(mem->sgt->sgl); | 2878 | alloc = get_vidmem_page_alloc(mem->sgt->sgl); |
2877 | 2879 | ||
2878 | list_for_each_entry(chunk, &alloc->alloc_chunks, list_entry) { | 2880 | nvgpu_list_for_each_entry(chunk, &alloc->alloc_chunks, |
2881 | page_alloc_chunk, list_entry) { | ||
2879 | if (gk20a_last_fence) | 2882 | if (gk20a_last_fence) |
2880 | gk20a_fence_put(gk20a_last_fence); | 2883 | gk20a_fence_put(gk20a_last_fence); |
2881 | 2884 | ||
@@ -3732,8 +3735,8 @@ static int update_gmmu_ptes_locked(struct vm_gk20a *vm, | |||
3732 | if (sgt) { | 3735 | if (sgt) { |
3733 | alloc = get_vidmem_page_alloc(sgt->sgl); | 3736 | alloc = get_vidmem_page_alloc(sgt->sgl); |
3734 | 3737 | ||
3735 | list_for_each_entry(chunk, &alloc->alloc_chunks, | 3738 | nvgpu_list_for_each_entry(chunk, &alloc->alloc_chunks, |
3736 | list_entry) { | 3739 | page_alloc_chunk, list_entry) { |
3737 | if (space_to_skip && | 3740 | if (space_to_skip && |
3738 | space_to_skip > chunk->length) { | 3741 | space_to_skip > chunk->length) { |
3739 | space_to_skip -= chunk->length; | 3742 | space_to_skip -= chunk->length; |