aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorChunming Zhou <david1.zhou@amd.com>2019-01-10 02:49:54 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-01-25 16:15:34 -0500
commitb61857b5e365889d67a6296c413df396032d374d (patch)
tree24f4ead4c6a9fa9778856f767b8c33cc65f9b4ca /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parentae6d343541bb75958e9535d056adaf4ff6a66d6a (diff)
drm/amdgpu: set bulk_moveable to false when lru changed v2
if lru is changed, we cannot do bulk moving. v2: root bo isn't in bulk moving, skip its change. Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index ccffcadfd73b..ffffe021cccf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -623,6 +623,28 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm,
623 list_add(&entry->tv.head, validated); 623 list_add(&entry->tv.head, validated);
624} 624}
625 625
626void amdgpu_vm_del_from_lru_notify(struct ttm_buffer_object *bo)
627{
628 struct amdgpu_bo *abo;
629 struct amdgpu_vm_bo_base *bo_base;
630
631 if (!amdgpu_bo_is_amdgpu_bo(bo))
632 return;
633
634 if (bo->mem.placement & TTM_PL_FLAG_NO_EVICT)
635 return;
636
637 abo = ttm_to_amdgpu_bo(bo);
638 if (!abo->parent)
639 return;
640 for (bo_base = abo->vm_bo; bo_base; bo_base = bo_base->next) {
641 struct amdgpu_vm *vm = bo_base->vm;
642
643 if (abo->tbo.resv == vm->root.base.bo->tbo.resv)
644 vm->bulk_moveable = false;
645 }
646
647}
626/** 648/**
627 * amdgpu_vm_move_to_lru_tail - move all BOs to the end of LRU 649 * amdgpu_vm_move_to_lru_tail - move all BOs to the end of LRU
628 * 650 *