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

drm/ttm: use RCU in ttm_bo_flush_all_fences

This allows it to call the function without the lock held.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarxinhui pan <xinhui.pan@amd.com>
Link: https://patchwork.freedesktop.org/patch/352742/
parent 832c90df
...@@ -429,22 +429,24 @@ static int ttm_bo_individualize_resv(struct ttm_buffer_object *bo) ...@@ -429,22 +429,24 @@ 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_list *fobj; struct dma_resv_list *fobj;
struct dma_fence *fence; struct dma_fence *fence;
int i; int i;
fobj = dma_resv_get_list(&bo->base._resv); rcu_read_lock();
fence = dma_resv_get_excl(&bo->base._resv); fobj = rcu_dereference(resv->fence);
fence = rcu_dereference(resv->fence_excl);
if (fence && !fence->ops->signaled) if (fence && !fence->ops->signaled)
dma_fence_enable_sw_signaling(fence); dma_fence_enable_sw_signaling(fence);
for (i = 0; fobj && i < fobj->shared_count; ++i) { for (i = 0; fobj && i < fobj->shared_count; ++i) {
fence = rcu_dereference_protected(fobj->shared[i], fence = rcu_dereference(fobj->shared[i]);
dma_resv_held(bo->base.resv));
if (!fence->ops->signaled) if (!fence->ops->signaled)
dma_fence_enable_sw_signaling(fence); dma_fence_enable_sw_signaling(fence);
} }
rcu_read_unlock();
} }
static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo)
......
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