summaryrefslogtreecommitdiff
path: root/include/linux/dma-resv.h
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2021-09-24 11:55:45 +0300
committerChristian König <christian.koenig@amd.com>2022-03-24 14:02:26 +0300
commit548e7432dc2da475a18077b612e8d55b8ff51891 (patch)
tree7901fc8bff98ceb6edf8381b7ba39533b58d9b37 /include/linux/dma-resv.h
parentf30bceab16d1d6a97cbe262623e25ed2873896f0 (diff)
downloadlinux-548e7432dc2da475a18077b612e8d55b8ff51891.tar.xz
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
Diffstat (limited to 'include/linux/dma-resv.h')
-rw-r--r--include/linux/dma-resv.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/dma-resv.h b/include/linux/dma-resv.h
index afdfdfac729f..3f53177bdb46 100644
--- a/include/linux/dma-resv.h
+++ b/include/linux/dma-resv.h
@@ -468,6 +468,8 @@ void dma_resv_init(struct dma_resv *obj);
void dma_resv_fini(struct dma_resv *obj);
int dma_resv_reserve_shared(struct dma_resv *obj, unsigned int num_fences);
void dma_resv_add_shared_fence(struct dma_resv *obj, struct dma_fence *fence);
+void dma_resv_replace_fences(struct dma_resv *obj, uint64_t context,
+ struct dma_fence *fence);
void dma_resv_add_excl_fence(struct dma_resv *obj, struct dma_fence *fence);
int dma_resv_get_fences(struct dma_resv *obj, bool write,
unsigned int *num_fences, struct dma_fence ***fences);