summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPhilipp Stanner <phasta@kernel.org>2025-12-01 13:50:06 +0300
committerPhilipp Stanner <phasta@kernel.org>2025-12-04 17:03:40 +0300
commitc891b99d25ddbb6b8167f9bdb904d4abc5a53b6b (patch)
tree560d440940aab82ecae526d501febdedf3f1c133 /include/linux
parente58b4dea9054c85688c8f639ebdfc8115261dae2 (diff)
downloadlinux-c891b99d25ddbb6b8167f9bdb904d4abc5a53b6b.tar.xz
dma-buf/dma-fence: Add dma_fence_check_and_signal()
The overwhelming majority of users of dma_fence signaling functions don't care about whether the fence had already been signaled by someone else. Therefore, the return code shall be removed from those functions. For the few users who rely on the check, a new, specialized function shall be provided. Add dma_fence_check_and_signal(), which signals a fence if it had not yet been signaled, and informs the user about that. Add a counter part, dma_fence_check_and_signal_locked(), which doesn't take the spinlock. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20251201105011.19386-4-phasta@kernel.org
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dma-fence.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index 19972f5d176f..0504afe52c2a 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -365,6 +365,8 @@ static inline void __dma_fence_might_wait(void) {}
#endif
int dma_fence_signal(struct dma_fence *fence);
+bool dma_fence_check_and_signal(struct dma_fence *fence);
+bool dma_fence_check_and_signal_locked(struct dma_fence *fence);
int dma_fence_signal_locked(struct dma_fence *fence);
int dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp);
int dma_fence_signal_timestamp_locked(struct dma_fence *fence,