Commit 4939d973 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: simplify and fix amdgpu_sync_resv

No matter what we always need to sync to moves.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Tested-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent fe6796ac
......@@ -232,10 +232,19 @@ int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync,
f = rcu_dereference_protected(flist->shared[i],
dma_resv_held(resv));
fence_owner = amdgpu_sync_get_owner(f);
/* Always sync to moves, no matter what */
if (fence_owner == AMDGPU_FENCE_OWNER_UNDEFINED) {
r = amdgpu_sync_fence(sync, f, false);
if (r)
break;
}
/* We only want to trigger KFD eviction fences on
* evict or move jobs. Skip KFD fences otherwise.
*/
fence_owner = amdgpu_sync_get_owner(f);
if (fence_owner == AMDGPU_FENCE_OWNER_KFD &&
owner != AMDGPU_FENCE_OWNER_UNDEFINED)
continue;
......@@ -265,9 +274,7 @@ int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync,
break;
case AMDGPU_SYNC_EXPLICIT:
if (owner != AMDGPU_FENCE_OWNER_UNDEFINED)
continue;
break;
continue;
}
r = amdgpu_sync_fence(sync, f, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment