diff options
author | Christian König <christian.koenig@amd.com> | 2017-08-03 14:30:50 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-08-17 15:46:06 -0400 |
commit | 4ab4016aaf82153d144fa678cd6b4b5b6f25ed70 (patch) | |
tree | 515357553266566d7101e2560e868dd1a559eb5a /drivers/gpu/drm/amd/amdgpu | |
parent | ec5207c9f1cf42be826b9e3b63fb9b7463ed7fab (diff) |
drm/amdgpu: drop the extra VM huge page flag v2
Just add the flags to the addr field as well.
v2: add some more comments that the flag is for huge pages.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 1 |
2 files changed, 9 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 420026bc2514..14012e80fa27 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -331,7 +331,6 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev, | |||
331 | 331 | ||
332 | entry->bo = pt; | 332 | entry->bo = pt; |
333 | entry->addr = 0; | 333 | entry->addr = 0; |
334 | entry->huge_page = false; | ||
335 | } | 334 | } |
336 | 335 | ||
337 | if (level < adev->vm_manager.num_level) { | 336 | if (level < adev->vm_manager.num_level) { |
@@ -1083,11 +1082,12 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev, | |||
1083 | 1082 | ||
1084 | pt = amdgpu_bo_gpu_offset(bo); | 1083 | pt = amdgpu_bo_gpu_offset(bo); |
1085 | pt = amdgpu_gart_get_vm_pde(adev, pt); | 1084 | pt = amdgpu_gart_get_vm_pde(adev, pt); |
1086 | if (parent->entries[pt_idx].addr == pt || | 1085 | /* Don't update huge pages here */ |
1087 | parent->entries[pt_idx].huge_page) | 1086 | if ((parent->entries[pt_idx].addr & AMDGPU_PDE_PTE) || |
1087 | parent->entries[pt_idx].addr == (pt | AMDGPU_PTE_VALID)) | ||
1088 | continue; | 1088 | continue; |
1089 | 1089 | ||
1090 | parent->entries[pt_idx].addr = pt; | 1090 | parent->entries[pt_idx].addr = pt | AMDGPU_PTE_VALID; |
1091 | 1091 | ||
1092 | pde = pd_addr + pt_idx * 8; | 1092 | pde = pd_addr + pt_idx * 8; |
1093 | if (((last_pde + 8 * count) != pde) || | 1093 | if (((last_pde + 8 * count) != pde) || |
@@ -1284,15 +1284,14 @@ static void amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p, | |||
1284 | dst = amdgpu_gart_get_vm_pde(p->adev, dst); | 1284 | dst = amdgpu_gart_get_vm_pde(p->adev, dst); |
1285 | flags = AMDGPU_PTE_VALID; | 1285 | flags = AMDGPU_PTE_VALID; |
1286 | } else { | 1286 | } else { |
1287 | /* Set the huge page flag to stop scanning at this PDE */ | ||
1287 | flags |= AMDGPU_PDE_PTE; | 1288 | flags |= AMDGPU_PDE_PTE; |
1288 | } | 1289 | } |
1289 | 1290 | ||
1290 | if (entry->addr == dst && | 1291 | if (entry->addr == (dst | flags)) |
1291 | entry->huge_page == !!(flags & AMDGPU_PDE_PTE)) | ||
1292 | return; | 1292 | return; |
1293 | 1293 | ||
1294 | entry->addr = dst; | 1294 | entry->addr = (dst | flags); |
1295 | entry->huge_page = !!(flags & AMDGPU_PDE_PTE); | ||
1296 | 1295 | ||
1297 | if (use_cpu_update) { | 1296 | if (use_cpu_update) { |
1298 | pd_addr = (unsigned long)amdgpu_bo_kptr(parent->bo); | 1297 | pd_addr = (unsigned long)amdgpu_bo_kptr(parent->bo); |
@@ -1351,7 +1350,8 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params, | |||
1351 | 1350 | ||
1352 | amdgpu_vm_handle_huge_pages(params, entry, parent, | 1351 | amdgpu_vm_handle_huge_pages(params, entry, parent, |
1353 | nptes, dst, flags); | 1352 | nptes, dst, flags); |
1354 | if (entry->huge_page) | 1353 | /* We don't need to update PTEs for huge pages */ |
1354 | if (entry->addr & AMDGPU_PDE_PTE) | ||
1355 | continue; | 1355 | continue; |
1356 | 1356 | ||
1357 | pt = entry->bo; | 1357 | pt = entry->bo; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h index 9c309c5a86f1..f12c12fec3c0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | |||
@@ -103,7 +103,6 @@ struct amdgpu_bo_list_entry; | |||
103 | struct amdgpu_vm_pt { | 103 | struct amdgpu_vm_pt { |
104 | struct amdgpu_bo *bo; | 104 | struct amdgpu_bo *bo; |
105 | uint64_t addr; | 105 | uint64_t addr; |
106 | bool huge_page; | ||
107 | 106 | ||
108 | /* array of page tables, one for each directory entry */ | 107 | /* array of page tables, one for each directory entry */ |
109 | struct amdgpu_vm_pt *entries; | 108 | struct amdgpu_vm_pt *entries; |