From 6df3992b60959d32c7113cb77e131a2547174f3a Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 20 Dec 2016 13:55:48 -0800 Subject: 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 Reviewed-on: http://git-master/r/1274400 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/fence_gk20a.c') 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) gk20a_semaphore_put(f->semaphore); if (f->allocator) { - if (gk20a_alloc_initialized(f->allocator)) - gk20a_free(f->allocator, (size_t)f); + if (nvgpu_alloc_initialized(f->allocator)) + nvgpu_free(f->allocator, (size_t)f); } else kfree(f); } @@ -129,7 +129,7 @@ int gk20a_alloc_fence_pool(struct channel_gk20a *c, unsigned int count) if (!fence_pool) return -ENOMEM; - err = gk20a_lockless_allocator_init(c->g, &c->fence_allocator, + err = nvgpu_lockless_allocator_init(c->g, &c->fence_allocator, "fence_pool", (size_t)fence_pool, size, sizeof(struct gk20a_fence), 0); if (err) @@ -144,11 +144,11 @@ fail: void gk20a_free_fence_pool(struct channel_gk20a *c) { - if (gk20a_alloc_initialized(&c->fence_allocator)) { + if (nvgpu_alloc_initialized(&c->fence_allocator)) { void *base = (void *)(uintptr_t) - gk20a_alloc_base(&c->fence_allocator); + nvgpu_alloc_base(&c->fence_allocator); - gk20a_alloc_destroy(&c->fence_allocator); + nvgpu_alloc_destroy(&c->fence_allocator); vfree(base); } } @@ -158,9 +158,9 @@ struct gk20a_fence *gk20a_alloc_fence(struct channel_gk20a *c) struct gk20a_fence *fence = NULL; if (channel_gk20a_is_prealloc_enabled(c)) { - if (gk20a_alloc_initialized(&c->fence_allocator)) { + if (nvgpu_alloc_initialized(&c->fence_allocator)) { fence = (struct gk20a_fence *)(uintptr_t) - gk20a_alloc(&c->fence_allocator, + nvgpu_alloc(&c->fence_allocator, sizeof(struct gk20a_fence)); /* clear the node and reset the allocator pointer */ -- cgit v1.2.2