summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-03-08 19:58:25 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-28 12:39:07 -0400
commit2e15a2d1accb8303c2363122c638e08ae7b70a50 (patch)
treefd967e64059e4b868f26de0aab56828984c52139 /drivers/gpu/nvgpu/vgpu/mm_vgpu.c
parent8a15e02ca92b83aa5a216ea9cd42680373212ecd (diff)
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 <alexw@nvidia.com> Reviewed-on: http://git-master/r/1318318 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/mm_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c11
1 files changed, 7 insertions, 4 deletions
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 @@
14 */ 14 */
15 15
16#include <linux/dma-mapping.h> 16#include <linux/dma-mapping.h>
17
18#include <nvgpu/kmem.h>
19
17#include "vgpu/vgpu.h" 20#include "vgpu/vgpu.h"
18#include "gk20a/mm_gk20a.h" 21#include "gk20a/mm_gk20a.h"
19 22
@@ -220,7 +223,7 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm)
220 list_for_each_entry_safe(va_node, va_node_tmp, &vm->reserved_va_list, 223 list_for_each_entry_safe(va_node, va_node_tmp, &vm->reserved_va_list,
221 reserved_va_list) { 224 reserved_va_list) {
222 list_del(&va_node->reserved_va_list); 225 list_del(&va_node->reserved_va_list);
223 kfree(va_node); 226 nvgpu_kfree(g, va_node);
224 } 227 }
225 228
226 msg.cmd = TEGRA_VGPU_CMD_AS_FREE_SHARE; 229 msg.cmd = TEGRA_VGPU_CMD_AS_FREE_SHARE;
@@ -237,7 +240,7 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm)
237 nvgpu_mutex_release(&vm->update_gmmu_lock); 240 nvgpu_mutex_release(&vm->update_gmmu_lock);
238 241
239 /* vm is not used anymore. release it. */ 242 /* vm is not used anymore. release it. */
240 kfree(vm); 243 nvgpu_kfree(g, vm);
241} 244}
242 245
243u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size) 246u64 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,
297 300
298 big_page_size = gmmu_page_sizes[gmmu_page_size_big]; 301 big_page_size = gmmu_page_sizes[gmmu_page_size_big];
299 302
300 vm = kzalloc(sizeof(*vm), GFP_KERNEL); 303 vm = nvgpu_kzalloc(g, sizeof(*vm));
301 if (!vm) 304 if (!vm)
302 return -ENOMEM; 305 return -ENOMEM;
303 306
@@ -421,7 +424,7 @@ clean_up_share:
421 p->handle = vm->handle; 424 p->handle = vm->handle;
422 WARN_ON(vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)) || msg.ret); 425 WARN_ON(vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)) || msg.ret);
423clean_up: 426clean_up:
424 kfree(vm); 427 nvgpu_kfree(g, vm);
425 as_share->vm = NULL; 428 as_share->vm = NULL;
426 return err; 429 return err;
427} 430}