summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-05-26 19:12:19 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:52:05 -0500
commit94a7c5ff2cbe8a583e9b8fc4777e5debe4c48810 (patch)
tree2fc8d0010817a91bdaaec50b88bdecf7dfc58f60 /drivers/gpu/nvgpu/gp10b/mm_gp10b.c
parent2907e24e8bb31f41d13692aef76aa7c0ca227525 (diff)
gpu: nvgpu: gp10b: Fix PDE/PTE address handling
We were dropping the part of address that span word bounary. The register generator does not know how to real with multi-word fields, to edit things in manually. Bug 1646531 Change-Id: I3ef06d6dfcb0a499ed45456d165fe60c91492250 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/747468
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/mm_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/mm_gp10b.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
index c651eeb9..bcdee9fc 100644
--- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c
@@ -171,7 +171,7 @@ static int update_gmmu_pde3_locked(struct vm_gk20a *vm,
171 pde_v[0] |= gmmu_new_pde_aperture_video_memory_f(); 171 pde_v[0] |= gmmu_new_pde_aperture_video_memory_f();
172 pde_v[0] |= gmmu_new_pde_address_sys_f(u64_lo32(pte_addr)); 172 pde_v[0] |= gmmu_new_pde_address_sys_f(u64_lo32(pte_addr));
173 pde_v[0] |= gmmu_new_pde_vol_true_f(); 173 pde_v[0] |= gmmu_new_pde_vol_true_f();
174 174 pde_v[1] |= pte_addr >> 24;
175 pde = pde3_from_index(parent, i); 175 pde = pde3_from_index(parent, i);
176 176
177 gk20a_mem_wr32(pde, 0, pde_v[0]); 177 gk20a_mem_wr32(pde, 0, pde_v[0]);
@@ -222,12 +222,14 @@ static int update_gmmu_pde0_locked(struct vm_gk20a *vm,
222 pde_v[2] |= gmmu_new_dual_pde_address_small_sys_f(pte_addr_small); 222 pde_v[2] |= gmmu_new_dual_pde_address_small_sys_f(pte_addr_small);
223 pde_v[2] |= gmmu_new_dual_pde_aperture_small_video_memory_f(); 223 pde_v[2] |= gmmu_new_dual_pde_aperture_small_video_memory_f();
224 pde_v[2] |= gmmu_new_dual_pde_vol_small_true_f(); 224 pde_v[2] |= gmmu_new_dual_pde_vol_small_true_f();
225 pde_v[3] |= pte_addr_small >> 24;
225 } 226 }
226 227
227 if (big_valid) { 228 if (big_valid) {
228 pde_v[0] |= gmmu_new_dual_pde_address_big_sys_f(pte_addr_big); 229 pde_v[0] |= gmmu_new_dual_pde_address_big_sys_f(pte_addr_big);
229 pde_v[0] |= gmmu_new_dual_pde_vol_big_true_f(); 230 pde_v[0] |= gmmu_new_dual_pde_vol_big_true_f();
230 pde_v[0] |= gmmu_new_dual_pde_aperture_big_video_memory_f(); 231 pde_v[0] |= gmmu_new_dual_pde_aperture_big_video_memory_f();
232 pde_v[1] |= pte_addr_big >> 28;
231 } 233 }
232 234
233 pde = pde0_from_index(pte, i); 235 pde = pde0_from_index(pte, i);
@@ -269,7 +271,8 @@ static int update_gmmu_pte_locked(struct vm_gk20a *vm,
269 gmmu_new_pte_address_sys_f(*iova 271 gmmu_new_pte_address_sys_f(*iova
270 >> gmmu_new_pte_address_shift_v()); 272 >> gmmu_new_pte_address_shift_v());
271 273
272 pte_w[1] = gmmu_new_pte_kind_f(kind_v) | 274 pte_w[1] = *iova >> (24 + gmmu_new_pte_address_shift_v()) |
275 gmmu_new_pte_kind_f(kind_v) |
273 gmmu_new_pte_comptagline_f(*ctag / ctag_granularity); 276 gmmu_new_pte_comptagline_f(*ctag / ctag_granularity);
274 277
275 if (rw_flag == gk20a_mem_flag_read_only) 278 if (rw_flag == gk20a_mem_flag_read_only)