aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-01-31 17:39:35 -0500
committerDave Airlie <airlied@redhat.com>2017-01-31 17:39:35 -0500
commit29a73d906bd386839015602c4bd35ef2e3531abc (patch)
treef2d1e92e90e4286d6882f052c9b24f244610f52f /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
parent012bbe28c0e3a479ec7ba6f311710cf8409647d4 (diff)
parent268c3001842cb179b54a2825dad9b70151bf4de6 (diff)
Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next
This is the main feature pull for radeon and amdgpu for 4.11. Highlights: - Power and clockgating improvements - Preliminary SR-IOV support - ttm buffer priority support - ttm eviction fixes - Removal of the ttm lru callbacks - Remove SI DPM quirks due to MC firmware issues - Handle VFCT with multiple vbioses - Powerplay improvements - Lots of driver cleanups * 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux: (120 commits) drm/amdgpu: fix amdgpu_bo_va_mapping flags drm/amdgpu: access stolen VRAM directly on CZ (v2) drm/amdgpu: access stolen VRAM directly on KV/KB (v2) drm/amdgpu: fix kernel panic when dpm disabled on Kv. drm/amdgpu: fix dpm bug on Kv. drm/amd/powerplay: fix regresstion issue can't set manual dpm mode. drm/amdgpu: handle vfct with multiple vbios images drm/radeon: handle vfct with multiple vbios images drm/amdgpu: move misc si headers into amdgpu drm/amdgpu: remove unused header si_reg.h drm/radeon: drop pitcairn dpm quirks drm/amdgpu: drop pitcairn dpm quirks drm: radeon: radeon_ttm: Handle return NULL error from ioremap_nocache drm/amd/amdgpu/amdgpu_ttm: Handle return NULL error from ioremap_nocache drm/amdgpu: add new virtual display ID drm/amd/amdgpu: remove the uncessary parameter for ib scheduler drm/amdgpu: Bring bo creation in line with radeon driver (v2) drm/amd/powerplay: fix misspelling in header guard drm/ttm: revert "add optional LRU removal callback v2" drm/ttm: revert "implement LRU add callbacks v2" ...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index cd62f6ffde2a..9bd1b4eae32e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -471,12 +471,15 @@ out:
471 471
472static int amdgpu_gem_va_check(void *param, struct amdgpu_bo *bo) 472static int amdgpu_gem_va_check(void *param, struct amdgpu_bo *bo)
473{ 473{
474 unsigned domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type);
475
476 /* if anything is swapped out don't swap it in here, 474 /* if anything is swapped out don't swap it in here,
477 just abort and wait for the next CS */ 475 just abort and wait for the next CS */
476 if (!amdgpu_bo_gpu_accessible(bo))
477 return -ERESTARTSYS;
478
479 if (bo->shadow && !amdgpu_bo_gpu_accessible(bo->shadow))
480 return -ERESTARTSYS;
478 481
479 return domain == AMDGPU_GEM_DOMAIN_CPU ? -ERESTARTSYS : 0; 482 return 0;
480} 483}
481 484
482/** 485/**
@@ -496,7 +499,6 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
496 struct amdgpu_bo_list_entry vm_pd; 499 struct amdgpu_bo_list_entry vm_pd;
497 struct ww_acquire_ctx ticket; 500 struct ww_acquire_ctx ticket;
498 struct list_head list, duplicates; 501 struct list_head list, duplicates;
499 unsigned domain;
500 int r; 502 int r;
501 503
502 INIT_LIST_HEAD(&list); 504 INIT_LIST_HEAD(&list);
@@ -514,12 +516,18 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
514 goto error_print; 516 goto error_print;
515 517
516 list_for_each_entry(entry, &list, head) { 518 list_for_each_entry(entry, &list, head) {
517 domain = amdgpu_mem_type_to_domain(entry->bo->mem.mem_type); 519 struct amdgpu_bo *bo =
520 container_of(entry->bo, struct amdgpu_bo, tbo);
521
518 /* if anything is swapped out don't swap it in here, 522 /* if anything is swapped out don't swap it in here,
519 just abort and wait for the next CS */ 523 just abort and wait for the next CS */
520 if (domain == AMDGPU_GEM_DOMAIN_CPU) 524 if (!amdgpu_bo_gpu_accessible(bo))
525 goto error_unreserve;
526
527 if (bo->shadow && !amdgpu_bo_gpu_accessible(bo->shadow))
521 goto error_unreserve; 528 goto error_unreserve;
522 } 529 }
530
523 r = amdgpu_vm_validate_pt_bos(adev, bo_va->vm, amdgpu_gem_va_check, 531 r = amdgpu_vm_validate_pt_bos(adev, bo_va->vm, amdgpu_gem_va_check,
524 NULL); 532 NULL);
525 if (r) 533 if (r)