3 * (C) COPYRIGHT 2013-2016 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
19 * @file mali_kbase_config_defaults.h
21 * Default values for configuration settings
25 #ifndef _KBASE_CONFIG_DEFAULTS_H_
26 #define _KBASE_CONFIG_DEFAULTS_H_
28 /* Include mandatory definitions per platform */
29 #include <mali_kbase_config_platform.h>
32 * Irq throttle. It is the minimum desired time in between two
33 * consecutive gpu interrupts (given in 'us'). The irq throttle
34 * gpu register will be configured after this, taking into
35 * account the configured max frequency.
37 * Attached value: number in micro seconds
39 #define DEFAULT_IRQ_THROTTLE_TIME_US 20
42 * Default Job Scheduler initial runtime of a context for the CFS Policy,
45 * This value is relative to that of the least-run context, and defines
46 * where in the CFS queue a new context is added. A value of 1 means 'after
47 * the least-run context has used its timeslice'. Therefore, when all
48 * contexts consistently use the same amount of time, a value of 1 models a
49 * FIFO. A value of 0 would model a LIFO.
51 * The value is represented in "numbers of time slices". Multiply this
52 * value by that defined in @ref DEFAULT_JS_CTX_TIMESLICE_NS to get
53 * the time value for this in nanoseconds.
55 #define DEFAULT_JS_CFS_CTX_RUNTIME_INIT_SLICES 1
58 * Default Job Scheduler minimum runtime value of a context for CFS, in
59 * time_slices relative to that of the least-run context.
61 * This is a measure of how much preferrential treatment is given to a
62 * context that is not run very often.
64 * Specficially, this value defines how many timeslices such a context is
65 * (initially) allowed to use at once. Such contexts (e.g. 'interactive'
66 * processes) will appear near the front of the CFS queue, and can initially
67 * use more time than contexts that run continuously (e.g. 'batch'
70 * This limit \b prevents a "stored-up timeslices" DoS attack, where a ctx
71 * not run for a long time attacks the system by using a very large initial
72 * number of timeslices when it finally does run.
74 * @note A value of zero allows not-run-often contexts to get scheduled in
75 * quickly, but to only use a single timeslice when they get scheduled in.
77 #define DEFAULT_JS_CFS_CTX_RUNTIME_MIN_SLICES 2
80 * Boolean indicating whether the driver is configured to be secure at
81 * a potential loss of performance.
83 * This currently affects only r0p0-15dev0 HW and earlier.
85 * On r0p0-15dev0 HW and earlier, there are tradeoffs between security and
88 * - When this is set to true, the driver remains fully secure,
89 * but potentially loses performance compared with setting this to
91 * - When set to false, the driver is open to certain security
94 * From r0p0-00rel0 and onwards, there is no security loss by setting
95 * this to false, and no performance loss by setting it to
98 #define DEFAULT_SECURE_BUT_LOSS_OF_PERFORMANCE false
102 * Use unrestricted Address ID width on the AXI bus.
107 * Restrict GPU to a half of maximum Address ID count.
108 * This will reduce performance, but reduce bus load due to GPU.
113 * Restrict GPU to a quarter of maximum Address ID count.
114 * This will reduce performance, but reduce bus load due to GPU.
119 * Restrict GPU to an eighth of maximum Address ID count.
120 * This will reduce performance, but reduce bus load due to GPU.
126 * Default setting for read Address ID limiting on AXI bus.
128 * Attached value: u32 register value
129 * KBASE_AID_32 - use the full 32 IDs (5 ID bits)
130 * KBASE_AID_16 - use 16 IDs (4 ID bits)
131 * KBASE_AID_8 - use 8 IDs (3 ID bits)
132 * KBASE_AID_4 - use 4 IDs (2 ID bits)
133 * Default value: KBASE_AID_32 (no limit). Note hardware implementation
134 * may limit to a lower value.
136 #define DEFAULT_ARID_LIMIT KBASE_AID_32
139 * Default setting for write Address ID limiting on AXI.
141 * Attached value: u32 register value
142 * KBASE_AID_32 - use the full 32 IDs (5 ID bits)
143 * KBASE_AID_16 - use 16 IDs (4 ID bits)
144 * KBASE_AID_8 - use 8 IDs (3 ID bits)
145 * KBASE_AID_4 - use 4 IDs (2 ID bits)
146 * Default value: KBASE_AID_32 (no limit). Note hardware implementation
147 * may limit to a lower value.
149 #define DEFAULT_AWID_LIMIT KBASE_AID_32
152 * Default UMP device mapping. A UMP_DEVICE_<device>_SHIFT value which
153 * defines which UMP device this GPU should be mapped to.
155 #define DEFAULT_UMP_GPU_DEVICE_SHIFT UMP_DEVICE_Z_SHIFT
158 * Default period for DVFS sampling
160 // #define DEFAULT_PM_DVFS_PERIOD 100 /* 100ms */
161 #define DEFAULT_PM_DVFS_PERIOD 20 /* 20 ms */
164 * Power Management poweroff tick granuality. This is in nanoseconds to
165 * allow HR timer support.
167 * On each scheduling tick, the power manager core may decide to:
168 * -# Power off one or more shader cores
169 * -# Power off the entire GPU
171 #define DEFAULT_PM_GPU_POWEROFF_TICK_NS (400000) /* 400us */
174 * Power Manager number of ticks before shader cores are powered off
176 #define DEFAULT_PM_POWEROFF_TICK_SHADER (2) /* 400-800us */
179 * Power Manager number of ticks before GPU is powered off
181 #define DEFAULT_PM_POWEROFF_TICK_GPU (2) /* 400-800us */
184 * Default scheduling tick granuality
186 #define DEFAULT_JS_SCHEDULING_PERIOD_NS (100000000u) /* 100ms */
189 * Default minimum number of scheduling ticks before jobs are soft-stopped.
191 * This defines the time-slice for a job (which may be different from that of a
194 #define DEFAULT_JS_SOFT_STOP_TICKS (1) /* 100ms-200ms */
197 * Default minimum number of scheduling ticks before CL jobs are soft-stopped.
199 #define DEFAULT_JS_SOFT_STOP_TICKS_CL (1) /* 100ms-200ms */
202 * Default minimum number of scheduling ticks before jobs are hard-stopped
204 #define DEFAULT_JS_HARD_STOP_TICKS_SS (50) /* 5s */
205 #define DEFAULT_JS_HARD_STOP_TICKS_SS_8408 (300) /* 30s */
208 * Default minimum number of scheduling ticks before CL jobs are hard-stopped.
210 #define DEFAULT_JS_HARD_STOP_TICKS_CL (50) /* 5s */
213 * Default minimum number of scheduling ticks before jobs are hard-stopped
216 #define DEFAULT_JS_HARD_STOP_TICKS_DUMPING (15000) /* 1500s */
219 * Default timeout for some software jobs, after which the software event wait
220 * jobs will be cancelled.
222 #define DEFAULT_JS_SOFT_JOB_TIMEOUT ((u32)3000) /* 3s */
225 * Default minimum number of scheduling ticks before the GPU is reset to clear a
228 #define DEFAULT_JS_RESET_TICKS_SS (55) /* 5.5s */
229 #define DEFAULT_JS_RESET_TICKS_SS_8408 (450) /* 45s */
232 * Default minimum number of scheduling ticks before the GPU is reset to clear a
235 #define DEFAULT_JS_RESET_TICKS_CL (55) /* 5.5s */
238 * Default minimum number of scheduling ticks before the GPU is reset to clear a
239 * "stuck" job during dumping.
241 #define DEFAULT_JS_RESET_TICKS_DUMPING (15020) /* 1502s */
244 * Default number of milliseconds given for other jobs on the GPU to be
245 * soft-stopped when the GPU needs to be reset.
247 #define DEFAULT_RESET_TIMEOUT_MS (3000) /* 3s */
250 * Default timeslice that a context is scheduled in for, in nanoseconds.
252 * When a context has used up this amount of time across its jobs, it is
253 * scheduled out to let another run.
255 * @note the resolution is nanoseconds (ns) here, because that's the format
256 * often used by the OS.
258 #define DEFAULT_JS_CTX_TIMESLICE_NS (50000000) /* 50ms */
260 #endif /* _KBASE_CONFIG_DEFAULTS_H_ */