summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
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/gk20a
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/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c8
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a.h3
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c1
6 files changed, 7 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
index c7552f04..546d2eb1 100644
--- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
@@ -1886,7 +1886,7 @@ static int gk20a_perfbuf_map(struct dbg_session_gk20a *dbg_s,
1886 struct mm_gk20a *mm = &g->mm; 1886 struct mm_gk20a *mm = &g->mm;
1887 int err; 1887 int err;
1888 u32 virt_size; 1888 u32 virt_size;
1889 u32 big_page_size = gk20a_get_platform(g->dev)->default_big_page_size; 1889 u32 big_page_size = g->ops.mm.get_default_big_page_size();
1890 1890
1891 nvgpu_mutex_acquire(&g->dbg_sessions_lock); 1891 nvgpu_mutex_acquire(&g->dbg_sessions_lock);
1892 1892
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 7506c1dd..a87d34f9 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -420,7 +420,7 @@ int gk20a_init_gpu_characteristics(struct gk20a *g)
420 gpu->bus_type = NVGPU_GPU_BUS_TYPE_AXI; /* always AXI for now */ 420 gpu->bus_type = NVGPU_GPU_BUS_TYPE_AXI; /* always AXI for now */
421 421
422 gpu->compression_page_size = g->ops.fb.compression_page_size(g); 422 gpu->compression_page_size = g->ops.fb.compression_page_size(g);
423 gpu->big_page_size = platform->default_big_page_size; 423 gpu->big_page_size = g->ops.mm.get_default_big_page_size();
424 gpu->pde_coverage_bit_count = 424 gpu->pde_coverage_bit_count =
425 g->ops.mm.get_mmu_levels(g, gpu->big_page_size)[0].lo_bit[0]; 425 g->ops.mm.get_mmu_levels(g, gpu->big_page_size)[0].lo_bit[0];
426 426
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 9b28e0c6..1e6995c4 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -674,6 +674,7 @@ struct gpu_ops {
674 void (*set_big_page_size)(struct gk20a *g, 674 void (*set_big_page_size)(struct gk20a *g,
675 struct nvgpu_mem *mem, int size); 675 struct nvgpu_mem *mem, int size);
676 u32 (*get_big_page_sizes)(void); 676 u32 (*get_big_page_sizes)(void);
677 u32 (*get_default_big_page_size)(void);
677 u32 (*get_physical_addr_bits)(struct gk20a *g); 678 u32 (*get_physical_addr_bits)(struct gk20a *g);
678 int (*init_mm_setup_hw)(struct gk20a *g); 679 int (*init_mm_setup_hw)(struct gk20a *g);
679 bool (*is_bar1_supported)(struct gk20a *g); 680 bool (*is_bar1_supported)(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index fa6b5109..52053c14 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -2124,7 +2124,7 @@ static int gk20a_init_bar1_vm(struct mm_gk20a *mm)
2124 int err; 2124 int err;
2125 struct gk20a *g = gk20a_from_mm(mm); 2125 struct gk20a *g = gk20a_from_mm(mm);
2126 struct nvgpu_mem *inst_block = &mm->bar1.inst_block; 2126 struct nvgpu_mem *inst_block = &mm->bar1.inst_block;
2127 u32 big_page_size = gk20a_get_platform(g->dev)->default_big_page_size; 2127 u32 big_page_size = g->ops.mm.get_default_big_page_size();
2128 2128
2129 mm->bar1.aperture_size = bar1_aperture_size_mb_gk20a() << 20; 2129 mm->bar1.aperture_size = bar1_aperture_size_mb_gk20a() << 20;
2130 gk20a_dbg_info("bar1 vm size = 0x%x", mm->bar1.aperture_size); 2130 gk20a_dbg_info("bar1 vm size = 0x%x", mm->bar1.aperture_size);
@@ -2156,7 +2156,7 @@ static int gk20a_init_system_vm(struct mm_gk20a *mm)
2156 int err; 2156 int err;
2157 struct gk20a *g = gk20a_from_mm(mm); 2157 struct gk20a *g = gk20a_from_mm(mm);
2158 struct nvgpu_mem *inst_block = &mm->pmu.inst_block; 2158 struct nvgpu_mem *inst_block = &mm->pmu.inst_block;
2159 u32 big_page_size = gk20a_get_platform(g->dev)->default_big_page_size; 2159 u32 big_page_size = g->ops.mm.get_default_big_page_size();
2160 u32 low_hole, aperture_size; 2160 u32 low_hole, aperture_size;
2161 2161
2162 /* 2162 /*
@@ -2207,7 +2207,7 @@ static int gk20a_init_hwpm(struct mm_gk20a *mm)
2207static int gk20a_init_cde_vm(struct mm_gk20a *mm) 2207static int gk20a_init_cde_vm(struct mm_gk20a *mm)
2208{ 2208{
2209 struct gk20a *g = gk20a_from_mm(mm); 2209 struct gk20a *g = gk20a_from_mm(mm);
2210 u32 big_page_size = gk20a_get_platform(g->dev)->default_big_page_size; 2210 u32 big_page_size = g->ops.mm.get_default_big_page_size();
2211 2211
2212 mm->cde.vm = nvgpu_vm_init(g, big_page_size, 2212 mm->cde.vm = nvgpu_vm_init(g, big_page_size,
2213 big_page_size << 10, 2213 big_page_size << 10,
@@ -2222,7 +2222,7 @@ static int gk20a_init_cde_vm(struct mm_gk20a *mm)
2222static int gk20a_init_ce_vm(struct mm_gk20a *mm) 2222static int gk20a_init_ce_vm(struct mm_gk20a *mm)
2223{ 2223{
2224 struct gk20a *g = gk20a_from_mm(mm); 2224 struct gk20a *g = gk20a_from_mm(mm);
2225 u32 big_page_size = gk20a_get_platform(g->dev)->default_big_page_size; 2225 u32 big_page_size = g->ops.mm.get_default_big_page_size();
2226 2226
2227 mm->ce.vm = nvgpu_vm_init(g, big_page_size, 2227 mm->ce.vm = nvgpu_vm_init(g, big_page_size,
2228 big_page_size << 10, 2228 big_page_size << 10,
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
index 3eda1da4..04ac2505 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
@@ -111,9 +111,6 @@ struct gk20a_platform {
111 */ 111 */
112 bool force_reset_in_do_idle; 112 bool force_reset_in_do_idle;
113 113
114 /* Default big page size 64K or 128K */
115 u32 default_big_page_size;
116
117 /* default pri timeout, on PCIe it should be lower than timeout 114 /* default pri timeout, on PCIe it should be lower than timeout
118 * detection 115 * detection
119 */ 116 */
diff --git a/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c
index 48b5a90a..bbf1092c 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c
+++ b/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c
@@ -52,7 +52,6 @@ struct gk20a_platform vgpu_tegra_platform = {
52 .ch_wdt_timeout_ms = 5000, 52 .ch_wdt_timeout_ms = 5000,
53 53
54 .probe = gk20a_tegra_probe, 54 .probe = gk20a_tegra_probe,
55 .default_big_page_size = SZ_128K,
56 55
57 .clk_round_rate = vgpu_clk_round_rate, 56 .clk_round_rate = vgpu_clk_round_rate,
58 .get_clk_freqs = vgpu_clk_get_freqs, 57 .get_clk_freqs = vgpu_clk_get_freqs,