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 help 25 A sync object driver that uses a 32bit counter to coordinate 26 synchronization. Useful when there is no hardware primitive backing 27 the synchronization. 28 29 WARNING: improper use of this can result in deadlocking kernel 30 drivers from userspace. Intended for test and debug only. 31 32config UDMABUF 33 bool "userspace dmabuf misc driver" 34 default n 35 depends on DMA_SHARED_BUFFER 36 depends on MEMFD_CREATE || COMPILE_TEST 37 help 38 A driver to let userspace turn memfd regions into dma-bufs. 39 Qemu can use this to create host dmabufs for guest framebuffers. 40 41config DMABUF_MOVE_NOTIFY 42 bool "Move notify between drivers (EXPERIMENTAL)" 43 default n 44 depends on DMA_SHARED_BUFFER 45 help 46 Don't pin buffers if the dynamic DMA-buf interface is available on 47 both the exporter as well as the importer. This fixes a security 48 problem where userspace is able to pin unrestricted amounts of memory 49 through DMA-buf. 50 This is marked experimental because we don't yet have a consistent 51 execution context and memory management between drivers. 52 53config DMABUF_SELFTESTS 54 tristate "Selftests for the dma-buf interfaces" 55 default n 56 depends on DMA_SHARED_BUFFER 57 58config DMABUF_PROCESS_INFO 59 bool "Show dmabuf usage of all processes" 60 default n 61 depends on DMA_SHARED_BUFFER 62 depends on PROC_FS || DEBUG_FS 63 help 64 Choose this option to show dmabuf objects usage of all processes. 65 Firstly, with this option, when a process creates a dmabuf object, 66 its pid and task_comm will be recorded in the dmabuf. 67 Secondly, this option creates dma_buf/process_bufinfo file in 68 debugfs (if DEBUG_FS enabled) and process_dmabuf_info file in procfs 69 (if PROC_FS enabled) to show dmabuf objects usage of all processes. 70 71menuconfig DMABUF_HEAPS 72 bool "DMA-BUF Userland Memory Heaps" 73 select DMA_SHARED_BUFFER 74 help 75 Choose this option to enable the DMA-BUF userland memory heaps. 76 This options creates per heap chardevs in /dev/dma_heap/ which 77 allows userspace to allocate dma-bufs that can be shared 78 between drivers. 79 80menuconfig DMABUF_SYSFS_STATS 81 bool "DMA-BUF sysfs statistics" 82 depends on DMA_SHARED_BUFFER 83 help 84 Choose this option to enable DMA-BUF sysfs statistics 85 in location /sys/kernel/dmabuf/buffers. 86 87 /sys/kernel/dmabuf/buffers/<inode_number> will contain 88 statistics for the DMA-BUF with the unique inode number 89 <inode_number>. 90 91source "drivers/dma-buf/heaps/Kconfig" 92 93endmenu 94