drm/amdgpu: remove keeping the addr of the VM PDs

No more double house keeping.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Christian König 2017-11-30 15:41:28 +01:00 committed by Alex Deucher
parent 8f19cd78c9
commit 78eb2f0c71
2 changed files with 5 additions and 10 deletions

View file

@ -383,7 +383,6 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,
spin_lock(&vm->status_lock);
list_add(&entry->base.vm_status, &vm->relocated);
spin_unlock(&vm->status_lock);
entry->addr = 0;
}
if (level < adev->vm_manager.num_level) {
@ -1125,15 +1124,12 @@ static int amdgpu_vm_update_pde(struct amdgpu_device *adev,
pt = amdgpu_bo_gpu_offset(bo);
pt = amdgpu_gart_get_vm_pde(adev, pt);
/* Don't update huge pages here */
if (entry->addr & AMDGPU_PDE_PTE ||
entry->addr == (pt | AMDGPU_PTE_VALID)) {
if (entry->huge) {
if (!vm->use_cpu_for_update)
amdgpu_job_free(job);
return 0;
}
entry->addr = pt | AMDGPU_PTE_VALID;
if (shadow) {
pde = shadow_addr + (entry - parent->entries) * 8;
params.func(&params, pde, pt, 1, 0, AMDGPU_PTE_VALID);
@ -1199,7 +1195,6 @@ static void amdgpu_vm_invalidate_level(struct amdgpu_device *adev,
if (!entry->base.bo)
continue;
entry->addr = ~0ULL;
spin_lock(&vm->status_lock);
if (list_empty(&entry->base.vm_status))
list_add(&entry->base.vm_status, &vm->relocated);
@ -1332,10 +1327,10 @@ static void amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p,
flags |= AMDGPU_PDE_PTE;
}
if (entry->addr == (dst | flags))
if (!entry->huge && !(flags & AMDGPU_PDE_PTE))
return;
entry->addr = (dst | flags);
entry->huge = !!(flags & AMDGPU_PDE_PTE);
if (use_cpu_update) {
/* In case a huge page is replaced with a system
@ -1409,7 +1404,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params,
amdgpu_vm_handle_huge_pages(params, entry, parent,
nptes, dst, flags);
/* We don't need to update PTEs for huge pages */
if (entry->addr & AMDGPU_PDE_PTE)
if (entry->huge)
continue;
pt = entry->base.bo;

View file

@ -138,7 +138,7 @@ struct amdgpu_vm_bo_base {
struct amdgpu_vm_pt {
struct amdgpu_vm_bo_base base;
uint64_t addr;
bool huge;
/* array of page tables, one for each directory entry */
struct amdgpu_vm_pt *entries;