From: Christian König Date: Sun, 4 Feb 2018 18:36:52 +0000 (+0100) Subject: drm/amdgpu: sync the VM PD/PT before clearing it X-Git-Tag: v4.19~1144^2~30^2~100 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29e8357b4cbbfcee6d375f2d183b674b678923d7;p=platform%2Fkernel%2Flinux-rpi.git drm/amdgpu: sync the VM PD/PT before clearing it Otherwise we might overwrite stuff which is still in use. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 18ce476..0572d60 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -329,6 +329,11 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev, amdgpu_ring_pad_ib(ring, &job->ibs[0]); WARN_ON(job->ibs[0].length_dw > 64); + r = amdgpu_sync_resv(adev, &job->sync, bo->tbo.resv, + AMDGPU_FENCE_OWNER_UNDEFINED, false); + if (r) + goto error_free; + r = amdgpu_job_submit(job, ring, &vm->entity, AMDGPU_FENCE_OWNER_UNDEFINED, &fence); if (r)