diff options
author | Dave Airlie <airlied@redhat.com> | 2018-01-24 20:40:54 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-01-24 20:40:54 -0500 |
commit | 22bc72c8075fa350482cdbbd66597d626aa506c8 (patch) | |
tree | 4223a1282a53a07cd87ff0abbe1da5f8f172788d /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | 92eb5f0c00b7c11d85ae823a814b2a34dda8a3c4 (diff) | |
parent | 87440329b06720e09c27ad1991204f4f0bd76f83 (diff) |
Merge branch 'drm-next-4.16' of git://people.freedesktop.org/~agd5f/linux into drm-next
A few more fixes for 4.16, nothing major.
A few more fixes for 4.16. This is on top of the pull request from
last week. Most notable change here is a fix to the link order for
the now separate from amdgpu GPU scheduler to fix crashes when the
modules are build into the kernel rather than as modules.
* 'drm-next-4.16' of git://people.freedesktop.org/~agd5f/linux:
drm: fix gpu scheduler link order
drm/amd/display: Demote error print to debug print when ATOM impl missing
drm/amdgpu: Avoid leaking PM domain on driver unbind (v2)
drm/amd/amdgpu: Add Polaris version check
drm/amdgpu: Reenable manual GPU reset from sysfs
drm/amdgpu: disable MMHUB power gating on raven
drm/ttm: Don't unreserve swapped BOs that were previously reserved
drm/ttm: Don't add swapped BOs to swap-LRU list
drm/amdgpu: only check for ECC on Vega10
drm/amd/powerplay: Fix smu_table_entry.handle type
drm/ttm: add VADDR_FLAG_UPDATED_COUNT to correctly update dma_page global count
drm/radeon: fill in rb backend map on evergreen/ni.
drm/amdgpu/gfx9: fix ngg enablement to clear gds reserved memory (v2)
drm/ttm: only free pages rather than update global memory count together
drm/amdgpu: fix CPU based VM updates
drm/amdgpu: fix typo in amdgpu_vce_validate_bo
drm/amdgpu: fix amdgpu_vm_pasid_fault_credit
drm/ttm: check the return value of register_shrinker
drm/radeon: fix sparse warning: Should it be static?
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, 16 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index cd1752b6afa9..6fc16eecf2dc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -970,12 +970,16 @@ static void amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p, | |||
970 | amdgpu_gart_get_vm_pde(p->adev, AMDGPU_VM_PDB0, | 970 | amdgpu_gart_get_vm_pde(p->adev, AMDGPU_VM_PDB0, |
971 | &dst, &flags); | 971 | &dst, &flags); |
972 | 972 | ||
973 | if (parent->base.bo->shadow) { | 973 | if (p->func == amdgpu_vm_cpu_set_ptes) { |
974 | pd_addr = amdgpu_bo_gpu_offset(parent->base.bo->shadow); | 974 | pd_addr = (unsigned long)amdgpu_bo_kptr(parent->base.bo); |
975 | pde = pd_addr + (entry - parent->entries) * 8; | 975 | } else { |
976 | p->func(p, pde, dst, 1, 0, flags); | 976 | if (parent->base.bo->shadow) { |
977 | pd_addr = amdgpu_bo_gpu_offset(parent->base.bo->shadow); | ||
978 | pde = pd_addr + (entry - parent->entries) * 8; | ||
979 | p->func(p, pde, dst, 1, 0, flags); | ||
980 | } | ||
981 | pd_addr = amdgpu_bo_gpu_offset(parent->base.bo); | ||
977 | } | 982 | } |
978 | pd_addr = amdgpu_bo_gpu_offset(parent->base.bo); | ||
979 | pde = pd_addr + (entry - parent->entries) * 8; | 983 | pde = pd_addr + (entry - parent->entries) * 8; |
980 | p->func(p, pde, dst, 1, 0, flags); | 984 | p->func(p, pde, dst, 1, 0, flags); |
981 | } | 985 | } |
@@ -2478,17 +2482,21 @@ bool amdgpu_vm_pasid_fault_credit(struct amdgpu_device *adev, | |||
2478 | 2482 | ||
2479 | spin_lock(&adev->vm_manager.pasid_lock); | 2483 | spin_lock(&adev->vm_manager.pasid_lock); |
2480 | vm = idr_find(&adev->vm_manager.pasid_idr, pasid); | 2484 | vm = idr_find(&adev->vm_manager.pasid_idr, pasid); |
2481 | spin_unlock(&adev->vm_manager.pasid_lock); | 2485 | if (!vm) { |
2482 | if (!vm) | ||
2483 | /* VM not found, can't track fault credit */ | 2486 | /* VM not found, can't track fault credit */ |
2487 | spin_unlock(&adev->vm_manager.pasid_lock); | ||
2484 | return true; | 2488 | return true; |
2489 | } | ||
2485 | 2490 | ||
2486 | /* No lock needed. only accessed by IRQ handler */ | 2491 | /* No lock needed. only accessed by IRQ handler */ |
2487 | if (!vm->fault_credit) | 2492 | if (!vm->fault_credit) { |
2488 | /* Too many faults in this VM */ | 2493 | /* Too many faults in this VM */ |
2494 | spin_unlock(&adev->vm_manager.pasid_lock); | ||
2489 | return false; | 2495 | return false; |
2496 | } | ||
2490 | 2497 | ||
2491 | vm->fault_credit--; | 2498 | vm->fault_credit--; |
2499 | spin_unlock(&adev->vm_manager.pasid_lock); | ||
2492 | return true; | 2500 | return true; |
2493 | } | 2501 | } |
2494 | 2502 | ||