summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorChunming Zhou <David1.Zhou@amd.com>2016-03-17 11:41:37 +0800
committerAlex Deucher <alexander.deucher@amd.com>2016-05-02 15:04:11 -0400
commit8e9fbeb522fa3043dc65ef0e383af28843950799 (patch)
tree512228be6811bee61b5a7bcb9a728e555bbee7a4 /drivers/gpu
parenteca2240fb044e30276ecbb43eab47a46f96c05c4 (diff)
drm/amdgpu: improve vmid assigment V2
V2: the signaled items on the LRU maintain their order Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index b6c011b83641..6630732ea1bd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -216,6 +216,20 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
struct amdgpu_vm_manager_id,
list);
+ if (id->mgr_id->active && !fence_is_signaled(id->mgr_id->active)) {
+ struct amdgpu_vm_manager_id *mgr_id, *tmp;
+ struct list_head *head = &adev->vm_manager.ids_lru;
+ list_for_each_entry_safe(mgr_id, tmp, &adev->vm_manager.ids_lru, list) {
+ if (mgr_id->active && fence_is_signaled(mgr_id->active)) {
+ list_move(&mgr_id->list, head);
+ head = &mgr_id->list;
+ }
+ }
+ id->mgr_id = list_first_entry(&adev->vm_manager.ids_lru,
+ struct amdgpu_vm_manager_id,
+ list);
+ }
+
r = amdgpu_sync_fence(ring->adev, sync, id->mgr_id->active);
if (!r) {
fence_put(id->mgr_id->active);