diff options
| author | Christian König <[email protected]> | 2020-01-22 15:19:02 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2020-02-05 04:30:39 +0000 |
| commit | 4939d973b6b18243e296369b2dfdf023ff2880ba (patch) | |
| tree | 3bef32991776a381224242bd3cb02b16fc95022c /drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | |
| parent | drm/amdgpu: allow higher level PD invalidations (diff) | |
| download | kernel-4939d973b6b18243e296369b2dfdf023ff2880ba.tar.gz kernel-4939d973b6b18243e296369b2dfdf023ff2880ba.zip | |
drm/amdgpu: simplify and fix amdgpu_sync_resv
No matter what we always need to sync to moves.
Signed-off-by: Christian König <[email protected]>
Tested-by: Tom St Denis <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c index c124f64e7aae..9f42032676da 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c @@ -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); |
