Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only
0002 menu "DMABUF options"
0003 
0004 config SYNC_FILE
0005         bool "Explicit Synchronization Framework"
0006         default n
0007         select DMA_SHARED_BUFFER
0008         help
0009           The Sync File Framework adds explicit synchronization via
0010           userspace. It enables send/receive 'struct dma_fence' objects to/from
0011           userspace via Sync File fds for synchronization between drivers via
0012           userspace components. It has been ported from Android.
0013 
0014           The first and main user for this is graphics in which a fence is
0015           associated with a buffer. When a job is submitted to the GPU a fence
0016           is attached to the buffer and is transferred via userspace, using Sync
0017           Files fds, to the DRM driver for example. More details at
0018           Documentation/driver-api/sync_file.rst.
0019 
0020 config SW_SYNC
0021         bool "Sync File Validation Framework"
0022         default n
0023         depends on SYNC_FILE
0024         depends on DEBUG_FS
0025         help
0026           A sync object driver that uses a 32bit counter to coordinate
0027           synchronization.  Useful when there is no hardware primitive backing
0028           the synchronization.
0029 
0030           WARNING: improper use of this can result in deadlocking kernel
0031           drivers from userspace. Intended for test and debug only.
0032 
0033 config UDMABUF
0034         bool "userspace dmabuf misc driver"
0035         default n
0036         depends on DMA_SHARED_BUFFER
0037         depends on MEMFD_CREATE || COMPILE_TEST
0038         help
0039           A driver to let userspace turn memfd regions into dma-bufs.
0040           Qemu can use this to create host dmabufs for guest framebuffers.
0041 
0042 config DMABUF_MOVE_NOTIFY
0043         bool "Move notify between drivers (EXPERIMENTAL)"
0044         default n
0045         depends on DMA_SHARED_BUFFER
0046         help
0047           Don't pin buffers if the dynamic DMA-buf interface is available on
0048           both the exporter as well as the importer. This fixes a security
0049           problem where userspace is able to pin unrestricted amounts of memory
0050           through DMA-buf.
0051           This is marked experimental because we don't yet have a consistent
0052           execution context and memory management between drivers.
0053 
0054 config DMABUF_DEBUG
0055         bool "DMA-BUF debug checks"
0056         depends on DMA_SHARED_BUFFER
0057         default y if DMA_API_DEBUG
0058         help
0059           This option enables additional checks for DMA-BUF importers and
0060           exporters. Specifically it validates that importers do not peek at the
0061           underlying struct page when they import a buffer.
0062 
0063 config DMABUF_SELFTESTS
0064         tristate "Selftests for the dma-buf interfaces"
0065         default n
0066         depends on DMA_SHARED_BUFFER
0067 
0068 menuconfig DMABUF_HEAPS
0069         bool "DMA-BUF Userland Memory Heaps"
0070         select DMA_SHARED_BUFFER
0071         help
0072           Choose this option to enable the DMA-BUF userland memory heaps.
0073           This options creates per heap chardevs in /dev/dma_heap/ which
0074           allows userspace to allocate dma-bufs that can be shared
0075           between drivers.
0076 
0077 menuconfig DMABUF_SYSFS_STATS
0078         bool "DMA-BUF sysfs statistics (DEPRECATED)"
0079         depends on DMA_SHARED_BUFFER
0080         help
0081            Choose this option to enable DMA-BUF sysfs statistics
0082            in location /sys/kernel/dmabuf/buffers.
0083 
0084            /sys/kernel/dmabuf/buffers/<inode_number> will contain
0085            statistics for the DMA-BUF with the unique inode number
0086            <inode_number>.
0087 
0088            This option is deprecated and should sooner or later be removed.
0089            Android is the only user of this and it turned out that this resulted
0090            in quite some performance problems.
0091 
0092 source "drivers/dma-buf/heaps/Kconfig"
0093 
0094 endmenu