summaryrefslogtreecommitdiff
path: root/drivers/dma-buf/dma-resv.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2021-09-24 15:19:22 +0300
committerChristian König <christian.koenig@amd.com>2022-03-24 14:10:01 +0300
commit8938d48451f5d7cb565dfa68aa0bd0e81985da09 (patch)
treee809cae77b7e6949b35945a70a0d2feb4a226a26 /drivers/dma-buf/dma-resv.c
parent548e7432dc2da475a18077b612e8d55b8ff51891 (diff)
downloadlinux-8938d48451f5d7cb565dfa68aa0bd0e81985da09.tar.xz
dma-buf: finally make the dma_resv_list private v2
Drivers should never touch this directly. v2: drop kerneldoc for now internal handling Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-2-christian.koenig@amd.com
Diffstat (limited to 'drivers/dma-buf/dma-resv.c')
-rw-r--r--drivers/dma-buf/dma-resv.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c
index 509060861cf3..5001e9b4420a 100644
--- a/drivers/dma-buf/dma-resv.c
+++ b/drivers/dma-buf/dma-resv.c
@@ -56,6 +56,12 @@
DEFINE_WD_CLASS(reservation_ww_class);
EXPORT_SYMBOL(reservation_ww_class);
+struct dma_resv_list {
+ struct rcu_head rcu;
+ u32 shared_count, shared_max;
+ struct dma_fence __rcu *shared[];
+};
+
/**
* dma_resv_list_alloc - allocate fence list
* @shared_max: number of fences we need space for
@@ -133,6 +139,11 @@ void dma_resv_fini(struct dma_resv *obj)
}
EXPORT_SYMBOL(dma_resv_fini);
+static inline struct dma_resv_list *dma_resv_shared_list(struct dma_resv *obj)
+{
+ return rcu_dereference_check(obj->fence, dma_resv_held(obj));
+}
+
/**
* dma_resv_reserve_shared - Reserve space to add shared fences to
* a dma_resv.