Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1# SPDX-License-Identifier: GPL-2.0-only
2menu "DMABUF options"
3
4config SYNC_FILE
5 bool "Explicit Synchronization Framework"
6 default n
7 select DMA_SHARED_BUFFER
8 help
9 The Sync File Framework adds explicit synchronization via
10 userspace. It enables send/receive 'struct dma_fence' objects to/from
11 userspace via Sync File fds for synchronization between drivers via
12 userspace components. It has been ported from Android.
13
14 The first and main user for this is graphics in which a fence is
15 associated with a buffer. When a job is submitted to the GPU a fence
16 is attached to the buffer and is transferred via userspace, using Sync
17 Files fds, to the DRM driver for example. More details at
18 Documentation/driver-api/sync_file.rst.
19
20config SW_SYNC
21 bool "Sync File Validation Framework"
22 default n
23 depends on SYNC_FILE
24 depends on DEBUG_FS
25 help
26 A sync object driver that uses a 32bit counter to coordinate
27 synchronization. Useful when there is no hardware primitive backing
28 the synchronization.
29
30 WARNING: improper use of this can result in deadlocking kernel
31 drivers from userspace. Intended for test and debug only.
32
33config UDMABUF
34 bool "userspace dmabuf misc driver"
35 default n
36 depends on DMA_SHARED_BUFFER
37 depends on MEMFD_CREATE || COMPILE_TEST
38 depends on MMU
39 help
40 A driver to let userspace turn memfd regions into dma-bufs.
41 Qemu can use this to create host dmabufs for guest framebuffers.
42
43config DMABUF_MOVE_NOTIFY
44 bool "Move notify between drivers (EXPERIMENTAL)"
45 default n
46 depends on DMA_SHARED_BUFFER
47 help
48 Don't pin buffers if the dynamic DMA-buf interface is available on
49 both the exporter as well as the importer. This fixes a security
50 problem where userspace is able to pin unrestricted amounts of memory
51 through DMA-buf.
52 This is marked experimental because we don't yet have a consistent
53 execution context and memory management between drivers.
54
55config DMABUF_DEBUG
56 bool "DMA-BUF debug checks"
57 depends on DMA_SHARED_BUFFER
58 default y if DMA_API_DEBUG
59 help
60 This option enables additional checks for DMA-BUF importers and
61 exporters. Specifically it validates that importers do not peek at the
62 underlying struct page when they import a buffer.
63
64config DMABUF_SELFTESTS
65 tristate "Selftests for the dma-buf interfaces"
66 default n
67 depends on DMA_SHARED_BUFFER
68
69menuconfig DMABUF_HEAPS
70 bool "DMA-BUF Userland Memory Heaps"
71 select DMA_SHARED_BUFFER
72 help
73 Choose this option to enable the DMA-BUF userland memory heaps.
74 This options creates per heap chardevs in /dev/dma_heap/ which
75 allows userspace to allocate dma-bufs that can be shared
76 between drivers.
77
78menuconfig DMABUF_SYSFS_STATS
79 bool "DMA-BUF sysfs statistics (DEPRECATED)"
80 depends on DMA_SHARED_BUFFER
81 help
82 Choose this option to enable DMA-BUF sysfs statistics
83 in location /sys/kernel/dmabuf/buffers.
84
85 /sys/kernel/dmabuf/buffers/<inode_number> will contain
86 statistics for the DMA-BUF with the unique inode number
87 <inode_number>.
88
89 This option is deprecated and should sooner or later be removed.
90 Android is the only user of this and it turned out that this resulted
91 in quite some performance problems.
92
93source "drivers/dma-buf/heaps/Kconfig"
94
95endmenu