summaryrefslogtreecommitdiff
path: root/mali_kbase/Mconfig
blob: 2d6fca0568bb4484291a4a3ea3e3e2694e52b12d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
#
# (C) COPYRIGHT 2012-2023 ARM Limited. All rights reserved.
#
# This program is free software and is provided to you under the terms of the
# GNU General Public License version 2 as published by the Free Software
# Foundation, and any use by you of this program is subject to the terms
# of such GNU license.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you can access it online at
# http://www.gnu.org/licenses/gpl-2.0.html.
#
#

menuconfig MALI_MIDGARD
	bool "Mali Midgard series support"
	default y
	help
	  Enable this option to build support for a ARM Mali Midgard GPU.

	  To compile this driver as a module, choose M here:
	  this will generate a single module, called mali_kbase.

config MALI_PLATFORM_NAME
	depends on MALI_MIDGARD
	string "Platform name"
	default "hisilicon" if PLATFORM_HIKEY960
	default "hisilicon" if PLATFORM_HIKEY970
	default "devicetree"
	help
	  Enter the name of the desired platform configuration directory to
	  include in the build. 'platform/$(MALI_PLATFORM_NAME)/Kbuild' must
	  exist.

	  When PLATFORM_CUSTOM is set, this needs to be set manually to
	  pick up the desired platform files.

choice
	prompt "Mali HW backend"
	depends on MALI_MIDGARD
	default MALI_NO_MALI if NO_MALI
	default MALI_REAL_HW

config MALI_REAL_HW
	bool "Enable build of Mali kernel driver for real HW"
	depends on MALI_MIDGARD
	help
	  This is the default HW backend.

config MALI_NO_MALI
	bool "Enable build of Mali kernel driver for No Mali"
	depends on MALI_MIDGARD && MALI_EXPERT
	help
	  This can be used to test the driver in a simulated environment
	  whereby the hardware is not physically present. If the hardware is physically
	  present it will not be used. This can be used to test the majority of the
	  driver without needing actual hardware or for software benchmarking.
	  All calls to the simulated hardware will complete immediately as if the hardware
	  completed the task.


endchoice

config MALI_PLATFORM_DT_PIN_RST
	bool "Enable Juno GPU Pin reset"
	depends on MALI_MIDGARD
	default n
	default y if BUSLOG
	help
	  Enables support for GPUs pin reset on Juno platforms.

config MALI_CSF_SUPPORT
	bool "Enable Mali CSF based GPU support"
	depends on MALI_MIDGARD
	default y if GPU_HAS_CSF
	help
	  Enables support for CSF based GPUs.

config MALI_DEVFREQ
	bool "Enable devfreq support for Mali"
	depends on MALI_MIDGARD
	default y
	help
	  Support devfreq for Mali.

	  Using the devfreq framework and, by default, the simple on-demand
	  governor, the frequency of Mali will be dynamically selected from the
	  available OPPs.

config MALI_MIDGARD_DVFS
	bool "Enable legacy DVFS"
	depends on MALI_MIDGARD && !MALI_DEVFREQ
	default n
	help
	  Choose this option to enable legacy DVFS in the Mali Midgard DDK.

config MALI_GATOR_SUPPORT
	bool "Enable Streamline tracing support"
	depends on MALI_MIDGARD && !BACKEND_USER
	default y
	help
	  Enables kbase tracing used by the Arm Streamline Performance Analyzer.
	  The tracepoints are used to derive GPU activity charts in Streamline.

config MALI_MIDGARD_ENABLE_TRACE
	bool "Enable kbase tracing"
	depends on MALI_MIDGARD
	default y if MALI_DEBUG
	default n
	help
	  Enables tracing in kbase. Trace log available through
	  the "mali_trace" debugfs file, when the CONFIG_DEBUG_FS is enabled

config MALI_ARBITER_SUPPORT
	bool "Enable arbiter support for Mali"
	depends on MALI_MIDGARD && !MALI_CSF_SUPPORT
	default n
	help
	  Enable support for the arbiter interface in the driver.
	  This allows an external arbiter to manage driver access
	  to GPU hardware in a virtualized environment

	  If unsure, say N.

config DMA_BUF_SYNC_IOCTL_SUPPORTED
	bool "Enable Kernel DMA buffers support DMA_BUF_IOCTL_SYNC"
	depends on MALI_MIDGARD && BACKEND_KERNEL
	default y

config MALI_DMA_BUF_MAP_ON_DEMAND
	bool "Enable map imported dma-bufs on demand"
	depends on MALI_MIDGARD
	default n
	default y if !DMA_BUF_SYNC_IOCTL_SUPPORTED
	help
	  This option will cause kbase to set up the GPU mapping of imported
	  dma-buf when needed to run atoms. This is the legacy behavior.

	  This is intended for testing and the option will get removed in the
	  future.

config MALI_DMA_BUF_LEGACY_COMPAT
	bool "Enable legacy compatibility cache flush on dma-buf map"
	depends on MALI_MIDGARD && !MALI_DMA_BUF_MAP_ON_DEMAND
	default n
	help
	  This option enables compatibility with legacy dma-buf mapping
	  behavior, then the dma-buf is mapped on import, by adding cache
	  maintenance where MALI_DMA_BUF_MAP_ON_DEMAND would do the mapping,
	  including a cache flush.

	  This option might work-around issues related to missing cache
	  flushes in other drivers. This only has an effect for clients using
	  UK 11.18 or older. For later UK versions it is not possible.

config MALI_CORESIGHT
	depends on MALI_MIDGARD && MALI_CSF_SUPPORT && !NO_MALI
	select CSFFW_DEBUG_FW_AS_RW
	bool "Enable Kbase CoreSight tracing support"
	default n

menuconfig MALI_EXPERT
	depends on MALI_MIDGARD
	bool "Enable Expert Settings"
	default y
	help
	  Enabling this option and modifying the default settings may produce
	  a driver with performance or other limitations.

config MALI_MEMORY_FULLY_BACKED
	bool "Enable memory fully physically-backed"
	depends on MALI_MIDGARD && MALI_EXPERT
	default n
	help
	  This option enables full physical backing of all virtual
	  memory allocations in the kernel. Notice that this build
	  option only affects allocations of grow-on-GPU-page-fault
	  memory.

config MALI_CORESTACK
	bool "Enable support of GPU core stack power control"
	depends on MALI_MIDGARD && MALI_EXPERT
	default n
	help
	  Enabling this feature on supported GPUs will let the driver powering
	  on/off the GPU core stack independently without involving the Power
	  Domain Controller. This should only be enabled on platforms which
	  integration of the PDC to the Mali GPU is known to be problematic.
	  This feature is currently only supported on t-Six and t-HEx GPUs.

	  If unsure, say N.

config PAGE_MIGRATION_SUPPORT
	bool "Compile with page migration support"
	depends on BACKEND_KERNEL
	default y
	default n if ANDROID
	help
	  Compile in support for page migration.
	  If set to disabled ('n') then page migration cannot
	  be enabled at all. If set to enabled, then page migration
	  support is explicitly compiled in. This has no effect when
	  PAGE_MIGRATION_OVERRIDE is disabled.

choice
	prompt "Error injection level"
	depends on MALI_MIDGARD && MALI_EXPERT
	default MALI_ERROR_INJECT_NONE
	help
	  Enables insertion of errors to test module failure and recovery mechanisms.

config MALI_ERROR_INJECT_NONE
	bool "disabled"
	depends on MALI_MIDGARD && MALI_EXPERT
	help
	  Error injection is disabled.

config MALI_ERROR_INJECT_TRACK_LIST
	bool "error track list"
	depends on MALI_MIDGARD && MALI_EXPERT && NO_MALI
	help
	  Errors to inject are pre-configured by the user.

config MALI_ERROR_INJECT_RANDOM
	bool "random error injection"
	depends on MALI_MIDGARD && MALI_EXPERT && NO_MALI
	help
	  Injected errors are random, rather than user-driven.

endchoice

config MALI_ERROR_INJECT_ON
	string
	depends on MALI_MIDGARD && MALI_EXPERT
	default "0" if MALI_ERROR_INJECT_NONE
	default "1" if MALI_ERROR_INJECT_TRACK_LIST
	default "2" if MALI_ERROR_INJECT_RANDOM

config MALI_ERROR_INJECT
	bool
	depends on MALI_MIDGARD && MALI_EXPERT
	default y if !MALI_ERROR_INJECT_NONE

config MALI_DEBUG
	bool "Enable debug build"
	depends on MALI_MIDGARD && MALI_EXPERT
	default y if DEBUG
	default n
	help
	  Select this option for increased checking and reporting of errors.

config MALI_GCOV_KERNEL
	bool "Enable branch coverage via gcov"
	depends on MALI_MIDGARD && MALI_DEBUG
	default n
	help
	  Choose this option to enable building kbase with branch
	  coverage information. When built against a supporting kernel,
	  the coverage information will be available via debugfs.

config MALI_KCOV
	bool "Enable kcov coverage to support fuzzers"
	depends on MALI_MIDGARD && MALI_DEBUG
	default n
	help
	  Choose this option to enable building with fuzzing-oriented
	  coverage, to improve the random test cases that are generated.

config MALI_FENCE_DEBUG
	bool "Enable debug sync fence usage"
	depends on MALI_MIDGARD && MALI_EXPERT
	default y if MALI_DEBUG
	help
	  Select this option to enable additional checking and reporting on the
	  use of sync fences in the Mali driver.

	  This will add a 3s timeout to all sync fence waits in the Mali
	  driver, so that when work for Mali has been waiting on a sync fence
	  for a long time a debug message will be printed, detailing what fence
	  is causing the block, and which dependent Mali atoms are blocked as a
	  result of this.

	  The timeout can be changed at runtime through the js_soft_timeout
	  device attribute, where the timeout is specified in milliseconds.

config MALI_SYSTEM_TRACE
	bool "Enable system event tracing support"
	depends on MALI_MIDGARD && MALI_EXPERT
	default y if MALI_DEBUG
	default n
	help
	  Choose this option to enable system trace events for each
	  kbase event. This is typically used for debugging but has
	  minimal overhead when not in use. Enable only if you know what
	  you are doing.

# Instrumentation options.

# config MALI_PRFCNT_SET_PRIMARY exists in the Kernel Kconfig but is configured using CINSTR_PRIMARY_HWC in Mconfig.
# config MALI_PRFCNT_SET_SECONDARY exists in the Kernel Kconfig but is configured using CINSTR_SECONDARY_HWC in Mconfig.
# config MALI_PRFCNT_SET_TERTIARY exists in the Kernel Kconfig but is configured using CINSTR_TERTIARY_HWC in Mconfig.
# config MALI_PRFCNT_SET_SELECT_VIA_DEBUG_FS exists in the Kernel Kconfig but is configured using CINSTR_HWC_SET_SELECT_VIA_DEBUG_FS in Mconfig.

config MALI_JOB_DUMP
	bool "Enable system level support needed for job dumping"
	depends on MALI_MIDGARD && MALI_EXPERT
	default n
	help
	  Choose this option to enable system level support needed for
	  job dumping. This is typically used for instrumentation but has
	  minimal overhead when not in use. Enable only if you know what
	  you are doing.

config MALI_PWRSOFT_765
	bool "Enable workaround for PWRSOFT-765"
	depends on MALI_MIDGARD && MALI_EXPERT
	default n
	help
	  PWRSOFT-765 fixes devfreq cooling devices issues. The fix was merged
	  in kernel v4.10, however if backported into the kernel then this
	  option must be manually selected.

	  If using kernel >= v4.10 then say N, otherwise if devfreq cooling
	  changes have been backported say Y to avoid compilation errors.


config MALI_HW_ERRATA_1485982_NOT_AFFECTED
	bool "Disable workaround for BASE_HW_ISSUE_GPU2017_1336"
	depends on MALI_MIDGARD && MALI_EXPERT
	default n
	default y if PLATFORM_JUNO
	help
	  This option disables the default workaround for GPU2017-1336. The
	  workaround keeps the L2 cache powered up except for powerdown and reset.

	  The workaround introduces a limitation that will prevent the running of
	  protected mode content on fully coherent platforms, as the switch to IO
	  coherency mode requires the L2 to be turned off.

config MALI_HW_ERRATA_1485982_USE_CLOCK_ALTERNATIVE
	bool "Use alternative workaround for BASE_HW_ISSUE_GPU2017_1336"
	depends on MALI_MIDGARD && MALI_EXPERT && !MALI_HW_ERRATA_1485982_NOT_AFFECTED
	default n
	help
	  This option uses an alternative workaround for GPU2017-1336. Lowering
	  the GPU clock to a, platform specific, known good frequeuncy before
	  powering down the L2 cache. The clock can be specified in the device
	  tree using the property, opp-mali-errata-1485982. Otherwise the
	  slowest clock will be selected.

config MALI_HOST_CONTROLS_SC_RAILS
	bool "Enable Host based control of the shader core power rails"
	depends on MALI_EXPERT && MALI_CSF_SUPPORT
	default n
	help
	  This option enables the Host based control of the power rails for
	  shader cores. It is recommended to use PDCA (Power Domain Control
	  Adapter) inside the GPU to handshake with SoC PMU to control the
	  power of cores.

config MALI_TRACE_POWER_GPU_WORK_PERIOD
	bool "Enable per-application GPU metrics tracepoints"
	depends on MALI_MIDGARD
	default y
	help
	  This option enables per-application GPU metrics tracepoints.

	  If unsure, say N.

choice
	prompt "CSF Firmware trace mode"
	depends on MALI_MIDGARD
	default MALI_FW_TRACE_MODE_MANUAL
	help
	  CSF Firmware log operating mode.

config MALI_FW_TRACE_MODE_MANUAL
	bool "manual mode"
	depends on MALI_MIDGARD
	help
	  firmware log can be read manually by the userspace (and it will
	  also be dumped automatically into dmesg on GPU reset).

config MALI_FW_TRACE_MODE_AUTO_PRINT
	bool "automatic printing mode"
	depends on MALI_MIDGARD
	help
	  firmware log will be periodically emptied into dmesg, manual
	  reading through debugfs is disabled.

config MALI_FW_TRACE_MODE_AUTO_DISCARD
	bool "automatic discarding mode"
	depends on MALI_MIDGARD
	help
	  firmware log will be periodically discarded, the remaining log can be
	  read manually by the userspace (and it will also be dumped
	  automatically into dmesg on GPU reset).

endchoice

source "kernel/drivers/gpu/arm/arbitration/Mconfig"
source "kernel/drivers/gpu/arm/midgard/tests/Mconfig"