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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Mar 2016 23:07:18 +0000 (15:07 -0800)
commit 888c9e33e4c5a503285921046c621f7c73199d2f upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c

index dd005c336c974ad708827c25edc4a4534772bb2c..181ce39ef5e59f8e4d4fbf2feeb617af63deb611 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;