From: Chunming Zhou Date: Tue, 25 Aug 2015 07:12:26 +0000 (+0800) Subject: drm/amdgpu: fix no sync_wait in copy_buffer X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9066b0c318589f47b754a3def4fe8ec4688dc21a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/amdgpu: fix no sync_wait in copy_buffer when eviction is happening, if don't handle dependency, then the fence could be dead off. Signed-off-by: Chunming Zhou Reviewed-by: Jammy Zhou Reviewed-by: Christian K?nig --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index d7c02e1a309e..4cb81320b045 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -1014,13 +1014,19 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, /* for fence and sync */ num_dw += 64 + AMDGPU_NUM_SYNCS * 8; + r = amdgpu_sync_wait(&sync); + if (r) { + DRM_ERROR("sync wait failed (%d).\n", r); + amdgpu_sync_free(adev, &sync, NULL); + return r; + } + r = amdgpu_ring_lock(ring, num_dw); if (r) { DRM_ERROR("ring lock failed (%d).\n", r); amdgpu_sync_free(adev, &sync, NULL); return r; } - amdgpu_sync_rings(&sync, ring); for (i = 0; i < num_loops; i++) {