summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-05-05 18:00:23 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-26 06:33:57 -0400
commit0bb47c3675d2030545d40353931e2b8120541de4 (patch)
tree1a23b45c1ac19dbc98e1d4a585822eb47b7dfeb2 /drivers/gpu/nvgpu/include
parentfbafc7eba41ba7654dfdadf51a53acf1638e9fa1 (diff)
gpu: nvgpu: Add and use VM init/deinit APIs
Remove the VM init/de-init from the HAL and instead use a single set of routines that init/de-init VMs. This prevents code divergence between vGPUs and regular GPUs. This patch also clears up the naming of the routines a little bit. Since some VMs are used inplace and others are dynamically allocated the APIs for freeing them were confusing. Also some free calls also clean up an instance block (this is API abuse - but this is how it currently exists). The new API looks like this: void __nvgpu_vm_remove(struct vm_gk20a *vm); void nvgpu_vm_remove(struct vm_gk20a *vm); void nvgpu_vm_remove_inst(struct vm_gk20a *vm, struct nvgpu_mem *inst_block); void nvgpu_vm_remove_vgpu(struct vm_gk20a *vm); int nvgpu_init_vm(struct mm_gk20a *mm, struct vm_gk20a *vm, u32 big_page_size, u64 low_hole, u64 kernel_reserved, u64 aperture_size, bool big_pages, bool userspace_managed, char *name); void nvgpu_deinit_vm(struct vm_gk20a *vm); JIRA NVGPU-12 JIRA NVGPU-30 Change-Id: Ia4016384c54746bfbcaa4bdd0d29d03d5d7f7f1b Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1477747 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vm.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h
index c89282bf..fed58f24 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/vm.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h
@@ -225,19 +225,22 @@ int nvgpu_insert_mapped_buf(struct vm_gk20a *vm,
225void nvgpu_remove_mapped_buf(struct vm_gk20a *vm, 225void nvgpu_remove_mapped_buf(struct vm_gk20a *vm,
226 struct nvgpu_mapped_buf *mapped_buffer); 226 struct nvgpu_mapped_buf *mapped_buffer);
227 227
228void nvgpu_vm_remove_support_nofree(struct vm_gk20a *vm); 228void __nvgpu_vm_remove(struct vm_gk20a *vm);
229void nvgpu_vm_remove_support(struct vm_gk20a *vm); 229void nvgpu_vm_remove(struct vm_gk20a *vm);
230void nvgpu_vm_remove(struct vm_gk20a *vm, struct nvgpu_mem *inst_block); 230void nvgpu_vm_remove_inst(struct vm_gk20a *vm, struct nvgpu_mem *inst_block);
231#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
232void nvgpu_vm_remove_vgpu(struct vm_gk20a *vm);
233#endif
231 234
232int nvgpu_init_vm(struct mm_gk20a *mm, 235int nvgpu_init_vm(struct mm_gk20a *mm,
233 struct vm_gk20a *vm, 236 struct vm_gk20a *vm,
234 u32 big_page_size, 237 u32 big_page_size,
235 u64 low_hole, 238 u64 low_hole,
236 u64 kernel_reserved, 239 u64 kernel_reserved,
237 u64 aperture_size, 240 u64 aperture_size,
238 bool big_pages, 241 bool big_pages,
239 bool userspace_managed, 242 bool userspace_managed,
240 char *name); 243 char *name);
241void nvgpu_deinit_vm(struct vm_gk20a *vm); 244void nvgpu_deinit_vm(struct vm_gk20a *vm);
242 245
243/* 246/*