Thomas Gleixner | ec8f24b | 2019-05-19 13:07:45 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0-only |
Gustavo Padovan | 62304fb | 2016-04-28 10:46:58 -0300 | [diff] [blame] | 2 | menu "DMABUF options" |
| 3 | |
| 4 | config SYNC_FILE |
Gustavo Padovan | 3195466 | 2016-05-31 11:33:16 -0300 | [diff] [blame] | 5 | bool "Explicit Synchronization Framework" |
Gustavo Padovan | 62304fb | 2016-04-28 10:46:58 -0300 | [diff] [blame] | 6 | default n |
Gustavo Padovan | 62304fb | 2016-04-28 10:46:58 -0300 | [diff] [blame] | 7 | select DMA_SHARED_BUFFER |
Masahiro Yamada | a7f7f62 | 2020-06-14 01:50:22 +0900 | [diff] [blame] | 8 | help |
Christophe JAILLET | 3e8a384 | 2020-02-16 12:47:08 +0100 | [diff] [blame] | 9 | The Sync File Framework adds explicit synchronization via |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 10 | userspace. It enables send/receive 'struct dma_fence' objects to/from |
Gustavo Padovan | 3195466 | 2016-05-31 11:33:16 -0300 | [diff] [blame] | 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 |
Mauro Carvalho Chehab | baa293e | 2019-06-27 15:39:22 -0300 | [diff] [blame] | 18 | Documentation/driver-api/sync_file.rst. |
Gustavo Padovan | 3195466 | 2016-05-31 11:33:16 -0300 | [diff] [blame] | 19 | |
Gustavo Padovan | 35538d7 | 2016-08-11 12:26:44 -0300 | [diff] [blame] | 20 | config SW_SYNC |
| 21 | bool "Sync File Validation Framework" |
| 22 | default n |
| 23 | depends on SYNC_FILE |
| 24 | depends on DEBUG_FS |
Masahiro Yamada | a7f7f62 | 2020-06-14 01:50:22 +0900 | [diff] [blame] | 25 | help |
Gustavo Padovan | 35538d7 | 2016-08-11 12:26:44 -0300 | [diff] [blame] | 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 | |
Gerd Hoffmann | fbb0de7 | 2018-08-27 11:34:44 +0200 | [diff] [blame] | 33 | config UDMABUF |
| 34 | bool "userspace dmabuf misc driver" |
| 35 | default n |
| 36 | depends on DMA_SHARED_BUFFER |
Gerd Hoffmann | 68d2f70 | 2018-09-11 15:42:09 +0200 | [diff] [blame] | 37 | depends on MEMFD_CREATE || COMPILE_TEST |
Gerd Hoffmann | fbb0de7 | 2018-08-27 11:34:44 +0200 | [diff] [blame] | 38 | 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önig | bb42df4 | 2018-07-03 16:42:26 +0200 | [diff] [blame] | 42 | config DMABUF_MOVE_NOTIFY |
| 43 | bool "Move notify between drivers (EXPERIMENTAL)" |
| 44 | default n |
Geert Uytterhoeven | c4f3a34 | 2021-09-02 14:49:11 +0200 | [diff] [blame] | 45 | depends on DMA_SHARED_BUFFER |
Christian König | bb42df4 | 2018-07-03 16:42:26 +0200 | [diff] [blame] | 46 | help |
Geert Uytterhoeven | 518110c | 2020-03-24 13:54:42 +0100 | [diff] [blame] | 47 | 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önig | bb42df4 | 2018-07-03 16:42:26 +0200 | [diff] [blame] | 53 | |
Daniel Vetter | 8433567 | 2021-01-15 17:47:39 +0100 | [diff] [blame] | 54 | config DMABUF_DEBUG |
| 55 | bool "DMA-BUF debug checks" |
Geert Uytterhoeven | cca6275 | 2021-09-02 14:49:12 +0200 | [diff] [blame] | 56 | depends on DMA_SHARED_BUFFER |
Daniel Vetter | 8433567 | 2021-01-15 17:47:39 +0100 | [diff] [blame] | 57 | 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 Wilson | 9536b64 | 2019-08-19 10:59:26 +0100 | [diff] [blame] | 63 | config DMABUF_SELFTESTS |
| 64 | tristate "Selftests for the dma-buf interfaces" |
| 65 | default n |
| 66 | depends on DMA_SHARED_BUFFER |
| 67 | |
Andrew F. Davis | c02a81f | 2019-12-03 17:26:37 +0000 | [diff] [blame] | 68 | menuconfig 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 Valsaraju | bdb8d06 | 2021-06-03 14:47:51 -0700 | [diff] [blame] | 77 | menuconfig DMABUF_SYSFS_STATS |
| 78 | bool "DMA-BUF sysfs statistics" |
Geert Uytterhoeven | 87fd9ef | 2021-09-02 14:49:13 +0200 | [diff] [blame] | 79 | depends on DMA_SHARED_BUFFER |
Hridya Valsaraju | bdb8d06 | 2021-06-03 14:47:51 -0700 | [diff] [blame] | 80 | 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 Stultz | efa04fe | 2019-12-03 17:26:39 +0000 | [diff] [blame] | 88 | source "drivers/dma-buf/heaps/Kconfig" |
| 89 | |
Gustavo Padovan | 62304fb | 2016-04-28 10:46:58 -0300 | [diff] [blame] | 90 | endmenu |