xref: /OK3568_Linux_fs/kernel/drivers/dma-buf/Kconfig (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyunmenu "DMABUF options"
3*4882a593Smuzhiyun
4*4882a593Smuzhiyunconfig DMABUF_CACHE
5*4882a593Smuzhiyun	bool "DMABUF cache attachment"
6*4882a593Smuzhiyun	default ARCH_ROCKCHIP
7*4882a593Smuzhiyun	depends on NO_GKI
8*4882a593Smuzhiyun	help
9*4882a593Smuzhiyun	  This option support to store attachments in a list and destroy them by
10*4882a593Smuzhiyun	  set to a callback list in the dtor of dma-buf.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyunconfig RK_DMABUF_DEBUG
13*4882a593Smuzhiyun	bool "Rockchip DMABUF debug option"
14*4882a593Smuzhiyun	depends on NO_GKI
15*4882a593Smuzhiyun	select RK_DMABUF_PROCFS
16*4882a593Smuzhiyun	help
17*4882a593Smuzhiyun	  This option support to debug all the dmabuf on db_list, allows to set
18*4882a593Smuzhiyun	  a name for dmabuf. If not sure, say N
19*4882a593Smuzhiyun
20*4882a593Smuzhiyunconfig RK_DMABUF_DEBUG_ADVANCED
21*4882a593Smuzhiyun	bool "Rockchip DMABUF debug advanced option"
22*4882a593Smuzhiyun	depends on RK_DMABUF_DEBUG
23*4882a593Smuzhiyun	help
24*4882a593Smuzhiyun	  This option support to debug all the dmabuf on db_list, allows to attach
25*4882a593Smuzhiyun	  and map a dmabuf who has no attachment. If not sure, say N
26*4882a593Smuzhiyun
27*4882a593Smuzhiyunconfig DMABUF_PARTIAL
28*4882a593Smuzhiyun	bool "Support for partial cache maintenance"
29*4882a593Smuzhiyun	default y
30*4882a593Smuzhiyun	help
31*4882a593Smuzhiyun	  In order to improve performance, allow dma-buf clients to
32*4882a593Smuzhiyun	  apply cache maintenance to only a subset of a dma-buf.
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun	  Kernel clients will be able to use the dma_buf_begin_cpu_access_partial
35*4882a593Smuzhiyun	  and dma_buf_end_cpu_access_partial functions to only apply cache
36*4882a593Smuzhiyun	  maintenance to a range within the dma-buf.
37*4882a593Smuzhiyun
38*4882a593Smuzhiyunconfig SYNC_FILE
39*4882a593Smuzhiyun	bool "Explicit Synchronization Framework"
40*4882a593Smuzhiyun	default n
41*4882a593Smuzhiyun	select DMA_SHARED_BUFFER
42*4882a593Smuzhiyun	help
43*4882a593Smuzhiyun	  The Sync File Framework adds explicit synchronization via
44*4882a593Smuzhiyun	  userspace. It enables send/receive 'struct dma_fence' objects to/from
45*4882a593Smuzhiyun	  userspace via Sync File fds for synchronization between drivers via
46*4882a593Smuzhiyun	  userspace components. It has been ported from Android.
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun	  The first and main user for this is graphics in which a fence is
49*4882a593Smuzhiyun	  associated with a buffer. When a job is submitted to the GPU a fence
50*4882a593Smuzhiyun	  is attached to the buffer and is transferred via userspace, using Sync
51*4882a593Smuzhiyun	  Files fds, to the DRM driver for example. More details at
52*4882a593Smuzhiyun	  Documentation/driver-api/sync_file.rst.
53*4882a593Smuzhiyun
54*4882a593Smuzhiyunconfig SW_SYNC
55*4882a593Smuzhiyun	tristate "Sync File Validation Framework"
56*4882a593Smuzhiyun	default n
57*4882a593Smuzhiyun	depends on SYNC_FILE
58*4882a593Smuzhiyun	help
59*4882a593Smuzhiyun	  A sync object driver that uses a 32bit counter to coordinate
60*4882a593Smuzhiyun	  synchronization.  Useful when there is no hardware primitive backing
61*4882a593Smuzhiyun	  the synchronization.
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun	  WARNING: improper use of this can result in deadlocking kernel
64*4882a593Smuzhiyun	  drivers from userspace. Intended for test and debug only.
65*4882a593Smuzhiyun
66*4882a593Smuzhiyunconfig SW_SYNC_DEBUG
67*4882a593Smuzhiyun	bool "SW Sync Debug"
68*4882a593Smuzhiyun	depends on DEBUG_FS && SW_SYNC && NO_GKI
69*4882a593Smuzhiyun	default SW_SYNC
70*4882a593Smuzhiyun	help
71*4882a593Smuzhiyun	  To get current fence point and timeline status.
72*4882a593Smuzhiyun
73*4882a593Smuzhiyunconfig UDMABUF
74*4882a593Smuzhiyun	bool "userspace dmabuf misc driver"
75*4882a593Smuzhiyun	default n
76*4882a593Smuzhiyun	depends on DMA_SHARED_BUFFER
77*4882a593Smuzhiyun	depends on MEMFD_CREATE || COMPILE_TEST
78*4882a593Smuzhiyun	help
79*4882a593Smuzhiyun	  A driver to let userspace turn memfd regions into dma-bufs.
80*4882a593Smuzhiyun	  Qemu can use this to create host dmabufs for guest framebuffers.
81*4882a593Smuzhiyun
82*4882a593Smuzhiyunconfig DMABUF_MOVE_NOTIFY
83*4882a593Smuzhiyun	bool "Move notify between drivers (EXPERIMENTAL)"
84*4882a593Smuzhiyun	default n
85*4882a593Smuzhiyun	depends on DMA_SHARED_BUFFER
86*4882a593Smuzhiyun	help
87*4882a593Smuzhiyun	  Don't pin buffers if the dynamic DMA-buf interface is available on
88*4882a593Smuzhiyun	  both the exporter as well as the importer. This fixes a security
89*4882a593Smuzhiyun	  problem where userspace is able to pin unrestricted amounts of memory
90*4882a593Smuzhiyun	  through DMA-buf.
91*4882a593Smuzhiyun	  This is marked experimental because we don't yet have a consistent
92*4882a593Smuzhiyun	  execution context and memory management between drivers.
93*4882a593Smuzhiyun
94*4882a593Smuzhiyunconfig DMABUF_SELFTESTS
95*4882a593Smuzhiyun	tristate "Selftests for the dma-buf interfaces"
96*4882a593Smuzhiyun	default n
97*4882a593Smuzhiyun	depends on DMA_SHARED_BUFFER
98*4882a593Smuzhiyun
99*4882a593Smuzhiyunmenuconfig DMABUF_HEAPS
100*4882a593Smuzhiyun	bool "DMA-BUF Userland Memory Heaps"
101*4882a593Smuzhiyun	select DMA_SHARED_BUFFER
102*4882a593Smuzhiyun	help
103*4882a593Smuzhiyun	  Choose this option to enable the DMA-BUF userland memory heaps.
104*4882a593Smuzhiyun	  This options creates per heap chardevs in /dev/dma_heap/ which
105*4882a593Smuzhiyun	  allows userspace to allocate dma-bufs that can be shared
106*4882a593Smuzhiyun	  between drivers.
107*4882a593Smuzhiyun
108*4882a593Smuzhiyunmenuconfig DMABUF_SYSFS_STATS
109*4882a593Smuzhiyun	bool "DMA-BUF sysfs statistics"
110*4882a593Smuzhiyun	depends on DMA_SHARED_BUFFER
111*4882a593Smuzhiyun	help
112*4882a593Smuzhiyun	   Choose this option to enable DMA-BUF sysfs statistics
113*4882a593Smuzhiyun	   in location /sys/kernel/dmabuf/buffers.
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun	   /sys/kernel/dmabuf/buffers/<inode_number> will contain
116*4882a593Smuzhiyun	   statistics for the DMA-BUF with the unique inode number
117*4882a593Smuzhiyun	   <inode_number>.
118*4882a593Smuzhiyun
119*4882a593Smuzhiyunsource "drivers/dma-buf/heaps/Kconfig"
120*4882a593Smuzhiyunsource "drivers/dma-buf/rk_heaps/Kconfig"
121*4882a593Smuzhiyun
122*4882a593Smuzhiyunendmenu
123