From c2b63150cd947557b8d17637258b988459b8e0ec Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 10 May 2017 00:41:18 +0100 Subject: gpu: nvgpu: Unify vm_init for vGPU and regular GPU Unify the initialization routines for the vGPU and regular GPU paths. This helps avoid any further code divergence. This also assumes that the code running on the regular GPU essentially works for the vGPU. The only addition is that the regular GPU path calls an API in the vGPU code that sends the necessary RM server message. JIRA NVGPU-12 JIRA NVGPU-30 Change-Id: I37af1993fd8b50f666ae27524d382cce49cf28f7 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1480226 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/vgpu/vm.h | 25 +++++++++++++++++++++++++ drivers/gpu/nvgpu/include/nvgpu/vm.h | 5 +---- 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 drivers/gpu/nvgpu/include/nvgpu/vgpu/vm.h (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/vgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vgpu/vm.h new file mode 100644 index 00000000..364baac6 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/vgpu/vm.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __NVGPU_VM_VGPU_H__ +#define __NVGPU_VM_VGPU_H__ + +#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION +int vgpu_vm_init(struct gk20a *g, struct vm_gk20a *vm); +void vgpu_vm_remove(struct vm_gk20a *vm); +#endif + +#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h index fed58f24..403f3b18 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h @@ -225,12 +225,10 @@ int nvgpu_insert_mapped_buf(struct vm_gk20a *vm, void nvgpu_remove_mapped_buf(struct vm_gk20a *vm, struct nvgpu_mapped_buf *mapped_buffer); +void nvgpu_deinit_vm(struct vm_gk20a *vm); 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); -#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION -void nvgpu_vm_remove_vgpu(struct vm_gk20a *vm); -#endif int nvgpu_init_vm(struct mm_gk20a *mm, struct vm_gk20a *vm, @@ -241,7 +239,6 @@ int nvgpu_init_vm(struct mm_gk20a *mm, bool big_pages, bool userspace_managed, 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. -- cgit v1.2.2