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

drm/amdgpu: rename VM invalidated to moved

That better describes what happens here with the BO.
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 ec681545
...@@ -825,7 +825,7 @@ static int amdgpu_bo_vm_update_pte(struct amdgpu_cs_parser *p) ...@@ -825,7 +825,7 @@ static int amdgpu_bo_vm_update_pte(struct amdgpu_cs_parser *p)
} }
r = amdgpu_vm_clear_invalids(adev, vm, &p->job->sync); r = amdgpu_vm_clear_moved(adev, vm, &p->job->sync);
if (amdgpu_vm_debug && p->bo_list) { if (amdgpu_vm_debug && p->bo_list) {
/* Invalidate all BOs to test for userspace bugs */ /* Invalidate all BOs to test for userspace bugs */
......
...@@ -1983,25 +1983,25 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev, ...@@ -1983,25 +1983,25 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
} }
/** /**
* amdgpu_vm_clear_invalids - clear invalidated BOs in the PT * amdgpu_vm_clear_moved - clear moved BOs in the PT
* *
* @adev: amdgpu_device pointer * @adev: amdgpu_device pointer
* @vm: requested vm * @vm: requested vm
* *
* Make sure all invalidated BOs are cleared in the PT. * Make sure all moved BOs are cleared in the PT.
* Returns 0 for success. * Returns 0 for success.
* *
* PTs have to be reserved and mutex must be locked! * PTs have to be reserved and mutex must be locked!
*/ */
int amdgpu_vm_clear_invalids(struct amdgpu_device *adev, int amdgpu_vm_clear_moved(struct amdgpu_device *adev, struct amdgpu_vm *vm,
struct amdgpu_vm *vm, struct amdgpu_sync *sync) struct amdgpu_sync *sync)
{ {
struct amdgpu_bo_va *bo_va = NULL; struct amdgpu_bo_va *bo_va = NULL;
int r = 0; int r = 0;
spin_lock(&vm->status_lock); spin_lock(&vm->status_lock);
while (!list_empty(&vm->invalidated)) { while (!list_empty(&vm->moved)) {
bo_va = list_first_entry(&vm->invalidated, bo_va = list_first_entry(&vm->moved,
struct amdgpu_bo_va, base.vm_status); struct amdgpu_bo_va, base.vm_status);
spin_unlock(&vm->status_lock); spin_unlock(&vm->status_lock);
...@@ -2396,7 +2396,7 @@ void amdgpu_vm_bo_invalidate(struct amdgpu_device *adev, ...@@ -2396,7 +2396,7 @@ void amdgpu_vm_bo_invalidate(struct amdgpu_device *adev,
spin_lock(&bo_base->vm->status_lock); spin_lock(&bo_base->vm->status_lock);
if (list_empty(&bo_base->vm_status)) if (list_empty(&bo_base->vm_status))
list_add(&bo_base->vm_status, list_add(&bo_base->vm_status,
&bo_base->vm->invalidated); &bo_base->vm->moved);
spin_unlock(&bo_base->vm->status_lock); spin_unlock(&bo_base->vm->status_lock);
} }
} }
...@@ -2465,7 +2465,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, ...@@ -2465,7 +2465,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
for (i = 0; i < AMDGPU_MAX_VMHUBS; i++) for (i = 0; i < AMDGPU_MAX_VMHUBS; i++)
vm->reserved_vmid[i] = NULL; vm->reserved_vmid[i] = NULL;
spin_lock_init(&vm->status_lock); spin_lock_init(&vm->status_lock);
INIT_LIST_HEAD(&vm->invalidated); INIT_LIST_HEAD(&vm->moved);
INIT_LIST_HEAD(&vm->cleared); INIT_LIST_HEAD(&vm->cleared);
INIT_LIST_HEAD(&vm->freed); INIT_LIST_HEAD(&vm->freed);
......
...@@ -129,7 +129,7 @@ struct amdgpu_vm { ...@@ -129,7 +129,7 @@ struct amdgpu_vm {
spinlock_t status_lock; spinlock_t status_lock;
/* BOs moved, but not yet updated in the PT */ /* BOs moved, but not yet updated in the PT */
struct list_head invalidated; struct list_head moved;
/* BOs cleared in the PT because of a move */ /* BOs cleared in the PT because of a move */
struct list_head cleared; struct list_head cleared;
...@@ -247,8 +247,8 @@ int amdgpu_vm_update_directories(struct amdgpu_device *adev, ...@@ -247,8 +247,8 @@ int amdgpu_vm_update_directories(struct amdgpu_device *adev,
int amdgpu_vm_clear_freed(struct amdgpu_device *adev, int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
struct amdgpu_vm *vm, struct amdgpu_vm *vm,
struct dma_fence **fence); struct dma_fence **fence);
int amdgpu_vm_clear_invalids(struct amdgpu_device *adev, struct amdgpu_vm *vm, int amdgpu_vm_clear_moved(struct amdgpu_device *adev, struct amdgpu_vm *vm,
struct amdgpu_sync *sync); struct amdgpu_sync *sync);
int amdgpu_vm_bo_update(struct amdgpu_device *adev, int amdgpu_vm_bo_update(struct amdgpu_device *adev,
struct amdgpu_bo_va *bo_va, struct amdgpu_bo_va *bo_va,
bool clear); bool clear);
......
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