diff options
author | Christian König <christian.koenig@amd.com> | 2016-05-23 09:30:08 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-07-07 14:51:22 -0400 |
commit | 36fd7c5c3ca6e03a265e8458905f453b552fe9df (patch) | |
tree | 286cdb9cd0914ede8b685708b179f401b58b22f9 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 354202389614bc7c29b6fbb98677326fcc248055 (diff) |
drm/amdgpu: prefer VMIDs idle on the current ring
Prefer to use a VMIDs which are idle on the ring we want to submit to. This
also removes bubbling idle VMIDs up on the LRU, which is actually not
beneficial.
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Chunming Zhou <david1.zhou@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.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 711d92bb7ae2..cf989cf54072 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -236,21 +236,15 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring, | |||
236 | 236 | ||
237 | } while (i != ring->idx); | 237 | } while (i != ring->idx); |
238 | 238 | ||
239 | id = list_first_entry(&adev->vm_manager.ids_lru, | 239 | /* Check if we have an idle VMID */ |
240 | struct amdgpu_vm_id, | 240 | list_for_each_entry(id, &adev->vm_manager.ids_lru, list) { |
241 | list); | 241 | if (amdgpu_sync_is_idle(&id->active, ring)) |
242 | 242 | break; | |
243 | if (!amdgpu_sync_is_idle(&id->active, NULL)) { | 243 | |
244 | struct list_head *head = &adev->vm_manager.ids_lru; | 244 | } |
245 | struct amdgpu_vm_id *tmp; | 245 | |
246 | 246 | /* If we can't find a idle VMID to use, just wait for the oldest */ | |
247 | list_for_each_entry_safe(id, tmp, &adev->vm_manager.ids_lru, | 247 | if (&id->list == &adev->vm_manager.ids_lru) { |
248 | list) { | ||
249 | if (amdgpu_sync_is_idle(&id->active, NULL)) { | ||
250 | list_move(&id->list, head); | ||
251 | head = &id->list; | ||
252 | } | ||
253 | } | ||
254 | id = list_first_entry(&adev->vm_manager.ids_lru, | 248 | id = list_first_entry(&adev->vm_manager.ids_lru, |
255 | struct amdgpu_vm_id, | 249 | struct amdgpu_vm_id, |
256 | list); | 250 | list); |