summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2016-08-23 05:03:56 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:56:19 -0500
commit758add10abe564fb58ed928e0f5a8f1b4d31414f (patch)
tree34b1aef65a4d0ae7aac704b3b895ba5727b67a42 /drivers/gpu/nvgpu/gp10b/mm_gp10b.c
parent7a2cc9c58c74ee025625a64461b3045b256626c9 (diff)
gpu: nvgpu: use get_base_addr() for pdb and mm_entry
Since page tables could either reside either in sysmem or vidmem, use gk20a_mem_get_base_addr() to get the base address for buffer This API will take care of returning proper base address Jira DNVGPU-20 Change-Id: I3422b51c3ffb8fb86f1dc5095263fc8f19dae44d Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1206407 (cherry picked from commit 3c4b22c35b2c4eec33234c2f8dccd9de9422d093) Reviewed-on: http://git-master/r/1210962 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/mm_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/mm_gp10b.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
index 7778883e..c9da4c93 100644
--- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
@@ -154,10 +154,11 @@ static u32 pte3_from_index(u32 i)
154static u64 entry_addr(struct gk20a *g, struct gk20a_mm_entry *entry) 154static u64 entry_addr(struct gk20a *g, struct gk20a_mm_entry *entry)
155{ 155{
156 u64 addr; 156 u64 addr;
157
157 if (g->mm.has_physical_mode) 158 if (g->mm.has_physical_mode)
158 addr = sg_phys(entry->mem.sgt->sgl); 159 addr = sg_phys(entry->mem.sgt->sgl);
159 else 160 else
160 addr = g->ops.mm.get_iova_addr(g, entry->mem.sgt->sgl, 0); 161 addr = gk20a_mem_get_base_addr(g, &entry->mem, 0);
161 162
162 return addr; 163 return addr;
163} 164}
@@ -386,7 +387,7 @@ static const struct gk20a_mmu_level *gp10b_mm_get_mmu_levels(struct gk20a *g,
386static void gp10b_mm_init_pdb(struct gk20a *g, struct mem_desc *inst_block, 387static void gp10b_mm_init_pdb(struct gk20a *g, struct mem_desc *inst_block,
387 struct vm_gk20a *vm) 388 struct vm_gk20a *vm)
388{ 389{
389 u64 pdb_addr = g->ops.mm.get_iova_addr(g, vm->pdb.mem.sgt->sgl, 0); 390 u64 pdb_addr = gk20a_mem_get_base_addr(g, &vm->pdb.mem, 0);
390 u32 pdb_addr_lo = u64_lo32(pdb_addr >> ram_in_base_shift_v()); 391 u32 pdb_addr_lo = u64_lo32(pdb_addr >> ram_in_base_shift_v());
391 u32 pdb_addr_hi = u64_hi32(pdb_addr); 392 u32 pdb_addr_hi = u64_hi32(pdb_addr);
392 393