[10/13] drm/amdgpu: bulk move per vm bo

Submitted by Zhou, David(ChunMing) on May 9, 2018, 6:45 a.m.

Details

Message ID 20180509064543.15937-11-david1.zhou@amd.com
State New
Headers show
Series "*** per vm lru ***" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Zhou, David(ChunMing) May 9, 2018, 6:45 a.m.
Change-Id: I0d5fa7e5e88568f79e836ff47f9c9132cb7d349e
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 5bef4ffa1c87..537f04d25535 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -307,7 +307,12 @@  void amdgpu_vm_del_from_lru(struct ttm_buffer_object *bo)
 
 void amdgpu_vm_move_to_lru_tail(struct ttm_buffer_object *bo)
 {
+	struct amdgpu_bo *abo = ttm_to_amdgpu_bo(bo);
+	struct amdgpu_vm_lru *vm_lru = abo->vm_lru;
+	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
 
+	if (bo->resv == vm_lru->resv)
+               list_move_tail(&vm_lru->vm_lru_list, &adev->vm_lru_list);
 }