Commit dbcae3bf authored by Christian König's avatar Christian König

drm/ttm: use the new iterator in ttm_bo_flush_all_fences

This is probably a fix since we didn't even grabed a reference to the
fences.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-11-christian.koenig@amd.com
parent 0a42016d
...@@ -269,23 +269,15 @@ static int ttm_bo_individualize_resv(struct ttm_buffer_object *bo) ...@@ -269,23 +269,15 @@ static int ttm_bo_individualize_resv(struct ttm_buffer_object *bo)
static void ttm_bo_flush_all_fences(struct ttm_buffer_object *bo) static void ttm_bo_flush_all_fences(struct ttm_buffer_object *bo)
{ {
struct dma_resv *resv = &bo->base._resv; struct dma_resv *resv = &bo->base._resv;
struct dma_resv_list *fobj; struct dma_resv_iter cursor;
struct dma_fence *fence; struct dma_fence *fence;
int i;
rcu_read_lock();
fobj = dma_resv_shared_list(resv);
fence = dma_resv_excl_fence(resv);
if (fence && !fence->ops->signaled)
dma_fence_enable_sw_signaling(fence);
for (i = 0; fobj && i < fobj->shared_count; ++i) {
fence = rcu_dereference(fobj->shared[i]);
dma_resv_iter_begin(&cursor, resv, true);
dma_resv_for_each_fence_unlocked(&cursor, fence) {
if (!fence->ops->signaled) if (!fence->ops->signaled)
dma_fence_enable_sw_signaling(fence); dma_fence_enable_sw_signaling(fence);
} }
rcu_read_unlock(); dma_resv_iter_end(&cursor);
} }
/** /**
......
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