drm/amdgpu: fix lost sync_to if scheduler is enabled.
authorChunming Zhou <David1.Zhou@amd.com>
Wed, 13 Jan 2016 04:55:18 +0000 (12:55 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Jan 2016 16:39:15 +0000 (11:39 -0500)
when scheduler is enabled, the semaphore isn't used at all.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c

index dd005c3..181ce39 100644 (file)
@@ -293,7 +293,8 @@ int amdgpu_sync_rings(struct amdgpu_sync *sync,
                fence = to_amdgpu_fence(sync->sync_to[i]);
 
                /* check if we really need to sync */
-               if (!amdgpu_fence_need_sync(fence, ring))
+               if (!amdgpu_enable_scheduler &&
+                   !amdgpu_fence_need_sync(fence, ring))
                        continue;
 
                /* prevent GPU deadlocks */
@@ -303,7 +304,7 @@ int amdgpu_sync_rings(struct amdgpu_sync *sync,
                }
 
                if (amdgpu_enable_scheduler || !amdgpu_enable_semaphores) {
-                       r = fence_wait(&fence->base, true);
+                       r = fence_wait(sync->sync_to[i], true);
                        if (r)
                                return r;
                        continue;