summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-12-20 16:55:48 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-09 15:33:16 -0500
commit6df3992b60959d32c7113cb77e131a2547174f3a (patch)
treeefbdc9e6ccd2330d5c469ca0783ecb0137da8fc4 /drivers/gpu/nvgpu/gk20a/fence_gk20a.c
parente229514bece5a109cdbfe263f6329efe987e5939 (diff)
gpu: nvgpu: Move allocators to common/mm/
Move the GPU allocators to common/mm/ since the allocators are common code across all GPUs. Also rename the allocator code to move away from gk20a_ prefixed structs and functions. This caused one issue with the nvgpu_alloc() and nvgpu_free() functions. There was a function for allocating either with kmalloc() or vmalloc() depending on the size of the allocation. Those have now been renamed to nvgpu_kalloc() and nvgpu_kfree(). Bug 1799159 Change-Id: Iddda92c013612bcb209847084ec85b8953002fa5 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1274400 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fence_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fence_gk20a.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
index 323caa8f..b8a1dcbc 100644
--- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
@@ -49,8 +49,8 @@ static void gk20a_fence_free(struct kref *ref)
49 gk20a_semaphore_put(f->semaphore); 49 gk20a_semaphore_put(f->semaphore);
50 50
51 if (f->allocator) { 51 if (f->allocator) {
52 if (gk20a_alloc_initialized(f->allocator)) 52 if (nvgpu_alloc_initialized(f->allocator))
53 gk20a_free(f->allocator, (size_t)f); 53 nvgpu_free(f->allocator, (size_t)f);
54 } else 54 } else
55 kfree(f); 55 kfree(f);
56} 56}
@@ -129,7 +129,7 @@ int gk20a_alloc_fence_pool(struct channel_gk20a *c, unsigned int count)
129 if (!fence_pool) 129 if (!fence_pool)
130 return -ENOMEM; 130 return -ENOMEM;
131 131
132 err = gk20a_lockless_allocator_init(c->g, &c->fence_allocator, 132 err = nvgpu_lockless_allocator_init(c->g, &c->fence_allocator,
133 "fence_pool", (size_t)fence_pool, size, 133 "fence_pool", (size_t)fence_pool, size,
134 sizeof(struct gk20a_fence), 0); 134 sizeof(struct gk20a_fence), 0);
135 if (err) 135 if (err)
@@ -144,11 +144,11 @@ fail:
144 144
145void gk20a_free_fence_pool(struct channel_gk20a *c) 145void gk20a_free_fence_pool(struct channel_gk20a *c)
146{ 146{
147 if (gk20a_alloc_initialized(&c->fence_allocator)) { 147 if (nvgpu_alloc_initialized(&c->fence_allocator)) {
148 void *base = (void *)(uintptr_t) 148 void *base = (void *)(uintptr_t)
149 gk20a_alloc_base(&c->fence_allocator); 149 nvgpu_alloc_base(&c->fence_allocator);
150 150
151 gk20a_alloc_destroy(&c->fence_allocator); 151 nvgpu_alloc_destroy(&c->fence_allocator);
152 vfree(base); 152 vfree(base);
153 } 153 }
154} 154}
@@ -158,9 +158,9 @@ struct gk20a_fence *gk20a_alloc_fence(struct channel_gk20a *c)
158 struct gk20a_fence *fence = NULL; 158 struct gk20a_fence *fence = NULL;
159 159
160 if (channel_gk20a_is_prealloc_enabled(c)) { 160 if (channel_gk20a_is_prealloc_enabled(c)) {
161 if (gk20a_alloc_initialized(&c->fence_allocator)) { 161 if (nvgpu_alloc_initialized(&c->fence_allocator)) {
162 fence = (struct gk20a_fence *)(uintptr_t) 162 fence = (struct gk20a_fence *)(uintptr_t)
163 gk20a_alloc(&c->fence_allocator, 163 nvgpu_alloc(&c->fence_allocator,
164 sizeof(struct gk20a_fence)); 164 sizeof(struct gk20a_fence));
165 165
166 /* clear the node and reset the allocator pointer */ 166 /* clear the node and reset the allocator pointer */