diff options
| author | Christian König <[email protected]> | 2019-01-30 13:12:51 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2019-02-06 02:16:22 +0000 |
| commit | 90d647222a8f004bf1430ecea3099ebcc54bfc21 (patch) | |
| tree | f101210c63306297abff087ff1b563ebe8548f14 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
| parent | drm/amd/display: Use context parameters to enable FBC (diff) | |
| download | kernel-90d647222a8f004bf1430ecea3099ebcc54bfc21.tar.gz kernel-90d647222a8f004bf1430ecea3099ebcc54bfc21.zip | |
drm/amdgpu: fix waiting for BO moves with CPU based PD/PT updates
Otherwise we open up the possibility to use uninitialized memory.
Signed-off-by: Christian König <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index a404ac17e5ae..93b936f7de4b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1781,13 +1781,18 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, if (pages_addr) params.src = ~0; - /* Wait for PT BOs to be free. PTs share the same resv. object + /* Wait for PT BOs to be idle. PTs share the same resv. object * as the root PD BO */ r = amdgpu_vm_wait_pd(adev, vm, owner); if (unlikely(r)) return r; + /* Wait for any BO move to be completed */ + r = dma_fence_wait(exclusive, true); + if (unlikely(r)) + return r; + params.func = amdgpu_vm_cpu_set_ptes; params.pages_addr = pages_addr; return amdgpu_vm_update_ptes(¶ms, start, last + 1, |
