summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-06-22 15:55:17 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-30 21:34:59 -0400
commit001c7c3185d9b087f89f48a41bee27d2d06721f6 (patch)
treec869be82279688a5dbe5d1145da09ca2323aef92 /drivers/gpu/nvgpu/gp10b/mm_gp10b.c
parent82c0c96290602b1baf296133c7f55ae1848e433a (diff)
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 <tbergstrom@nvidia.com> Reviewed-on: https://git-master/r/1507928 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/mm_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/mm_gp10b.c8
1 files changed, 7 insertions, 1 deletions
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 @@
26#include <nvgpu/hw/gp10b/hw_bus_gp10b.h> 26#include <nvgpu/hw/gp10b/hw_bus_gp10b.h>
27#include <nvgpu/hw/gp10b/hw_gmmu_gp10b.h> 27#include <nvgpu/hw/gp10b/hw_gmmu_gp10b.h>
28 28
29static u32 gp10b_mm_get_default_big_page_size(void)
30{
31 return SZ_64K;
32}
33
29static u32 gp10b_mm_get_physical_addr_bits(struct gk20a *g) 34static u32 gp10b_mm_get_physical_addr_bits(struct gk20a *g)
30{ 35{
31 return 36; 36 return 36;
@@ -68,7 +73,7 @@ static int gb10b_init_bar2_vm(struct gk20a *g)
68 int err; 73 int err;
69 struct mm_gk20a *mm = &g->mm; 74 struct mm_gk20a *mm = &g->mm;
70 struct nvgpu_mem *inst_block = &mm->bar2.inst_block; 75 struct nvgpu_mem *inst_block = &mm->bar2.inst_block;
71 u32 big_page_size = gk20a_get_platform(g->dev)->default_big_page_size; 76 u32 big_page_size = g->ops.mm.get_default_big_page_size();
72 77
73 /* BAR2 aperture size is 32MB */ 78 /* BAR2 aperture size is 32MB */
74 mm->bar2.aperture_size = 32 << 20; 79 mm->bar2.aperture_size = 32 << 20;
@@ -410,6 +415,7 @@ static void gp10b_remove_bar2_vm(struct gk20a *g)
410void gp10b_init_mm(struct gpu_ops *gops) 415void gp10b_init_mm(struct gpu_ops *gops)
411{ 416{
412 gm20b_init_mm(gops); 417 gm20b_init_mm(gops);
418 gops->mm.get_default_big_page_size = gp10b_mm_get_default_big_page_size;
413 gops->mm.get_physical_addr_bits = gp10b_mm_get_physical_addr_bits; 419 gops->mm.get_physical_addr_bits = gp10b_mm_get_physical_addr_bits;
414 gops->mm.init_mm_setup_hw = gp10b_init_mm_setup_hw; 420 gops->mm.init_mm_setup_hw = gp10b_init_mm_setup_hw;
415 gops->mm.init_bar2_vm = gb10b_init_bar2_vm; 421 gops->mm.init_bar2_vm = gb10b_init_bar2_vm;