Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dma-buf: use inline lock for the stub fence v2

Using the inline lock is now the recommended way for dma_fence
implementations.

So use this approach for the framework's internal fences as well.

Also saves about 4 bytes for the external spinlock.

v2: drop unnecessary changes

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/r/20260219160822.1529-7-christian.koenig@amd.com

+2 -10
+2 -10
drivers/dma-buf/dma-fence.c
··· 24 24 EXPORT_TRACEPOINT_SYMBOL(dma_fence_enable_signal); 25 25 EXPORT_TRACEPOINT_SYMBOL(dma_fence_signaled); 26 26 27 - static DEFINE_SPINLOCK(dma_fence_stub_lock); 28 27 static struct dma_fence dma_fence_stub; 29 28 30 29 /* ··· 122 123 123 124 static int __init dma_fence_init_stub(void) 124 125 { 125 - dma_fence_init(&dma_fence_stub, &dma_fence_stub_ops, 126 - &dma_fence_stub_lock, 0, 0); 127 - 126 + dma_fence_init(&dma_fence_stub, &dma_fence_stub_ops, NULL, 0, 0); 128 127 set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, 129 128 &dma_fence_stub.flags); 130 - 131 129 dma_fence_signal(&dma_fence_stub); 132 130 return 0; 133 131 } ··· 156 160 if (fence == NULL) 157 161 return NULL; 158 162 159 - dma_fence_init(fence, 160 - &dma_fence_stub_ops, 161 - &dma_fence_stub_lock, 162 - 0, 0); 163 - 163 + dma_fence_init(fence, &dma_fence_stub_ops, NULL, 0, 0); 164 164 set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, 165 165 &fence->flags); 166 166