From 001c7c3185d9b087f89f48a41bee27d2d06721f6 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 22 Jun 2017 12:55:17 -0700 Subject: gpu: nvgpu: Per chip default big page size Make default big page size query a HAL op instead of per-platform constant. This allows querying for default big page size without accessing Linux specific gk20a_platform structure. JIRA NVGPU-38 Change-Id: Ibfbd1319764fdae5fdb06700fb64d23f6f3dd01a Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master/r/1507928 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gp10b/mm_gp10b.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gp10b/mm_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c index 3cd3eb50..d7391c6d 100644 --- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c @@ -26,6 +26,11 @@ #include #include +static u32 gp10b_mm_get_default_big_page_size(void) +{ + return SZ_64K; +} + static u32 gp10b_mm_get_physical_addr_bits(struct gk20a *g) { return 36; @@ -68,7 +73,7 @@ static int gb10b_init_bar2_vm(struct gk20a *g) int err; struct mm_gk20a *mm = &g->mm; struct nvgpu_mem *inst_block = &mm->bar2.inst_block; - u32 big_page_size = gk20a_get_platform(g->dev)->default_big_page_size; + u32 big_page_size = g->ops.mm.get_default_big_page_size(); /* BAR2 aperture size is 32MB */ mm->bar2.aperture_size = 32 << 20; @@ -410,6 +415,7 @@ static void gp10b_remove_bar2_vm(struct gk20a *g) void gp10b_init_mm(struct gpu_ops *gops) { gm20b_init_mm(gops); + gops->mm.get_default_big_page_size = gp10b_mm_get_default_big_page_size; gops->mm.get_physical_addr_bits = gp10b_mm_get_physical_addr_bits; gops->mm.init_mm_setup_hw = gp10b_init_mm_setup_hw; gops->mm.init_bar2_vm = gb10b_init_bar2_vm; -- cgit v1.2.2