mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
drm/amdgpu: overwrite signaled fence in amdgpu_sync
This allows using amdgpu_sync even without peeking into the fences for a long time. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
16590745b5
commit
7f11c59e07
@@ -135,11 +135,16 @@ static bool amdgpu_sync_add_later(struct amdgpu_sync *sync, struct dma_fence *f)
|
||||
struct amdgpu_sync_entry *e;
|
||||
|
||||
hash_for_each_possible(sync->fences, e, node, f->context) {
|
||||
if (unlikely(e->fence->context != f->context))
|
||||
continue;
|
||||
if (dma_fence_is_signaled(e->fence)) {
|
||||
dma_fence_put(e->fence);
|
||||
e->fence = dma_fence_get(f);
|
||||
return true;
|
||||
}
|
||||
|
||||
amdgpu_sync_keep_later(&e->fence, f);
|
||||
return true;
|
||||
if (likely(e->fence->context == f->context)) {
|
||||
amdgpu_sync_keep_later(&e->fence, f);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user