drm/amdgpu: fix amdgpu_vm_bo_insert_map to let bo gets update
Subsystems (2)
PATCH 1/2 drm/amdgpu: fix amdgpu_vm_bo_insert_map to let bo gets update
In function amdgpu_vm_bo_insert_map, amdgpu_vm_bo_needs_update is skipped due to amdgpu_vm_is_bo_always_valid but it should not skip for bo's which are allocate have it's own dma_resv object or NULL.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -1798,7 +1798,7 @@ static void amdgpu_vm_bo_insert_map(struct amdgpu_device *adev,if (mapping->flags &AMDGPU_VM_PAGE_PRT )amdgpu_vm_prt_get (adev); -if (amdgpu_vm_is_bo_always_valid (vm, bo) && !bo_va->base.moved) +if (!bo_va->base.moved)amdgpu_vm_bo_needs_update (&bo_va->base);trace_amdgpu_vm_bo_map (bo_va, mapping);
Signature · 1 line
2.34.1
PATCH 2/2 drm/amdgpu: identify the root PD by pointer in amdgpu_vm_bo_needs_update
bo->tbo.type == ttm_bo_type_kernel && !bo->parent also matches other kernel BOs with no parent, not just vm->root.bo, routing them to idle instead of needs_update. Compare against vm->root.bo directly.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -230,7 +230,7 @@ static void amdgpu_vm_bo_needs_update(struct amdgpu_vm_bo_base *vm_bo)* idle state. */ lists =amdgpu_vm_bo_lock_lists (vm_bo); -if (bo && bo->tbo.type == ttm_bo_type_kernel && !bo->parent) { +if (bo == vm_bo->vm->root.bo) { vm_bo->moved = false;list_move (&vm_bo->vm_status, &lists->idle); }else {
Signature · 1 line
2.34.1
Quoted 5 lines · Sunil Khatri
In function
amdgpu_vm_bo_insert_map,amdgpu_vm_bo_needs_updateis skipped due toamdgpu_vm_is_bo_always_validbut it should not skip for bo's which are allocate have it's owndma_resvobject or NULL.Signed-off-by Sunil Khatri <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1@@ -1798,7 +1798,7 @@ static void amdgpu_vm_bo_insert_map(struct amdgpu_device *adev,if (mapping->flags &AMDGPU_VM_PAGE_PRT )amdgpu_vm_prt_get (adev); -if (amdgpu_vm_is_bo_always_valid (vm, bo) && !bo_va->base.moved) +if (!bo_va->base.moved)amdgpu_vm_bo_needs_update (&bo_va->base);trace_amdgpu_vm_bo_map (bo_va, mapping);