aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-09-04 04:47:56 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-09-23 17:23:35 -0400
commitbf60efd353f68e5dec1a177b5cbe4da07c819569 (patch)
tree03911fc3289220f4003b9778a62a4793e26f076f /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
parenta5b750583eb4af69da1e659c7684b6d370b2ae97 (diff)
drm/amdgpu: use only one reservation object for each VM v2
Reduces the locking and fencing overhead. v2: add comment why we need the duplicates list in the GEM op. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index b75c3b235832..2f39fea10bd1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -455,11 +455,12 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
455 struct ttm_validate_buffer tv, *entry; 455 struct ttm_validate_buffer tv, *entry;
456 struct amdgpu_bo_list_entry *vm_bos; 456 struct amdgpu_bo_list_entry *vm_bos;
457 struct ww_acquire_ctx ticket; 457 struct ww_acquire_ctx ticket;
458 struct list_head list; 458 struct list_head list, duplicates;
459 unsigned domain; 459 unsigned domain;
460 int r; 460 int r;
461 461
462 INIT_LIST_HEAD(&list); 462 INIT_LIST_HEAD(&list);
463 INIT_LIST_HEAD(&duplicates);
463 464
464 tv.bo = &bo_va->bo->tbo; 465 tv.bo = &bo_va->bo->tbo;
465 tv.shared = true; 466 tv.shared = true;
@@ -469,7 +470,8 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
469 if (!vm_bos) 470 if (!vm_bos)
470 return; 471 return;
471 472
472 r = ttm_eu_reserve_buffers(&ticket, &list, true, NULL); 473 /* Provide duplicates to avoid -EALREADY */
474 r = ttm_eu_reserve_buffers(&ticket, &list, true, &duplicates);
473 if (r) 475 if (r)
474 goto error_free; 476 goto error_free;
475 477