gpu: nvgpu: Remove alloc_inst_block from mm HAL

The alloc_insty_block() function in the MM HAL is not a HAL. It does
not abstract any HW accesses; instead it just wraps a dma allocation.
As such remove it from the HAL and move the single gk20a implementation
to common/mm/mm.c as nvgpu_alloc_inst_block().

JIRA NVGPU-2042

Change-Id: I0a586800a11cd230ca43b85f94a35de107f5d1e1
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2109049
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Alex Waterman
2019-04-26 13:21:16 -07:00
committed by mobile promotions
parent a68f66d307
commit c71e764348
16 changed files with 34 additions and 40 deletions

View File

@@ -299,7 +299,6 @@ static int init_mm(struct unit_module *m, struct gk20a *g)
g->ops.mm.gmmu.get_default_big_page_size =
gp10b_mm_get_default_big_page_size;
g->ops.mm.gmmu.get_mmu_levels = gp10b_mm_get_mmu_levels;
g->ops.mm.alloc_inst_block = gk20a_alloc_inst_block;
g->ops.mm.init_inst_block = gv11b_init_inst_block;
g->ops.mm.gmmu.map = nvgpu_gmmu_map_locked;
g->ops.mm.gmmu.unmap = nvgpu_gmmu_unmap_locked;

View File

@@ -121,7 +121,6 @@ static int init_mm(struct unit_module *m, struct gk20a *g)
g->ops.mm.gmmu.get_default_big_page_size =
gp10b_mm_get_default_big_page_size;
g->ops.mm.gmmu.get_mmu_levels = gp10b_mm_get_mmu_levels;
g->ops.mm.alloc_inst_block = gk20a_alloc_inst_block;
g->ops.mm.init_inst_block = gv11b_init_inst_block;
g->ops.mm.gmmu.map = nvgpu_gmmu_map_locked;
g->ops.mm.gmmu.unmap = nvgpu_gmmu_unmap_locked;
@@ -312,10 +311,10 @@ static int test_page_faults_disable_hw(struct unit_module *m, struct gk20a *g,
/*
* Test: test_page_faults_inst_block.
* This test supports 3 types of scenario to cover corner cases:
* 0 (default): regular alloc_inst_block with default values
* 1: alloc_inst_block with large page size
* 2: alloc_inst_block with large page size and set_big_page_size set to NULL to
* test a corner case in gv11b_init_inst_block (branch coverage)
* 0 (default): regular nvgpu_alloc_inst_block with default values
* 1: nvgpu_alloc_inst_block with large page size
* 2: nvgpu_alloc_inst_block with large page size and set_big_page_size set to
* NULL to test a corner case in gv11b_init_inst_block (branch coverage)
*/
static int test_page_faults_inst_block(struct unit_module *m, struct gk20a *g,
void *args)
@@ -334,8 +333,8 @@ static int test_page_faults_inst_block(struct unit_module *m, struct gk20a *g,
g->ops.ramin.set_big_page_size = NULL;
}
if (g->ops.mm.alloc_inst_block(g, &inst_blk_desc) != 0) {
unit_return_fail(m, "alloc_inst_block failed\n");
if (nvgpu_alloc_inst_block(g, &inst_blk_desc) != 0) {
unit_return_fail(m, "nvgpu_alloc_inst_block failed\n");
}
g->ops.mm.init_inst_block(&inst_blk_desc, g->mm.bar2.vm, big_page_size);