Skip to content

Commit ddb26d8

Browse files
author
Christoph Hellwig
committed
dma-mapping: move CONFIG_DMA_CMA to kernel/dma/Kconfig
This is where all the related code already lives. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ff4c25f commit ddb26d8

2 files changed

Lines changed: 77 additions & 77 deletions

File tree

‎drivers/base/Kconfig‎

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -191,83 +191,6 @@ config DMA_FENCE_TRACE
191191
lockup related problems for dma-buffers shared across multiple
192192
devices.
193193

194-
config DMA_CMA
195-
bool "DMA Contiguous Memory Allocator"
196-
depends on HAVE_DMA_CONTIGUOUS && CMA
197-
help
198-
This enables the Contiguous Memory Allocator which allows drivers
199-
to allocate big physically-contiguous blocks of memory for use with
200-
hardware components that do not support I/O map nor scatter-gather.
201-
202-
You can disable CMA by specifying "cma=0" on the kernel's command
203-
line.
204-
205-
For more information see <include/linux/dma-contiguous.h>.
206-
If unsure, say "n".
207-
208-
if DMA_CMA
209-
comment "Default contiguous memory area size:"
210-
211-
config CMA_SIZE_MBYTES
212-
int "Size in Mega Bytes"
213-
depends on !CMA_SIZE_SEL_PERCENTAGE
214-
default 0 if X86
215-
default 16
216-
help
217-
Defines the size (in MiB) of the default memory area for Contiguous
218-
Memory Allocator. If the size of 0 is selected, CMA is disabled by
219-
default, but it can be enabled by passing cma=size[MG] to the kernel.
220-
221-
222-
config CMA_SIZE_PERCENTAGE
223-
int "Percentage of total memory"
224-
depends on !CMA_SIZE_SEL_MBYTES
225-
default 0 if X86
226-
default 10
227-
help
228-
Defines the size of the default memory area for Contiguous Memory
229-
Allocator as a percentage of the total memory in the system.
230-
If 0 percent is selected, CMA is disabled by default, but it can be
231-
enabled by passing cma=size[MG] to the kernel.
232-
233-
choice
234-
prompt "Selected region size"
235-
default CMA_SIZE_SEL_MBYTES
236-
237-
config CMA_SIZE_SEL_MBYTES
238-
bool "Use mega bytes value only"
239-
240-
config CMA_SIZE_SEL_PERCENTAGE
241-
bool "Use percentage value only"
242-
243-
config CMA_SIZE_SEL_MIN
244-
bool "Use lower value (minimum)"
245-
246-
config CMA_SIZE_SEL_MAX
247-
bool "Use higher value (maximum)"
248-
249-
endchoice
250-
251-
config CMA_ALIGNMENT
252-
int "Maximum PAGE_SIZE order of alignment for contiguous buffers"
253-
range 4 12
254-
default 8
255-
help
256-
DMA mapping framework by default aligns all buffers to the smallest
257-
PAGE_SIZE order which is greater than or equal to the requested buffer
258-
size. This works well for buffers up to a few hundreds kilobytes, but
259-
for larger buffers it just a memory waste. With this parameter you can
260-
specify the maximum PAGE_SIZE order for contiguous buffers. Larger
261-
buffers will be aligned only to this specified order. The order is
262-
expressed as a power of two multiplied by the PAGE_SIZE.
263-
264-
For example, if your system defaults to 4KiB pages, the order value
265-
of 8 means that the buffers will be aligned up to 1MiB only.
266-
267-
If unsure, leave the default value "8".
268-
269-
endif
270-
271194
config GENERIC_ARCH_TOPOLOGY
272195
bool
273196
help

‎kernel/dma/Kconfig‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,83 @@ config DMA_DIRECT_REMAP
6060
bool
6161
select DMA_REMAP
6262

63+
config DMA_CMA
64+
bool "DMA Contiguous Memory Allocator"
65+
depends on HAVE_DMA_CONTIGUOUS && CMA
66+
help
67+
This enables the Contiguous Memory Allocator which allows drivers
68+
to allocate big physically-contiguous blocks of memory for use with
69+
hardware components that do not support I/O map nor scatter-gather.
70+
71+
You can disable CMA by specifying "cma=0" on the kernel's command
72+
line.
73+
74+
For more information see <include/linux/dma-contiguous.h>.
75+
If unsure, say "n".
76+
77+
if DMA_CMA
78+
comment "Default contiguous memory area size:"
79+
80+
config CMA_SIZE_MBYTES
81+
int "Size in Mega Bytes"
82+
depends on !CMA_SIZE_SEL_PERCENTAGE
83+
default 0 if X86
84+
default 16
85+
help
86+
Defines the size (in MiB) of the default memory area for Contiguous
87+
Memory Allocator. If the size of 0 is selected, CMA is disabled by
88+
default, but it can be enabled by passing cma=size[MG] to the kernel.
89+
90+
91+
config CMA_SIZE_PERCENTAGE
92+
int "Percentage of total memory"
93+
depends on !CMA_SIZE_SEL_MBYTES
94+
default 0 if X86
95+
default 10
96+
help
97+
Defines the size of the default memory area for Contiguous Memory
98+
Allocator as a percentage of the total memory in the system.
99+
If 0 percent is selected, CMA is disabled by default, but it can be
100+
enabled by passing cma=size[MG] to the kernel.
101+
102+
choice
103+
prompt "Selected region size"
104+
default CMA_SIZE_SEL_MBYTES
105+
106+
config CMA_SIZE_SEL_MBYTES
107+
bool "Use mega bytes value only"
108+
109+
config CMA_SIZE_SEL_PERCENTAGE
110+
bool "Use percentage value only"
111+
112+
config CMA_SIZE_SEL_MIN
113+
bool "Use lower value (minimum)"
114+
115+
config CMA_SIZE_SEL_MAX
116+
bool "Use higher value (maximum)"
117+
118+
endchoice
119+
120+
config CMA_ALIGNMENT
121+
int "Maximum PAGE_SIZE order of alignment for contiguous buffers"
122+
range 4 12
123+
default 8
124+
help
125+
DMA mapping framework by default aligns all buffers to the smallest
126+
PAGE_SIZE order which is greater than or equal to the requested buffer
127+
size. This works well for buffers up to a few hundreds kilobytes, but
128+
for larger buffers it just a memory waste. With this parameter you can
129+
specify the maximum PAGE_SIZE order for contiguous buffers. Larger
130+
buffers will be aligned only to this specified order. The order is
131+
expressed as a power of two multiplied by the PAGE_SIZE.
132+
133+
For example, if your system defaults to 4KiB pages, the order value
134+
of 8 means that the buffers will be aligned up to 1MiB only.
135+
136+
If unsure, leave the default value "8".
137+
138+
endif
139+
63140
config DMA_API_DEBUG
64141
bool "Enable debugging of DMA-API usage"
65142
select NEED_DMA_MAP_STATE

0 commit comments

Comments
 (0)