From b70bad4b9f40e94f731fd9d509e1f3f6617f0b05 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 26 Apr 2017 14:27:02 -0700 Subject: gpu: nvgpu: Refactor gk20a_vm_alloc_va() This function is an internal function to the VM manager that allocates virtual memory space in the GVA allocator. It is unfortunately used in the vGPU code, though. In any event, this patch cleans up and moves the implementation of these functions into the VM common code. JIRA NVGPU-12 JIRA NVGPU-30 Change-Id: I24a3d29b5fcb12615df27d2ac82891d1bacfe541 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1477745 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/vm.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h index 69c08c77..fb55483d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h @@ -242,4 +242,17 @@ int nvgpu_init_vm(struct mm_gk20a *mm, char *name); void nvgpu_deinit_vm(struct vm_gk20a *vm); +/* + * These are private to the VM code but are unfortunately used by the vgpu code. + * It appears to be used for an optimization in reducing the number of server + * requests to the vgpu server. Basically the vgpu implementation of + * map_global_ctx_buffers() sends a bunch of VA ranges over to the RM server. + * Ideally the RM server can just batch mappings but until such a time this + * will be used by the vgpu code. + */ +u64 __nvgpu_vm_alloc_va(struct vm_gk20a *vm, u64 size, + enum gmmu_pgsz_gk20a pgsz_idx); +int __nvgpu_vm_free_va(struct vm_gk20a *vm, u64 addr, + enum gmmu_pgsz_gk20a pgsz_idx); + #endif -- cgit v1.2.2