From c3fa78b1d9cba28547ca59154207d434931ae746 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Mon, 10 Apr 2017 14:04:15 -0700 Subject: gpu: nvgpu: Separate GMMU out of mm_gk20a.c Begin moving (and renaming) the GMMU code into common/mm/gmmu.c. This block of code will be responsible for handling the platform/OS independent GMMU operations. JIRA NVGPU-12 JIRA NVGPU-30 Change-Id: Ide761bab75e5d84be3dcb977c4842ae4b3a7c1b3 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1464083 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 68 -------------------------------------- 1 file changed, 68 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index d95a2cde..08c99895 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -2441,74 +2441,6 @@ int gk20a_vm_map_compbits(struct vm_gk20a *vm, return 0; } -/* - * Core GMMU map function for the kernel to use. If @addr is 0 then the GPU - * VA will be allocated for you. If addr is non-zero then the buffer will be - * mapped at @addr. - */ -static u64 __gk20a_gmmu_map(struct vm_gk20a *vm, - struct sg_table **sgt, - u64 addr, - u64 size, - u32 flags, - int rw_flag, - bool priv, - enum nvgpu_aperture aperture) -{ - struct gk20a *g = gk20a_from_vm(vm); - u64 vaddr; - - nvgpu_mutex_acquire(&vm->update_gmmu_lock); - vaddr = g->ops.mm.gmmu_map(vm, addr, - *sgt, /* sg table */ - 0, /* sg offset */ - size, - gmmu_page_size_kernel, - 0, /* kind */ - 0, /* ctag_offset */ - flags, rw_flag, - false, /* clear_ctags */ - false, /* sparse */ - priv, /* priv */ - NULL, /* mapping_batch handle */ - aperture); - nvgpu_mutex_release(&vm->update_gmmu_lock); - if (!vaddr) { - nvgpu_err(g, "failed to allocate va space"); - return 0; - } - - return vaddr; -} - -u64 gk20a_gmmu_map(struct vm_gk20a *vm, - struct sg_table **sgt, - u64 size, - u32 flags, - int rw_flag, - bool priv, - enum nvgpu_aperture aperture) -{ - return __gk20a_gmmu_map(vm, sgt, 0, size, flags, rw_flag, priv, - aperture); -} - -/* - * Like gk20a_gmmu_map() except it works on a fixed address instead. - */ -u64 gk20a_gmmu_fixed_map(struct vm_gk20a *vm, - struct sg_table **sgt, - u64 addr, - u64 size, - u32 flags, - int rw_flag, - bool priv, - enum nvgpu_aperture aperture) -{ - return __gk20a_gmmu_map(vm, sgt, addr, size, flags, rw_flag, priv, - aperture); -} - #if defined(CONFIG_GK20A_VIDMEM) static int gk20a_gmmu_clear_vidmem_mem(struct gk20a *g, struct nvgpu_mem *mem) { -- cgit v1.2.2