summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-05-01 19:12:16 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-26 06:33:57 -0400
commitfbafc7eba41ba7654dfdadf51a53acf1638e9fa1 (patch)
tree7457efcb4c9fb9e1f2121267d980f2c380c7f0f6 /drivers/gpu/nvgpu/include
parentf76febb962e1681690dd378884f51770e7271820 (diff)
gpu: nvgpu: Refactor VM init/cleanup
Refactor the API for initializing and cleaning up VMs. This also involved moving a bunch of GMMU code out into the gmmu code since part of initializing a VM involves initializing the page tables for the VM. JIRA NVGPU-12 JIRA NVGPU-30 Change-Id: I4710f08c26a6e39806f0762a35f6db5c94b64c50 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1477746 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/gmmu.h6
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vm.h6
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/gmmu.h b/drivers/gpu/nvgpu/include/nvgpu/gmmu.h
index 6d8aa025..45c5def4 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/gmmu.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/gmmu.h
@@ -63,6 +63,12 @@ struct gk20a_mmu_level {
63 size_t entry_size; 63 size_t entry_size;
64}; 64};
65 65
66int nvgpu_zalloc_gmmu_page_table(struct vm_gk20a *vm,
67 enum gmmu_pgsz_gk20a pgsz_idx,
68 const struct gk20a_mmu_level *l,
69 struct gk20a_mm_entry *entry,
70 struct gk20a_mm_entry *prev_entry);
71
66/** 72/**
67 * nvgpu_gmmu_map - Map memory into the GMMU. 73 * nvgpu_gmmu_map - Map memory into the GMMU.
68 * 74 *
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h
index fb55483d..c89282bf 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/vm.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h
@@ -181,6 +181,7 @@ void nvgpu_vm_get(struct vm_gk20a *vm);
181void nvgpu_vm_put(struct vm_gk20a *vm); 181void nvgpu_vm_put(struct vm_gk20a *vm);
182 182
183int vm_aspace_id(struct vm_gk20a *vm); 183int vm_aspace_id(struct vm_gk20a *vm);
184int nvgpu_big_pages_possible(struct vm_gk20a *vm, u64 base, u64 size);
184 185
185/* batching eliminates redundant cache flushes and invalidates */ 186/* batching eliminates redundant cache flushes and invalidates */
186void nvgpu_vm_mapping_batch_start(struct vm_gk20a_mapping_batch *batch); 187void nvgpu_vm_mapping_batch_start(struct vm_gk20a_mapping_batch *batch);
@@ -194,7 +195,6 @@ void nvgpu_vm_mapping_batch_finish_locked(
194int nvgpu_vm_get_buffers(struct vm_gk20a *vm, 195int nvgpu_vm_get_buffers(struct vm_gk20a *vm,
195 struct nvgpu_mapped_buf ***mapped_buffers, 196 struct nvgpu_mapped_buf ***mapped_buffers,
196 int *num_buffers); 197 int *num_buffers);
197
198/* put references on the given buffers */ 198/* put references on the given buffers */
199void nvgpu_vm_put_buffers(struct vm_gk20a *vm, 199void nvgpu_vm_put_buffers(struct vm_gk20a *vm,
200 struct nvgpu_mapped_buf **mapped_buffers, 200 struct nvgpu_mapped_buf **mapped_buffers,
@@ -220,7 +220,6 @@ struct nvgpu_mapped_buf *__nvgpu_vm_find_mapped_buf_less_than(
220int nvgpu_vm_find_buf(struct vm_gk20a *vm, u64 gpu_va, 220int nvgpu_vm_find_buf(struct vm_gk20a *vm, u64 gpu_va,
221 struct dma_buf **dmabuf, 221 struct dma_buf **dmabuf,
222 u64 *offset); 222 u64 *offset);
223
224int nvgpu_insert_mapped_buf(struct vm_gk20a *vm, 223int nvgpu_insert_mapped_buf(struct vm_gk20a *vm,
225 struct nvgpu_mapped_buf *mapped_buffer); 224 struct nvgpu_mapped_buf *mapped_buffer);
226void nvgpu_remove_mapped_buf(struct vm_gk20a *vm, 225void nvgpu_remove_mapped_buf(struct vm_gk20a *vm,
@@ -228,8 +227,7 @@ void nvgpu_remove_mapped_buf(struct vm_gk20a *vm,
228 227
229void nvgpu_vm_remove_support_nofree(struct vm_gk20a *vm); 228void nvgpu_vm_remove_support_nofree(struct vm_gk20a *vm);
230void nvgpu_vm_remove_support(struct vm_gk20a *vm); 229void nvgpu_vm_remove_support(struct vm_gk20a *vm);
231 230void nvgpu_vm_remove(struct vm_gk20a *vm, struct nvgpu_mem *inst_block);
232void nvgpu_remove_vm(struct vm_gk20a *vm, struct nvgpu_mem *inst_block);
233 231
234int nvgpu_init_vm(struct mm_gk20a *mm, 232int nvgpu_init_vm(struct mm_gk20a *mm,
235 struct vm_gk20a *vm, 233 struct vm_gk20a *vm,