From 8d63cd3995d4a650b478ad69d7e29ed2b1b2d927 Mon Sep 17 00:00:00 2001 From: Sunny He Date: Mon, 31 Jul 2017 18:54:38 -0700 Subject: gpu: nvgpu: Reorg mm HAL initialization Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the mm sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: I289284e6e528fc7951c959c8765ccf9349eec33b Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1533351 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gm20b/mm_gm20b.c | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) (limited to 'drivers/gpu/nvgpu/gm20b/mm_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c index bbcd6314..05752f03 100644 --- a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c @@ -20,7 +20,7 @@ #include #include -static void gm20b_mm_set_big_page_size(struct gk20a *g, +void gm20b_mm_set_big_page_size(struct gk20a *g, struct nvgpu_mem *mem, int size) { u32 val; @@ -40,22 +40,22 @@ static void gm20b_mm_set_big_page_size(struct gk20a *g, gk20a_dbg_fn("done"); } -static u32 gm20b_mm_get_big_page_sizes(void) +u32 gm20b_mm_get_big_page_sizes(void) { return SZ_64K | SZ_128K; } -static u32 gm20b_mm_get_default_big_page_size(void) +u32 gm20b_mm_get_default_big_page_size(void) { return SZ_128K; } -static bool gm20b_mm_support_sparse(struct gk20a *g) +bool gm20b_mm_support_sparse(struct gk20a *g) { return true; } -static bool gm20b_mm_is_bar1_supported(struct gk20a *g) +bool gm20b_mm_is_bar1_supported(struct gk20a *g) { return true; } @@ -65,26 +65,3 @@ u64 gm20b_gpu_phys_addr(struct gk20a *g, { return phys; } - -void gm20b_init_mm(struct gpu_ops *gops) -{ - gops->mm.support_sparse = gm20b_mm_support_sparse; - gops->mm.gmmu_map = gk20a_locked_gmmu_map; - gops->mm.gmmu_unmap = gk20a_locked_gmmu_unmap; - gops->mm.vm_bind_channel = gk20a_vm_bind_channel; - gops->mm.fb_flush = gk20a_mm_fb_flush; - gops->mm.l2_invalidate = gk20a_mm_l2_invalidate; - gops->mm.l2_flush = gk20a_mm_l2_flush; - gops->mm.cbc_clean = gk20a_mm_cbc_clean; - gops->mm.set_big_page_size = gm20b_mm_set_big_page_size; - gops->mm.get_big_page_sizes = gm20b_mm_get_big_page_sizes; - gops->mm.get_default_big_page_size = gm20b_mm_get_default_big_page_size; - gops->mm.gpu_phys_addr = gm20b_gpu_phys_addr; - gops->mm.get_physical_addr_bits = gk20a_mm_get_physical_addr_bits; - gops->mm.get_mmu_levels = gk20a_mm_get_mmu_levels; - gops->mm.init_pdb = gk20a_mm_init_pdb; - gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw; - gops->mm.is_bar1_supported = gm20b_mm_is_bar1_supported; - gops->mm.init_inst_block = gk20a_init_inst_block; - gops->mm.mmu_fault_pending = gk20a_fifo_mmu_fault_pending; -} -- cgit v1.2.2