summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-11-30 17:41:28 +0300
committerAlex Deucher <alexander.deucher@amd.com>2017-12-12 22:46:06 +0300
commit78eb2f0c719e6427eb5ac36cebe18df0578421d2 (patch)
treeeacc768d8834a7329476093b9547774e3b2d80b2 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parent8f19cd78c986fb0eb24a1847931c096ec9e214a5 (diff)
downloadlinux-78eb2f0c719e6427eb5ac36cebe18df0578421d2.tar.xz
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 25fdcba5681c..9e6cf130f832 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -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;