dma-buf: add dma_resv_replace_fences v2
authorChristian König <christian.koenig@amd.com>
Fri, 24 Sep 2021 08:55:45 +0000 (10:55 +0200)
committerChristian König <christian.koenig@amd.com>
Thu, 24 Mar 2022 11:02:26 +0000 (12:02 +0100)
commit548e7432dc2da475a18077b612e8d55b8ff51891
tree7901fc8bff98ceb6edf8381b7ba39533b58d9b37
parentf30bceab16d1d6a97cbe262623e25ed2873896f0
dma-buf: add dma_resv_replace_fences v2

This function allows to replace fences from the shared fence list when
we can gurantee that the operation represented by the original fence has
finished or no accesses to the resources protected by the dma_resv
object any more when the new fence finishes.

Then use this function in the amdkfd code when BOs are unmapped from the
process.

v2: add an example when this is usefull.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-1-christian.koenig@amd.com
drivers/dma-buf/dma-resv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
include/linux/dma-resv.h