Skip to content

Commit

Permalink
drm/amdkcl: Fix missing execl fence copy in dma_resv_copy_fences()
Browse files Browse the repository at this point in the history
add back dma_resv_iter_is_exclusive() to test current fence is excl
fence

Signed-off-by: Leslie Shi <Yuliang.Shi@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
  • Loading branch information
Leslie Shi authored and Leslie Shi committed Aug 25, 2022
1 parent 1b0581f commit 80bbcfd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdkcl/kcl_dma-resv.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ int dma_resv_copy_fences(struct dma_resv *dst, struct dma_resv *src)
}

dma_fence_get(f);
if (dma_resv_iter_usage(&cursor) == DMA_RESV_USAGE_WRITE)
if (dma_resv_iter_is_exclusive(&cursor))
excl = f;
else
RCU_INIT_POINTER(list->shared[list->shared_count++], f);
Expand Down
11 changes: 11 additions & 0 deletions include/kcl/kcl_dma-resv.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,17 @@ static inline struct dma_resv_list *dma_resv_shared_list(struct dma_resv *obj)
return rcu_dereference_check(obj->fence, lockdep_is_held(&(obj)->lock.base));
}

/**
* dma_resv_iter_is_exclusive - test if the current fence is the exclusive one
* @cursor: the cursor of the current position
*
* Returns true if the currently returned fence is the exclusive one.
*/
static inline bool dma_resv_iter_is_exclusive(struct dma_resv_iter *cursor)
{
return cursor->index == 0;
}

#endif /* !defined(HAVE_DMA_RESV_FENCES) */

#if !defined(smp_store_mb)
Expand Down

0 comments on commit 80bbcfd

Please sign in to comment.