blob: 541efe01abc7c4323d9ac20283681c282556f432 [file] [log] [blame]
Thomas Gleixnerec8f24b2019-05-19 13:07:45 +01001# SPDX-License-Identifier: GPL-2.0-only
Gustavo Padovan62304fb2016-04-28 10:46:58 -03002menu "DMABUF options"
3
4config SYNC_FILE
Gustavo Padovan31954662016-05-31 11:33:16 -03005 bool "Explicit Synchronization Framework"
Gustavo Padovan62304fb2016-04-28 10:46:58 -03006 default n
Gustavo Padovan62304fb2016-04-28 10:46:58 -03007 select DMA_SHARED_BUFFER
Masahiro Yamadaa7f7f622020-06-14 01:50:22 +09008 help
Christophe JAILLET3e8a3842020-02-16 12:47:08 +01009 The Sync File Framework adds explicit synchronization via
Chris Wilsonf54d1862016-10-25 13:00:45 +010010 userspace. It enables send/receive 'struct dma_fence' objects to/from
Gustavo Padovan31954662016-05-31 11:33:16 -030011 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
Mauro Carvalho Chehabbaa293e2019-06-27 15:39:22 -030018 Documentation/driver-api/sync_file.rst.
Gustavo Padovan31954662016-05-31 11:33:16 -030019
Gustavo Padovan35538d72016-08-11 12:26:44 -030020config SW_SYNC
21 bool "Sync File Validation Framework"
22 default n
23 depends on SYNC_FILE
24 depends on DEBUG_FS
Masahiro Yamadaa7f7f622020-06-14 01:50:22 +090025 help
Gustavo Padovan35538d72016-08-11 12:26:44 -030026 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
Gerd Hoffmannfbb0de72018-08-27 11:34:44 +020033config UDMABUF
34 bool "userspace dmabuf misc driver"
35 default n
36 depends on DMA_SHARED_BUFFER
Gerd Hoffmann68d2f702018-09-11 15:42:09 +020037 depends on MEMFD_CREATE || COMPILE_TEST
Gerd Hoffmannfbb0de72018-08-27 11:34:44 +020038 help
39 A driver to let userspace turn memfd regions into dma-bufs.
40 Qemu can use this to create host dmabufs for guest framebuffers.
41
Christian Königbb42df42018-07-03 16:42:26 +020042config DMABUF_MOVE_NOTIFY
43 bool "Move notify between drivers (EXPERIMENTAL)"
44 default n
Geert Uytterhoevenc4f3a342021-09-02 14:49:11 +020045 depends on DMA_SHARED_BUFFER
Christian Königbb42df42018-07-03 16:42:26 +020046 help
Geert Uytterhoeven518110c2020-03-24 13:54:42 +010047 Don't pin buffers if the dynamic DMA-buf interface is available on
48 both the exporter as well as the importer. This fixes a security
49 problem where userspace is able to pin unrestricted amounts of memory
50 through DMA-buf.
51 This is marked experimental because we don't yet have a consistent
52 execution context and memory management between drivers.
Christian Königbb42df42018-07-03 16:42:26 +020053
Daniel Vetter84335672021-01-15 17:47:39 +010054config DMABUF_DEBUG
55 bool "DMA-BUF debug checks"
Geert Uytterhoevencca62752021-09-02 14:49:12 +020056 depends on DMA_SHARED_BUFFER
Daniel Vetter84335672021-01-15 17:47:39 +010057 default y if DMA_API_DEBUG
58 help
59 This option enables additional checks for DMA-BUF importers and
60 exporters. Specifically it validates that importers do not peek at the
61 underlying struct page when they import a buffer.
62
Chris Wilson9536b642019-08-19 10:59:26 +010063config DMABUF_SELFTESTS
64 tristate "Selftests for the dma-buf interfaces"
65 default n
66 depends on DMA_SHARED_BUFFER
67
Andrew F. Davisc02a81f2019-12-03 17:26:37 +000068menuconfig DMABUF_HEAPS
69 bool "DMA-BUF Userland Memory Heaps"
70 select DMA_SHARED_BUFFER
71 help
72 Choose this option to enable the DMA-BUF userland memory heaps.
73 This options creates per heap chardevs in /dev/dma_heap/ which
74 allows userspace to allocate dma-bufs that can be shared
75 between drivers.
76
Hridya Valsarajubdb8d062021-06-03 14:47:51 -070077menuconfig DMABUF_SYSFS_STATS
78 bool "DMA-BUF sysfs statistics"
Geert Uytterhoeven87fd9ef2021-09-02 14:49:13 +020079 depends on DMA_SHARED_BUFFER
Hridya Valsarajubdb8d062021-06-03 14:47:51 -070080 help
81 Choose this option to enable DMA-BUF sysfs statistics
82 in location /sys/kernel/dmabuf/buffers.
83
84 /sys/kernel/dmabuf/buffers/<inode_number> will contain
85 statistics for the DMA-BUF with the unique inode number
86 <inode_number>.
87
John Stultzefa04fe2019-12-03 17:26:39 +000088source "drivers/dma-buf/heaps/Kconfig"
89
Gustavo Padovan62304fb2016-04-28 10:46:58 -030090endmenu