aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-12-11 15:01:23 -0500
committerAlex Deucher <alexander.deucher@amd.com>2015-12-18 17:29:46 -0500
commitee1782c3f27fec5462363af48f27811b049155ab (patch)
tree9230f1a1cdd3c3eb183ba36300d9ede2fe9bfe81 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
parent56467ebfb254836dc30eb45d4ac8a46a400bfad6 (diff)
drm/amdgpu: keep the PTs validation list in the VM v2
This avoids allocating it on the fly. v2: fix grammar in comment Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index ea0fe94e4b54..8c5687e4a6d1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -447,7 +447,6 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
447 struct amdgpu_bo_va *bo_va, uint32_t operation) 447 struct amdgpu_bo_va *bo_va, uint32_t operation)
448{ 448{
449 struct ttm_validate_buffer tv, *entry; 449 struct ttm_validate_buffer tv, *entry;
450 struct amdgpu_bo_list_entry *vm_bos;
451 struct amdgpu_bo_list_entry vm_pd; 450 struct amdgpu_bo_list_entry vm_pd;
452 struct ww_acquire_ctx ticket; 451 struct ww_acquire_ctx ticket;
453 struct list_head list, duplicates; 452 struct list_head list, duplicates;
@@ -468,12 +467,7 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
468 if (r) 467 if (r)
469 goto error_print; 468 goto error_print;
470 469
471 vm_bos = amdgpu_vm_get_pt_bos(bo_va->vm, &duplicates); 470 amdgpu_vm_get_pt_bos(bo_va->vm, &duplicates);
472 if (!vm_bos) {
473 r = -ENOMEM;
474 goto error_unreserve;
475 }
476
477 list_for_each_entry(entry, &list, head) { 471 list_for_each_entry(entry, &list, head) {
478 domain = amdgpu_mem_type_to_domain(entry->bo->mem.mem_type); 472 domain = amdgpu_mem_type_to_domain(entry->bo->mem.mem_type);
479 /* if anything is swapped out don't swap it in here, 473 /* if anything is swapped out don't swap it in here,
@@ -494,7 +488,6 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
494 488
495error_unreserve: 489error_unreserve:
496 ttm_eu_backoff_reservation(&ticket, &list); 490 ttm_eu_backoff_reservation(&ticket, &list);
497 drm_free_large(vm_bos);
498 491
499error_print: 492error_print:
500 if (r && r != -ERESTARTSYS) 493 if (r && r != -ERESTARTSYS)