Merge tag 'block-5.14-2021-08-07' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / Documentation / gpu / amdgpu.rst
1 =========================
2  drm/amdgpu AMDgpu driver
3 =========================
4
5 The drm/amdgpu driver supports all AMD Radeon GPUs based on the Graphics Core
6 Next (GCN) architecture.
7
8 Module Parameters
9 =================
10
11 The amdgpu driver supports the following module parameters:
12
13 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
14
15 Core Driver Infrastructure
16 ==========================
17
18 This section covers core driver infrastructure.
19
20 .. _amdgpu_memory_domains:
21
22 Memory Domains
23 --------------
24
25 .. kernel-doc:: include/uapi/drm/amdgpu_drm.h
26    :doc: memory domains
27
28 Buffer Objects
29 --------------
30
31 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
32    :doc: amdgpu_object
33
34 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
35    :internal:
36
37 PRIME Buffer Sharing
38 --------------------
39
40 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
41    :doc: PRIME Buffer Sharing
42
43 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
44    :internal:
45
46 MMU Notifier
47 ------------
48
49 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
50    :doc: MMU Notifier
51
52 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
53    :internal:
54
55 AMDGPU Virtual Memory
56 ---------------------
57
58 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
59    :doc: GPUVM
60
61 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
62    :internal:
63
64 Interrupt Handling
65 ------------------
66
67 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
68    :doc: Interrupt Handling
69
70 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
71    :internal:
72
73 IP Blocks
74 ------------------
75
76 .. kernel-doc:: drivers/gpu/drm/amd/include/amd_shared.h
77    :doc: IP Blocks
78
79 .. kernel-doc:: drivers/gpu/drm/amd/include/amd_shared.h
80    :identifiers: amd_ip_block_type amd_ip_funcs
81
82 AMDGPU XGMI Support
83 ===================
84
85 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
86
87 AMDGPU RAS Support
88 ==================
89
90 The AMDGPU RAS interfaces are exposed via sysfs (for informational queries) and
91 debugfs (for error injection).
92
93 RAS debugfs/sysfs Control and Error Injection Interfaces
94 --------------------------------------------------------
95
96 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
97    :doc: AMDGPU RAS debugfs control interface
98
99 RAS Reboot Behavior for Unrecoverable Errors
100 --------------------------------------------------------
101
102 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
103    :doc: AMDGPU RAS Reboot Behavior for Unrecoverable Errors
104
105 RAS Error Count sysfs Interface
106 -------------------------------
107
108 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
109    :doc: AMDGPU RAS sysfs Error Count Interface
110
111 RAS EEPROM debugfs Interface
112 ----------------------------
113
114 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
115    :doc: AMDGPU RAS debugfs EEPROM table reset interface
116
117 RAS VRAM Bad Pages sysfs Interface
118 ----------------------------------
119
120 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
121    :doc: AMDGPU RAS sysfs gpu_vram_bad_pages Interface
122
123 Sample Code
124 -----------
125 Sample code for testing error injection can be found here:
126 https://cgit.freedesktop.org/mesa/drm/tree/tests/amdgpu/ras_tests.c
127
128 This is part of the libdrm amdgpu unit tests which cover several areas of the GPU.
129 There are four sets of tests:
130
131 RAS Basic Test
132
133 The test verifies the RAS feature enabled status and makes sure the necessary sysfs and debugfs files
134 are present.
135
136 RAS Query Test
137
138 This test checks the RAS availability and enablement status for each supported IP block as well as
139 the error counts.
140
141 RAS Inject Test
142
143 This test injects errors for each IP.
144
145 RAS Disable Test
146
147 This test tests disabling of RAS features for each IP block.
148
149
150 GPU Power/Thermal Controls and Monitoring
151 =========================================
152
153 This section covers hwmon and power/thermal controls.
154
155 HWMON Interfaces
156 ----------------
157
158 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
159    :doc: hwmon
160
161 GPU sysfs Power State Interfaces
162 --------------------------------
163
164 GPU power controls are exposed via sysfs files.
165
166 power_dpm_state
167 ~~~~~~~~~~~~~~~
168
169 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
170    :doc: power_dpm_state
171
172 power_dpm_force_performance_level
173 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174
175 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
176    :doc: power_dpm_force_performance_level
177
178 pp_table
179 ~~~~~~~~
180
181 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
182    :doc: pp_table
183
184 pp_od_clk_voltage
185 ~~~~~~~~~~~~~~~~~
186
187 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
188    :doc: pp_od_clk_voltage
189
190 pp_dpm_*
191 ~~~~~~~~
192
193 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
194    :doc: pp_dpm_sclk pp_dpm_mclk pp_dpm_socclk pp_dpm_fclk pp_dpm_dcefclk pp_dpm_pcie
195
196 pp_power_profile_mode
197 ~~~~~~~~~~~~~~~~~~~~~
198
199 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
200    :doc: pp_power_profile_mode
201
202 \*_busy_percent
203 ~~~~~~~~~~~~~~~
204
205 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
206    :doc: gpu_busy_percent
207
208 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
209    :doc: mem_busy_percent
210
211 gpu_metrics
212 ~~~~~~~~~~~~~~~~~~~~~
213
214 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
215    :doc: gpu_metrics
216
217 GPU Product Information
218 =======================
219
220 Information about the GPU can be obtained on certain cards
221 via sysfs
222
223 product_name
224 ------------
225
226 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
227    :doc: product_name
228
229 product_number
230 --------------
231
232 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
233    :doc: product_name
234
235 serial_number
236 -------------
237
238 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
239    :doc: serial_number
240
241 unique_id
242 ---------
243
244 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
245    :doc: unique_id
246
247 GPU Memory Usage Information
248 ============================
249
250 Various memory accounting can be accessed via sysfs
251
252 mem_info_vram_total
253 -------------------
254
255 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
256    :doc: mem_info_vram_total
257
258 mem_info_vram_used
259 ------------------
260
261 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
262    :doc: mem_info_vram_used
263
264 mem_info_vis_vram_total
265 -----------------------
266
267 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
268    :doc: mem_info_vis_vram_total
269
270 mem_info_vis_vram_used
271 ----------------------
272
273 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
274    :doc: mem_info_vis_vram_used
275
276 mem_info_gtt_total
277 ------------------
278
279 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
280    :doc: mem_info_gtt_total
281
282 mem_info_gtt_used
283 -----------------
284
285 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
286    :doc: mem_info_gtt_used
287
288 PCIe Accounting Information
289 ===========================
290
291 pcie_bw
292 -------
293
294 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
295    :doc: pcie_bw
296
297 pcie_replay_count
298 -----------------
299
300 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
301    :doc: pcie_replay_count
302
303 +GPU SmartShift Information
304 ============================
305
306 GPU SmartShift information via sysfs
307
308 smartshift_apu_power
309 --------------------
310
311 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
312    :doc: smartshift_apu_power
313
314 smartshift_dgpu_power
315 ---------------------
316
317 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
318    :doc: smartshift_dgpu_power
319
320 smartshift_bias
321 ---------------
322
323 .. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
324    :doc: smartshift_bias