From 2e15a2d1accb8303c2363122c638e08ae7b70a50 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 8 Mar 2017 16:58:25 -0800 Subject: gpu: nvgpu: Use new kmem API functions (vgpu/*) Use the new kmem API functions in vgpu/*. Also reshuffle the order of some allocs in the vgpu init code to allow usage of the nvgpu kmem APIs. Bug 1799159 Bug 1823380 Change-Id: I6c6dcff03b406a260dffbf89a59b368d31a4cb2c Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1318318 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/mm_vgpu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/mm_vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c index 1bcdc17b..494bbe66 100644 --- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c @@ -14,6 +14,9 @@ */ #include + +#include + #include "vgpu/vgpu.h" #include "gk20a/mm_gk20a.h" @@ -220,7 +223,7 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm) list_for_each_entry_safe(va_node, va_node_tmp, &vm->reserved_va_list, reserved_va_list) { list_del(&va_node->reserved_va_list); - kfree(va_node); + nvgpu_kfree(g, va_node); } msg.cmd = TEGRA_VGPU_CMD_AS_FREE_SHARE; @@ -237,7 +240,7 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm) nvgpu_mutex_release(&vm->update_gmmu_lock); /* vm is not used anymore. release it. */ - kfree(vm); + nvgpu_kfree(g, vm); } u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size) @@ -297,7 +300,7 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share, big_page_size = gmmu_page_sizes[gmmu_page_size_big]; - vm = kzalloc(sizeof(*vm), GFP_KERNEL); + vm = nvgpu_kzalloc(g, sizeof(*vm)); if (!vm) return -ENOMEM; @@ -421,7 +424,7 @@ clean_up_share: p->handle = vm->handle; WARN_ON(vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)) || msg.ret); clean_up: - kfree(vm); + nvgpu_kfree(g, vm); as_share->vm = NULL; return err; } -- cgit v1.2.2