Commit ec5207c9 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: remove superflous amdgpu_bo_kmap in the VM

We now properly kmap all BOs after validation.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0f4b3c68
...@@ -1265,7 +1265,7 @@ void amdgpu_vm_get_entry(struct amdgpu_pte_update_params *p, uint64_t addr, ...@@ -1265,7 +1265,7 @@ void amdgpu_vm_get_entry(struct amdgpu_pte_update_params *p, uint64_t addr,
* *
* Check if we can update the PD with a huge page. * Check if we can update the PD with a huge page.
*/ */
static int amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p, static void amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p,
struct amdgpu_vm_pt *entry, struct amdgpu_vm_pt *entry,
struct amdgpu_vm_pt *parent, struct amdgpu_vm_pt *parent,
unsigned nptes, uint64_t dst, unsigned nptes, uint64_t dst,
...@@ -1273,7 +1273,6 @@ static int amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p, ...@@ -1273,7 +1273,6 @@ static int amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p,
{ {
bool use_cpu_update = (p->func == amdgpu_vm_cpu_set_ptes); bool use_cpu_update = (p->func == amdgpu_vm_cpu_set_ptes);
uint64_t pd_addr, pde; uint64_t pd_addr, pde;
int r;
/* In the case of a mixed PT the PDE must point to it*/ /* In the case of a mixed PT the PDE must point to it*/
if (p->adev->asic_type < CHIP_VEGA10 || if (p->adev->asic_type < CHIP_VEGA10 ||
...@@ -1290,16 +1289,13 @@ static int amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p, ...@@ -1290,16 +1289,13 @@ static int amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p,
if (entry->addr == dst && if (entry->addr == dst &&
entry->huge_page == !!(flags & AMDGPU_PDE_PTE)) entry->huge_page == !!(flags & AMDGPU_PDE_PTE))
return 0; return;
entry->addr = dst; entry->addr = dst;
entry->huge_page = !!(flags & AMDGPU_PDE_PTE); entry->huge_page = !!(flags & AMDGPU_PDE_PTE);
if (use_cpu_update) { if (use_cpu_update) {
r = amdgpu_bo_kmap(parent->bo, (void *)&pd_addr); pd_addr = (unsigned long)amdgpu_bo_kptr(parent->bo);
if (r)
return r;
pde = pd_addr + (entry - parent->entries) * 8; pde = pd_addr + (entry - parent->entries) * 8;
amdgpu_vm_cpu_set_ptes(p, pde, dst, 1, 0, flags); amdgpu_vm_cpu_set_ptes(p, pde, dst, 1, 0, flags);
} else { } else {
...@@ -1312,8 +1308,6 @@ static int amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p, ...@@ -1312,8 +1308,6 @@ static int amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p,
pde = pd_addr + (entry - parent->entries) * 8; pde = pd_addr + (entry - parent->entries) * 8;
amdgpu_vm_do_set_ptes(p, pde, dst, 1, 0, flags); amdgpu_vm_do_set_ptes(p, pde, dst, 1, 0, flags);
} }
return 0;
} }
/** /**
...@@ -1340,7 +1334,6 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params, ...@@ -1340,7 +1334,6 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params,
struct amdgpu_bo *pt; struct amdgpu_bo *pt;
unsigned nptes; unsigned nptes;
bool use_cpu_update = (params->func == amdgpu_vm_cpu_set_ptes); bool use_cpu_update = (params->func == amdgpu_vm_cpu_set_ptes);
int r;
/* walk over the address space and update the page tables */ /* walk over the address space and update the page tables */
for (addr = start; addr < end; addr += nptes, for (addr = start; addr < end; addr += nptes,
...@@ -1356,11 +1349,8 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params, ...@@ -1356,11 +1349,8 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params,
else else
nptes = AMDGPU_VM_PTE_COUNT(adev) - (addr & mask); nptes = AMDGPU_VM_PTE_COUNT(adev) - (addr & mask);
r = amdgpu_vm_handle_huge_pages(params, entry, parent, amdgpu_vm_handle_huge_pages(params, entry, parent,
nptes, dst, flags); nptes, dst, flags);
if (r)
return r;
if (entry->huge_page) if (entry->huge_page)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment