diff options
author | Dave Airlie <airlied@redhat.com> | 2019-02-22 00:56:35 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2019-02-22 00:56:42 -0500 |
commit | fbac3c48fa6b4cfa43eaae39d5a53269bff7ec5f (patch) | |
tree | dddd2843ec69dceda451de060d68ac21629d10ab /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | a5f2fafece141ef3509e686cea576366d55cabb6 (diff) | |
parent | 767e06a9924162ce8ca5890533932174b04471f3 (diff) |
Merge branch 'drm-next-5.1' of git://people.freedesktop.org/~agd5f/linux into drm-next
Fixes for 5.1:
amdgpu:
- Fix missing fw declaration after dropping old CI DPM code
- Fix debugfs access to registers beyond the MMIO bar size
- Fix context priority handling
- Add missing license on some new files
- Various cleanups and bug fixes
radeon:
- Fix missing break in CS parser for evergreen
- Various cleanups and bug fixes
sched:
- Fix entities with 0 run queues
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190221214134.3308-1-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 | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 7cd2336e29ff..942b5ebc6dc2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -698,8 +698,6 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm, | |||
698 | struct amdgpu_vm_bo_base *bo_base, *tmp; | 698 | struct amdgpu_vm_bo_base *bo_base, *tmp; |
699 | int r = 0; | 699 | int r = 0; |
700 | 700 | ||
701 | vm->bulk_moveable &= list_empty(&vm->evicted); | ||
702 | |||
703 | list_for_each_entry_safe(bo_base, tmp, &vm->evicted, vm_status) { | 701 | list_for_each_entry_safe(bo_base, tmp, &vm->evicted, vm_status) { |
704 | struct amdgpu_bo *bo = bo_base->bo; | 702 | struct amdgpu_bo *bo = bo_base->bo; |
705 | 703 | ||
@@ -828,7 +826,7 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev, | |||
828 | 826 | ||
829 | WARN_ON(job->ibs[0].length_dw > 64); | 827 | WARN_ON(job->ibs[0].length_dw > 64); |
830 | r = amdgpu_sync_resv(adev, &job->sync, bo->tbo.resv, | 828 | r = amdgpu_sync_resv(adev, &job->sync, bo->tbo.resv, |
831 | AMDGPU_FENCE_OWNER_UNDEFINED, false); | 829 | AMDGPU_FENCE_OWNER_KFD, false); |
832 | if (r) | 830 | if (r) |
833 | goto error_free; | 831 | goto error_free; |
834 | 832 | ||
@@ -1332,31 +1330,6 @@ static void amdgpu_vm_cpu_set_ptes(struct amdgpu_pte_update_params *params, | |||
1332 | } | 1330 | } |
1333 | } | 1331 | } |
1334 | 1332 | ||
1335 | |||
1336 | /** | ||
1337 | * amdgpu_vm_wait_pd - Wait for PT BOs to be free. | ||
1338 | * | ||
1339 | * @adev: amdgpu_device pointer | ||
1340 | * @vm: related vm | ||
1341 | * @owner: fence owner | ||
1342 | * | ||
1343 | * Returns: | ||
1344 | * 0 on success, errno otherwise. | ||
1345 | */ | ||
1346 | static int amdgpu_vm_wait_pd(struct amdgpu_device *adev, struct amdgpu_vm *vm, | ||
1347 | void *owner) | ||
1348 | { | ||
1349 | struct amdgpu_sync sync; | ||
1350 | int r; | ||
1351 | |||
1352 | amdgpu_sync_create(&sync); | ||
1353 | amdgpu_sync_resv(adev, &sync, vm->root.base.bo->tbo.resv, owner, false); | ||
1354 | r = amdgpu_sync_wait(&sync, true); | ||
1355 | amdgpu_sync_free(&sync); | ||
1356 | |||
1357 | return r; | ||
1358 | } | ||
1359 | |||
1360 | /** | 1333 | /** |
1361 | * amdgpu_vm_update_func - helper to call update function | 1334 | * amdgpu_vm_update_func - helper to call update function |
1362 | * | 1335 | * |
@@ -1451,7 +1424,8 @@ restart: | |||
1451 | params.adev = adev; | 1424 | params.adev = adev; |
1452 | 1425 | ||
1453 | if (vm->use_cpu_for_update) { | 1426 | if (vm->use_cpu_for_update) { |
1454 | r = amdgpu_vm_wait_pd(adev, vm, AMDGPU_FENCE_OWNER_VM); | 1427 | r = amdgpu_bo_sync_wait(vm->root.base.bo, |
1428 | AMDGPU_FENCE_OWNER_VM, true); | ||
1455 | if (unlikely(r)) | 1429 | if (unlikely(r)) |
1456 | return r; | 1430 | return r; |
1457 | 1431 | ||
@@ -1772,9 +1746,9 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, | |||
1772 | params.adev = adev; | 1746 | params.adev = adev; |
1773 | params.vm = vm; | 1747 | params.vm = vm; |
1774 | 1748 | ||
1775 | /* sync to everything on unmapping */ | 1749 | /* sync to everything except eviction fences on unmapping */ |
1776 | if (!(flags & AMDGPU_PTE_VALID)) | 1750 | if (!(flags & AMDGPU_PTE_VALID)) |
1777 | owner = AMDGPU_FENCE_OWNER_UNDEFINED; | 1751 | owner = AMDGPU_FENCE_OWNER_KFD; |
1778 | 1752 | ||
1779 | if (vm->use_cpu_for_update) { | 1753 | if (vm->use_cpu_for_update) { |
1780 | /* params.src is used as flag to indicate system Memory */ | 1754 | /* params.src is used as flag to indicate system Memory */ |
@@ -1784,7 +1758,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, | |||
1784 | /* Wait for PT BOs to be idle. PTs share the same resv. object | 1758 | /* Wait for PT BOs to be idle. PTs share the same resv. object |
1785 | * as the root PD BO | 1759 | * as the root PD BO |
1786 | */ | 1760 | */ |
1787 | r = amdgpu_vm_wait_pd(adev, vm, owner); | 1761 | r = amdgpu_bo_sync_wait(vm->root.base.bo, owner, true); |
1788 | if (unlikely(r)) | 1762 | if (unlikely(r)) |
1789 | return r; | 1763 | return r; |
1790 | 1764 | ||