diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-05-09 19:41:18 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-06 20:09:11 -0400 |
commit | c2b63150cd947557b8d17637258b988459b8e0ec (patch) | |
tree | 5b15911b0b4799538ca98c9b6c1a31c0cbfe4a99 /drivers/gpu/nvgpu/include | |
parent | 6bd7d22c0f248d0d29ea44b06798b247d0d2753a (diff) |
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 <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1480226
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/vgpu/vm.h | 25 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/vm.h | 5 |
2 files changed, 26 insertions, 4 deletions
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 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef __NVGPU_VM_VGPU_H__ | ||
18 | #define __NVGPU_VM_VGPU_H__ | ||
19 | |||
20 | #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION | ||
21 | int vgpu_vm_init(struct gk20a *g, struct vm_gk20a *vm); | ||
22 | void vgpu_vm_remove(struct vm_gk20a *vm); | ||
23 | #endif | ||
24 | |||
25 | #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, | |||
225 | void nvgpu_remove_mapped_buf(struct vm_gk20a *vm, | 225 | void nvgpu_remove_mapped_buf(struct vm_gk20a *vm, |
226 | struct nvgpu_mapped_buf *mapped_buffer); | 226 | struct nvgpu_mapped_buf *mapped_buffer); |
227 | 227 | ||
228 | void nvgpu_deinit_vm(struct vm_gk20a *vm); | ||
228 | void __nvgpu_vm_remove(struct vm_gk20a *vm); | 229 | void __nvgpu_vm_remove(struct vm_gk20a *vm); |
229 | void nvgpu_vm_remove(struct vm_gk20a *vm); | 230 | void nvgpu_vm_remove(struct vm_gk20a *vm); |
230 | void nvgpu_vm_remove_inst(struct vm_gk20a *vm, struct nvgpu_mem *inst_block); | 231 | void nvgpu_vm_remove_inst(struct vm_gk20a *vm, struct nvgpu_mem *inst_block); |
231 | #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION | ||
232 | void nvgpu_vm_remove_vgpu(struct vm_gk20a *vm); | ||
233 | #endif | ||
234 | 232 | ||
235 | int nvgpu_init_vm(struct mm_gk20a *mm, | 233 | int nvgpu_init_vm(struct mm_gk20a *mm, |
236 | struct vm_gk20a *vm, | 234 | struct vm_gk20a *vm, |
@@ -241,7 +239,6 @@ int nvgpu_init_vm(struct mm_gk20a *mm, | |||
241 | bool big_pages, | 239 | bool big_pages, |
242 | bool userspace_managed, | 240 | bool userspace_managed, |
243 | char *name); | 241 | char *name); |
244 | void nvgpu_deinit_vm(struct vm_gk20a *vm); | ||
245 | 242 | ||
246 | /* | 243 | /* |
247 | * These are private to the VM code but are unfortunately used by the vgpu code. | 244 | * These are private to the VM code but are unfortunately used by the vgpu code. |