drm/ttm: revise ttm_bo_move_to_lru_tail to support bulk moves
When move a BO to the end of LRU, it need remember the BO positions. Make sure all moved bo in between "first" and "last". And they will be bulk moving together. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Huang Rui <ray.huang@amd.com> Tested-by: Mike Lothian <mike@fireburn.co.uk> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> Acked-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:

committed by
Alex Deucher

parent
8c7655a0fd
commit
9a2779528e
@@ -297,9 +297,9 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,
|
||||
|
||||
if (bo->parent) {
|
||||
spin_lock(&glob->lru_lock);
|
||||
ttm_bo_move_to_lru_tail(&bo->tbo);
|
||||
ttm_bo_move_to_lru_tail(&bo->tbo, NULL);
|
||||
if (bo->shadow)
|
||||
ttm_bo_move_to_lru_tail(&bo->shadow->tbo);
|
||||
ttm_bo_move_to_lru_tail(&bo->shadow->tbo, NULL);
|
||||
spin_unlock(&glob->lru_lock);
|
||||
}
|
||||
|
||||
@@ -319,9 +319,9 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,
|
||||
if (!bo->parent)
|
||||
continue;
|
||||
|
||||
ttm_bo_move_to_lru_tail(&bo->tbo);
|
||||
ttm_bo_move_to_lru_tail(&bo->tbo, NULL);
|
||||
if (bo->shadow)
|
||||
ttm_bo_move_to_lru_tail(&bo->shadow->tbo);
|
||||
ttm_bo_move_to_lru_tail(&bo->shadow->tbo, NULL);
|
||||
}
|
||||
spin_unlock(&glob->lru_lock);
|
||||
|
||||
|
Reference in New Issue
Block a user