]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: fix amdgpu_sync_resv v2
authorChristian König <christian.koenig@amd.com>
Fri, 24 Nov 2017 10:41:52 +0000 (11:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Mar 2018 08:09:56 +0000 (09:09 +0100)
[ Upstream commit d4b7648d6d1774f961f3f6a758d9b009f1f34f05 ]

Fixes a bug introduced by AMDGPU_GEM_CREATE_EXPLICIT_SYNC. We still need
to wait for pipelined moves in the shared fences list.

v2: fix typo

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c

index a4bf21f8f1c187e9c7f45bfc4c30171760647eea..bbbc40d630a08268ede7004795b5a57c5bd58220 100644 (file)
@@ -191,9 +191,6 @@ int amdgpu_sync_resv(struct amdgpu_device *adev,
        f = reservation_object_get_excl(resv);
        r = amdgpu_sync_fence(adev, sync, f);
 
-       if (explicit_sync)
-               return r;
-
        flist = reservation_object_get_list(resv);
        if (!flist || r)
                return r;
@@ -212,11 +209,11 @@ int amdgpu_sync_resv(struct amdgpu_device *adev,
                             (fence_owner == AMDGPU_FENCE_OWNER_VM)))
                                continue;
 
-                       /* Ignore fence from the same owner as
+                       /* Ignore fence from the same owner and explicit one as
                         * long as it isn't undefined.
                         */
                        if (owner != AMDGPU_FENCE_OWNER_UNDEFINED &&
-                           fence_owner == owner)
+                           (fence_owner == owner || explicit_sync))
                                continue;
                }