diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/mm_gp10b.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c index d3297e31..b5ea5d68 100644 --- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c | |||
@@ -157,17 +157,18 @@ static int update_gmmu_pde3_locked(struct vm_gk20a *vm, | |||
157 | int rw_flag, bool sparse, bool priv) | 157 | int rw_flag, bool sparse, bool priv) |
158 | { | 158 | { |
159 | u64 pte_addr = 0; | 159 | u64 pte_addr = 0; |
160 | u64 pde_addr = 0; | ||
161 | struct gk20a_mm_entry *pte = parent->entries + i; | 160 | struct gk20a_mm_entry *pte = parent->entries + i; |
162 | u32 pde_v[2] = {0, 0}; | 161 | u32 pde_v[2] = {0, 0}; |
163 | u32 *pde; | 162 | u32 *pde; |
164 | 163 | ||
165 | gk20a_dbg_fn(""); | 164 | gk20a_dbg_fn(""); |
166 | 165 | ||
167 | pte_addr = sg_phys(pte->sgt->sgl) >> gmmu_new_pde_address_shift_v(); | 166 | if (!sparse) |
168 | pde_addr = sg_phys(parent->sgt->sgl); | 167 | pte_addr = sg_phys(pte->sgt->sgl) |
168 | >> gmmu_new_pde_address_shift_v(); | ||
169 | 169 | ||
170 | pde_v[0] |= gmmu_new_pde_aperture_video_memory_f(); | 170 | pde_v[0] |= sparse ? gmmu_new_pde_aperture_invalid_f() |
171 | : gmmu_new_pde_aperture_video_memory_f(); | ||
171 | 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)); |
172 | pde_v[0] |= gmmu_new_pde_vol_true_f(); | 173 | pde_v[0] |= gmmu_new_pde_vol_true_f(); |
173 | pde_v[1] |= pte_addr >> 24; | 174 | pde_v[1] |= pte_addr >> 24; |
@@ -204,9 +205,12 @@ static int update_gmmu_pde0_locked(struct vm_gk20a *vm, | |||
204 | u32 *pde; | 205 | u32 *pde; |
205 | 206 | ||
206 | gk20a_dbg_fn(""); | 207 | gk20a_dbg_fn(""); |
208 | gk20a_dbg(gpu_dbg_pte, "entry %p\n", entry); | ||
207 | 209 | ||
208 | small_valid = entry->size && entry->pgsz == gmmu_page_size_small; | 210 | small_valid = !sparse && entry->size |
209 | big_valid = entry->size && entry->pgsz == gmmu_page_size_big; | 211 | && entry->pgsz == gmmu_page_size_small; |
212 | big_valid = !sparse && entry->size | ||
213 | && entry->pgsz == gmmu_page_size_big; | ||
210 | 214 | ||
211 | if (small_valid) | 215 | if (small_valid) |
212 | pte_addr_small = sg_phys(entry->sgt->sgl) | 216 | pte_addr_small = sg_phys(entry->sgt->sgl) |
@@ -230,6 +234,11 @@ static int update_gmmu_pde0_locked(struct vm_gk20a *vm, | |||
230 | pde_v[1] |= pte_addr_big >> 28; | 234 | pde_v[1] |= pte_addr_big >> 28; |
231 | } | 235 | } |
232 | 236 | ||
237 | if (sparse) { | ||
238 | pde_v[0] |= gmmu_new_dual_pde_aperture_big_invalid_f(); | ||
239 | pde_v[0] |= gmmu_new_dual_pde_vol_big_true_f(); | ||
240 | } | ||
241 | |||
233 | pde = pde0_from_index(pte, i); | 242 | pde = pde0_from_index(pte, i); |
234 | 243 | ||
235 | gk20a_mem_wr32(pde, 0, pde_v[0]); | 244 | gk20a_mem_wr32(pde, 0, pde_v[0]); |