← Documents Documentation/gpu/amdgpu/driver-core.rst GitHub 원문 ↗

Linux 6.18.37 · GPU

Core Driver Infrastructure

AMDGPU IP, Pipe·Queue와 memory·VM·IRQ infrastructure의 전문 번역입니다.

Source pathDocumentation/gpu/amdgpu/driver-core.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

driver-core.rst:1-213

AMDGPU를 ASIC별 IP component의 집합으로 설명하고, 주요 GPU IP 8종, GFX·Compute·SDMA의 Pipe/Queue model, HQD/MQD queue switching, KIQ·IB와 memory·VM·IRQ kernel-doc 진입점을 연결합니다. Figure label, anchor, source path와 identifier를 원문 줄 좌표와 함께 보존했습니다.

Driver core 조사 지도
조사 대상핵심 개념첫 source 또는 section
ASIC initialization·resetIP list와 SoC-dependent operationvi.c, soc15.c, nv.c와 amd_shared.h
Queue hang·preemptionPipe, HQD_ACTIVE, HQD와 MQDpipes-and-queues-description
Kernel queue controlKIQ 또는 GFX 11+ MESDriver Structure
Command submissionIB memory pointer와 ring 복귀Indirect Buffer
Buffer·sharing·HMMBO, PRIME, MMU Notifieramdgpu_object.c, amdgpu_dma_buf.c, amdgpu_hmm.c
Address·interruptGPUVM와 IRQamdgpu_vm.c, amdgpu_irq.c

증상이나 작업 영역에서 가장 먼저 볼 component와 source를 찾습니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ============================
2 Core Driver Infrastructure
3 ============================
4
5 GPU Hardware Structure
6 ======================
7
8 Each ASIC is a collection of hardware blocks. We refer to them as
9 "IPs" (Intellectual Property blocks). Each IP encapsulates certain
10 functionality. IPs are versioned and can also be mixed and matched.
11 E.g., you might have two different ASICs that both have System DMA (SDMA) 5.x IPs.
12 The driver is arranged by IPs. There are driver components to handle
13 the initialization and operation of each IP. There are also a bunch
14 of smaller IPs that don't really need much if any driver interaction.
15 Those end up getting lumped into the common stuff in the soc files.
16 The soc files (e.g., vi.c, soc15.c nv.c) contain code for aspects of
17 the SoC itself rather than specific IPs. E.g., things like GPU resets
18 and register access functions are SoC dependent.
19
20 An APU contains more than just CPU and GPU, it also contains all of
21 the platform stuff (audio, usb, gpio, etc.). Also, a lot of
22 components are shared between the CPU, platform, and the GPU (e.g.,
23 SMU, PSP, etc.). Specific components (CPU, GPU, etc.) usually have
24 their interface to interact with those common components. For things
25 like S0i3 there is a ton of coordination required across all the
26 components, but that is probably a bit beyond the scope of this
27 section.
28
29 With respect to the GPU, we have the following major IPs:
30
31 GMC (Graphics Memory Controller)
32 This was a dedicated IP on older pre-vega chips, but has since
33 become somewhat decentralized on vega and newer chips. They now
34 have dedicated memory hubs for specific IPs or groups of IPs. We
35 still treat it as a single component in the driver however since
36 the programming model is still pretty similar. This is how the
37 different IPs on the GPU get the memory (VRAM or system memory).
38 It also provides the support for per process GPU virtual address
39 spaces.
40
41 IH (Interrupt Handler)
42 This is the interrupt controller on the GPU. All of the IPs feed
43 their interrupts into this IP and it aggregates them into a set of
44 ring buffers that the driver can parse to handle interrupts from
45 different IPs.
46
47 PSP (Platform Security Processor)
48 This handles security policy for the SoC and executes trusted
49 applications, and validates and loads firmwares for other blocks.
50
51 SMU (System Management Unit)
52 This is the power management microcontroller. It manages the entire
53 SoC. The driver interacts with it to control power management
54 features like clocks, voltages, power rails, etc.
55
56 DCN (Display Controller Next)
57 This is the display controller. It handles the display hardware.
58 It is described in more details in :ref:`Display Core <amdgpu-display-core>`.
59
60 SDMA (System DMA)
61 This is a multi-purpose DMA engine. The kernel driver uses it for
62 various things including paging and GPU page table updates. It's also
63 exposed to userspace for use by user mode drivers (OpenGL, Vulkan,
64 etc.)
65
66 GC (Graphics and Compute)
67 This is the graphics and compute engine, i.e., the block that
68 encompasses the 3D pipeline and shader blocks. This is by far the
69 largest block on the GPU. The 3D pipeline has tons of sub-blocks. In
70 addition to that, it also contains the CP microcontrollers (ME, PFP, CE,
71 MEC) and the RLC microcontroller. It's exposed to userspace for user mode
72 drivers (OpenGL, Vulkan, OpenCL, etc.). More details in :ref:`Graphics (GFX)
73 and Compute <amdgpu-gc>`.
74
75 VCN (Video Core Next)
76 This is the multi-media engine. It handles video and image encode and
77 decode. It's exposed to userspace for user mode drivers (VA-API,
78 OpenMAX, etc.)
79
80 .. _pipes-and-queues-description:
81
82 GFX, Compute, and SDMA Overall Behavior
83 =======================================
84
85 .. note:: For simplicity, whenever the term block is used in this section, it
86 means GFX, Compute, and SDMA.
87
88 GFX, Compute and SDMA share a similar form of operation that can be abstracted
89 to facilitate understanding of the behavior of these blocks. See the figure
90 below illustrating the common components of these blocks:
91
92 .. kernel-figure:: pipe_and_queue_abstraction.svg
93
94 In the central part of this figure, you can see two hardware elements, one called
95 **Pipes** and another called **Queues**; it is important to highlight that Queues
96 must be associated with a Pipe and vice-versa. Every specific hardware IP may have
97 a different number of Pipes and, in turn, a different number of Queues; for
98 example, GFX 11 has two Pipes and two Queues per Pipe for the GFX front end.
99
100 Pipe is the hardware that processes the instructions available in the Queues;
101 in other words, it is a thread executing the operations inserted in the Queue.
102 One crucial characteristic of Pipes is that they can only execute one Queue at
103 a time; no matter if the hardware has multiple Queues in the Pipe, it only runs
104 one Queue per Pipe.
105
106 Pipes have the mechanics of swapping between queues at the hardware level.
107 Nonetheless, they only make use of Queues that are considered mapped. Pipes can
108 switch between queues based on any of the following inputs:
109
110 1. Command Stream;
111 2. Packet by Packet;
112 3. Other hardware requests the change (e.g., MES).
113
114 Queues within Pipes are defined by the Hardware Queue Descriptors (HQD).
115 Associated with the HQD concept, we have the Memory Queue Descriptor (MQD),
116 which is responsible for storing information about the state of each of the
117 available Queues in the memory. The state of a Queue contains information such
118 as the GPU virtual address of the queue itself, save areas, doorbell, etc. The
119 MQD also stores the HQD registers, which are vital for activating or
120 deactivating a given Queue. The scheduling firmware (e.g., MES) is responsible
121 for loading HQDs from MQDs and vice versa.
122
123 The Queue-switching process can also happen with the firmware requesting the
124 preemption or unmapping of a Queue. The firmware waits for the HQD_ACTIVE bit
125 to change to low before saving the state into the MQD. To make a different
126 Queue become active, the firmware copies the MQD state into the HQD registers
127 and loads any additional state. Finally, it sets the HQD_ACTIVE bit to high to
128 indicate that the queue is active. The Pipe will then execute work from active
129 Queues.
130
131 Driver Structure
132 ================
133
134 In general, the driver has a list of all of the IPs on a particular
135 SoC and for things like init/fini/suspend/resume, more or less just
136 walks the list and handles each IP.
137
138 Some useful constructs:
139
140 KIQ (Kernel Interface Queue)
141 This is a control queue used by the kernel driver to manage other gfx
142 and compute queues on the GFX/compute engine. You can use it to
143 map/unmap additional queues, etc. This is replaced by MES on
144 GFX 11 and newer hardware.
145
146 IB (Indirect Buffer)
147 A command buffer for a particular engine. Rather than writing
148 commands directly to the queue, you can write the commands into a
149 piece of memory and then put a pointer to the memory into the queue.
150 The hardware will then follow the pointer and execute the commands in
151 the memory, then returning to the rest of the commands in the ring.
152
153 .. _amdgpu_memory_domains:
154
155 Memory Domains
156 ==============
157
158 .. kernel-doc:: include/uapi/drm/amdgpu_drm.h
159 :doc: memory domains
160
161 Buffer Objects
162 ==============
163
164 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
165 :doc: amdgpu_object
166
167 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
168 :internal:
169
170 PRIME Buffer Sharing
171 ====================
172
173 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
174 :doc: PRIME Buffer Sharing
175
176 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
177 :internal:
178
179 MMU Notifier
180 ============
181
182 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
183 :doc: MMU Notifier
184
185 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
186 :internal:
187
188 AMDGPU Virtual Memory
189 =====================
190
191 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
192 :doc: GPUVM
193
194 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
195 :internal:
196
197 Interrupt Handling
198 ==================
199
200 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
201 :doc: Interrupt Handling
202
203 .. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
204 :internal:
205
206 IP Blocks
207 =========
208
209 .. kernel-doc:: drivers/gpu/drm/amd/include/amd_shared.h
210 :doc: IP Blocks
211
212 .. kernel-doc:: drivers/gpu/drm/amd/include/amd_shared.h
213 :identifiers: amd_ip_block_type amd_ip_funcs DC_FEATURE_MASK DC_DEBUG_MASK
214

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

ASIC, SoC와 주요 GPU IP

1-79

각 ASIC은 특정 기능을 캡슐화한 hardware block의 집합이며, driver에서는 이를 IP(Intellectual Property block)라고 부릅니다. IP는 version을 가지며 서로 다른 ASIC이 같은 SDMA 5.x 같은 IP를 공유할 수 있습니다. Driver도 IP별 initialization과 operation component로 구성됩니다.

IP 중심 driver 구조
범위구현 위치
독립 IP 기능각 IP driver componentGMC, IH, PSP, SMU, DCN, SDMA, GC, VCN
작고 interaction이 적은 IPSoC common code에 통합별도 lifecycle이 필요하지 않은 block
SoC 자체 기능vi.c, soc15.c, nv.cGPU reset과 register access function
Version 조합ASIC별 IP inventory서로 다른 ASIC이 같은 SDMA 5.x 사용 가능

특정 IP와 SoC 공통 기능을 구분하면 source file의 ownership을 찾기 쉽습니다.

APU에는 CPU와 GPU뿐 아니라 audio, USB, GPIO 같은 platform component도 있고 SMU와 PSP처럼 CPU, platform, GPU가 공유하는 component도 있습니다. 각 subsystem은 공통 component와 통신하는 interface를 가지며 S0i3 같은 system power state는 여러 component의 광범위한 coordination을 요구합니다.

APU component coordination
CPU, GPU와 platform device가 하나의 APU SoC에 존재Audio, USB, GPIO 등 platform block이 함께 동작SMU가 clock, voltage와 power rail을 SoC 전체에서 조정PSP가 security policy, trusted application과 firmware validation 담당CPU·GPU·platform이 각 interface로 SMU와 PSP 사용S0i3 진입·복귀에는 모든 component 상태를 함께 조정

SoC 공통 service와 개별 subsystem의 interface 관계입니다.

AMDGPU의 주요 IP 8종
IP역할핵심 interface 또는 기능
GMC, Graphics Memory ControllerGPU IP의 VRAM·system memory 접근과 process별 GPU virtual addressPre-Vega dedicated IP, Vega 이후 memory hub로 분산됐지만 driver에서는 단일 component
IH, Interrupt Handler모든 GPU IP interrupt를 ring buffer로 aggregateDriver가 ring을 parse해 source IP별 interrupt 처리
PSP, Platform Security ProcessorSoC security policy와 trusted application 실행다른 block firmware 검증·load
SMU, System Management UnitSoC power management microcontrollerClock, voltage, power rail 제어
DCN, Display Controller NextDisplay hardware controlDisplay Core 문서의 amdgpu-display-core
SDMA, System DMA범용 DMA enginePaging, GPU page table update와 userspace OpenGL·Vulkan
GC, Graphics and Compute3D pipeline, shader와 compute engineCP microcontroller ME·PFP·CE·MEC, RLC, OpenGL·Vulkan·OpenCL
VCN, Video Core NextVideo·image encode/decodeVA-API와 OpenMAX userspace interface

원문 순서와 abbreviation을 유지했습니다.

Memory와 userspace 관점
IPKernel 사용Userspace 노출
GMCVRAM/system memory와 GPUVM 기반 제공Process별 GPU address space의 기반
SDMAPaging과 page table updateOpenGL·Vulkan user-mode driver
GCGFX/compute engine managementOpenGL·Vulkan·OpenCL
VCNMultimedia scheduling과 controlVA-API·OpenMAX
DCNDisplay mode와 scanoutDRM/KMS를 통해 간접 사용

각 IP가 kernel 내부에만 머무는지 user-mode driver에도 노출되는지 구분합니다.

============================
 Core Driver Infrastructure
============================

GPU Hardware Structure
======================

Each ASIC is a collection of hardware blocks.  We refer to them as
"IPs" (Intellectual Property blocks).  Each IP encapsulates certain
functionality. IPs are versioned and can also be mixed and matched.
E.g., you might have two different ASICs that both have System DMA (SDMA) 5.x IPs.
The driver is arranged by IPs.  There are driver components to handle
the initialization and operation of each IP.  There are also a bunch
of smaller IPs that don't really need much if any driver interaction.
Those end up getting lumped into the common stuff in the soc files.
The soc files (e.g., vi.c, soc15.c nv.c) contain code for aspects of
the SoC itself rather than specific IPs.  E.g., things like GPU resets
and register access functions are SoC dependent.

An APU contains more than just CPU and GPU, it also contains all of
the platform stuff (audio, usb, gpio, etc.).  Also, a lot of
components are shared between the CPU, platform, and the GPU (e.g.,
SMU, PSP, etc.).  Specific components (CPU, GPU, etc.) usually have
their interface to interact with those common components.  For things
like S0i3 there is a ton of coordination required across all the
components, but that is probably a bit beyond the scope of this
section.

With respect to the GPU, we have the following major IPs:

GMC (Graphics Memory Controller)
    This was a dedicated IP on older pre-vega chips, but has since
    become somewhat decentralized on vega and newer chips.  They now
    have dedicated memory hubs for specific IPs or groups of IPs.  We
    still treat it as a single component in the driver however since
    the programming model is still pretty similar.  This is how the
    different IPs on the GPU get the memory (VRAM or system memory).
    It also provides the support for per process GPU virtual address
    spaces.

IH (Interrupt Handler)
    This is the interrupt controller on the GPU.  All of the IPs feed
    their interrupts into this IP and it aggregates them into a set of
    ring buffers that the driver can parse to handle interrupts from
    different IPs.

PSP (Platform Security Processor)
    This handles security policy for the SoC and executes trusted
    applications, and validates and loads firmwares for other blocks.

SMU (System Management Unit)
    This is the power management microcontroller.  It manages the entire
    SoC.  The driver interacts with it to control power management
    features like clocks, voltages, power rails, etc.

DCN (Display Controller Next)
    This is the display controller.  It handles the display hardware.
    It is described in more details in :ref:`Display Core <amdgpu-display-core>`.

SDMA (System DMA)
    This is a multi-purpose DMA engine.  The kernel driver uses it for
    various things including paging and GPU page table updates.  It's also
    exposed to userspace for use by user mode drivers (OpenGL, Vulkan,
    etc.)

GC (Graphics and Compute)
    This is the graphics and compute engine, i.e., the block that
    encompasses the 3D pipeline and shader blocks.  This is by far the
    largest block on the GPU.  The 3D pipeline has tons of sub-blocks.  In
    addition to that, it also contains the CP microcontrollers (ME, PFP, CE,
    MEC) and the RLC microcontroller.  It's exposed to userspace for user mode
    drivers (OpenGL, Vulkan, OpenCL, etc.). More details in :ref:`Graphics (GFX)
    and Compute <amdgpu-gc>`.

VCN (Video Core Next)
    This is the multi-media engine.  It handles video and image encode and
    decode.  It's exposed to userspace for user mode drivers (VA-API,
    OpenMAX, etc.)

GFX·Compute·SDMA의 Pipe와 Queue

80-130

이 구간에서 block은 GFX, Compute와 SDMA를 뜻합니다. 세 IP는 Pipe와 Queue라는 공통 model로 동작을 설명할 수 있습니다. Queue는 반드시 Pipe에 연결되고 Pipe도 Queue와 연결됩니다. IP마다 개수가 다르며 GFX 11 front end 예시는 Pipe 2개와 Pipe당 Queue 2개를 가집니다.

pipe_and_queue_abstraction.svg의 topology
Hardware Block에 Pipe[0], Pipe[1] ... Pipe[n] 존재각 Pipe에 Queue[0] ... Queue[n] 연결Queue마다 hardware-side HQD 존재Memory에는 queue[0], queue[4] ... queue[n]의 MQD 저장MQD가 HQD Registers, Queue Address in the GPU, Doorbell, save area를 보관Firmware가 MQD와 HQD 사이에서 queue state를 load·saveActive Queue의 instruction을 Pipe가 EXECUTION 영역에서 처리

원본 SVG의 Hardware Block, Execution, Memory 영역을 구조화했습니다.

Pipe와 Queue의 핵심 규칙
구성요소정의동시성 규칙
PipeQueue instruction을 처리하는 hardware execution thread한 시점에 Queue 하나만 실행
QueueCommand와 work가 들어가는 scheduling 대상Mapped 상태여야 Pipe가 선택 가능
여러 Queue/PipeHardware가 queue swapping 지원Queue가 여러 개여도 Pipe별 active execution은 하나
IP별 resourcePipe 수와 Pipe당 Queue 수가 architecture마다 다름GFX 11 front end 예시는 2 Pipes × 2 Queues

Queue 수와 동시에 실행할 수 있는 Queue 수를 혼동하지 않아야 합니다.

Hardware queue switch trigger
순서Trigger의미
1Command StreamCommand 흐름에서 switch 지시
2Packet by PacketPacket 경계 기반 queue 선택
3Other hardware requestMES 같은 scheduling hardware·firmware의 변경 요청

Pipe는 mapped Queue 사이를 다음 입력으로 전환할 수 있습니다.

HQD와 MQD의 역할
Descriptor위치보관 정보역할
HQD, Hardware Queue DescriptorHardware register현재 Queue activation registerQueue 활성·비활성 상태로 Pipe execution 제어
MQD, Memory Queue DescriptorMemoryGPU virtual address, save area, doorbell, HQD register imageQueue state의 persistent save·restore
MES 등 scheduling firmwareFirmwareHQD와 MQD 사이의 state transferPreemption, unmap과 새 Queue activation

Hardware register 상태와 memory에 보존되는 queue state를 구분합니다.

Firmware queue switching 순서
Firmware가 현재 Queue preemption 또는 unmapping 요청WAIT FOR HQD_ACTIVE = 0현재 Queue state와 HQD registers를 MQD에 저장COPY NEW MQD STATE를 HQD registers로 복사필요한 additional state loadSET HQD_ACTIVE = 1Pipe가 새 active Queue의 work 실행

원본 SVG의 SWITCH QUEUE 절차와 HQD_ACTIVE bit transition을 그대로 보존했습니다.

.. _pipes-and-queues-description:

GFX, Compute, and SDMA Overall Behavior
=======================================

.. note:: For simplicity, whenever the term block is used in this section, it
   means GFX, Compute, and SDMA.

GFX, Compute and SDMA share a similar form of operation that can be abstracted
to facilitate understanding of the behavior of these blocks. See the figure
below illustrating the common components of these blocks:

.. kernel-figure:: pipe_and_queue_abstraction.svg

In the central part of this figure, you can see two hardware elements, one called
**Pipes** and another called **Queues**; it is important to highlight that Queues
must be associated with a Pipe and vice-versa. Every specific hardware IP may have
a different number of Pipes and, in turn, a different number of Queues; for
example, GFX 11 has two Pipes and two Queues per Pipe for the GFX front end.

Pipe is the hardware that processes the instructions available in the Queues;
in other words, it is a thread executing the operations inserted in the Queue.
One crucial characteristic of Pipes is that they can only execute one Queue at
a time; no matter if the hardware has multiple Queues in the Pipe, it only runs
one Queue per Pipe.

Pipes have the mechanics of swapping between queues at the hardware level.
Nonetheless, they only make use of Queues that are considered mapped. Pipes can
switch between queues based on any of the following inputs:

1. Command Stream;
2. Packet by Packet;
3. Other hardware requests the change (e.g., MES).

Queues within Pipes are defined by the Hardware Queue Descriptors (HQD).
Associated with the HQD concept, we have the Memory Queue Descriptor (MQD),
which is responsible for storing information about the state of each of the
available Queues in the memory. The state of a Queue contains information such
as the GPU virtual address of the queue itself, save areas, doorbell, etc. The
MQD also stores the HQD registers, which are vital for activating or
deactivating a given Queue.  The scheduling firmware (e.g., MES) is responsible
for loading HQDs from MQDs and vice versa.

The Queue-switching process can also happen with the firmware requesting the
preemption or unmapping of a Queue. The firmware waits for the HQD_ACTIVE bit
to change to low before saving the state into the MQD. To make a different
Queue become active, the firmware copies the MQD state into the HQD registers
and loads any additional state. Finally, it sets the HQD_ACTIVE bit to high to
indicate that the queue is active.  The Pipe will then execute work from active
Queues.

IP lifecycle, KIQ와 IB

131-152

Driver는 특정 SoC의 모든 IP 목록을 보유하고 `init`, `fini`, `suspend`, `resume` 같은 lifecycle operation에서 이 목록을 순회하며 각 IP callback을 처리합니다.

SoC IP lifecycle dispatch
ASIC과 SoC에 해당하는 IP block list 구성Initialization에서 list 순서대로 각 IP init callback 호출Suspend에서 각 IP의 runtime state 정리·보존Resume에서 dependency 순서에 맞춰 IP 복원Shutdown 또는 unload에서 fini callback 실행

Driver core가 공통 operation을 IP별 implementation에 전달하는 기본 pattern입니다.

KIQ와 IB
Construct정의사용 방식세대 차이
KIQ, Kernel Interface QueueKernel driver의 GFX/compute control queue다른 queue의 map·unmap 관리GFX 11 이상에서는 MES로 대체
IB, Indirect Buffer특정 engine용 command bufferQueue에 command 자체 대신 memory pointer 삽입Hardware가 memory command를 실행한 뒤 ring의 다음 command로 복귀

Queue control과 command 전달이라는 서로 다른 목적의 construct입니다.

Indirect Buffer 실행 경로
Driver 또는 userspace가 memory에 engine command 작성Queue 또는 ring에 IB memory pointer 기록Hardware가 pointer를 따라 IB command fetchIB 안의 command sequence 실행완료 후 원래 ring의 다음 command로 복귀

IB는 긴 command sequence를 ring에 직접 복사하지 않고 memory 참조로 실행합니다.

Driver Structure
================

In general, the driver has a list of all of the IPs on a particular
SoC and for things like init/fini/suspend/resume, more or less just
walks the list and handles each IP.

Some useful constructs:

KIQ (Kernel Interface Queue)
    This is a control queue used by the kernel driver to manage other gfx
    and compute queues on the GFX/compute engine.  You can use it to
    map/unmap additional queues, etc.  This is replaced by MES on
    GFX 11 and newer hardware.

IB (Indirect Buffer)
    A command buffer for a particular engine.  Rather than writing
    commands directly to the queue, you can write the commands into a
    piece of memory and then put a pointer to the memory into the queue.
    The hardware will then follow the pointer and execute the commands in
    the memory, then returning to the rest of the commands in the ring.

Memory·VM·IRQ·IP block API 문서

153-213

마지막 구간은 source code의 kernel-doc을 이 페이지에 결합합니다. `:doc:`은 이름이 지정된 설명 block을, `:internal:`은 해당 source의 internal kernel-doc을, `:identifiers:`는 지정 symbol만 포함합니다. Anchor `amdgpu_memory_domains`는 memory domain section으로 직접 연결됩니다.

Kernel-doc section과 source path
SectionSource pathDirective option
Memory Domainsinclude/uapi/drm/amdgpu_drm.h:doc: memory domains
Buffer Objectsdrivers/gpu/drm/amd/amdgpu/amdgpu_object.c:doc: amdgpu_object
Buffer Objectsdrivers/gpu/drm/amd/amdgpu/amdgpu_object.c:internal:
PRIME Buffer Sharingdrivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:doc: PRIME Buffer Sharing
PRIME Buffer Sharingdrivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:internal:
MMU Notifierdrivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c:doc: MMU Notifier
MMU Notifierdrivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c:internal:
AMDGPU Virtual Memorydrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:doc: GPUVM
AMDGPU Virtual Memorydrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:internal:
Interrupt Handlingdrivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:doc: Interrupt Handling
Interrupt Handlingdrivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:internal:
IP Blocksdrivers/gpu/drm/amd/include/amd_shared.h:doc: IP Blocks
IP Blocksdrivers/gpu/drm/amd/include/amd_shared.h:identifiers: amd_ip_block_type amd_ip_funcs DC_FEATURE_MASK DC_DEBUG_MASK

원문 directive 13개를 section별로 묶되 path와 option은 그대로 보존합니다.

API 탐색 순서
Allocation placement 문제 -> amdgpu_memory_domains anchor와 amdgpu_drm.hBuffer lifecycle 문제 -> amdgpu_object.cCross-driver sharing 문제 -> amdgpu_dma_buf.cCPU page invalidation 문제 -> amdgpu_hmm.cGPU virtual address 문제 -> amdgpu_vm.cInterrupt source와 dispatch 문제 -> amdgpu_irq.cIP lifecycle과 mask 문제 -> amd_shared.h

문제 유형에서 해당 kernel-doc source로 바로 이동하는 경로입니다.

IP Blocks에서 노출하는 identifier
Identifier역할 범주
amd_ip_block_typeIP block category enumeration
amd_ip_funcsIP lifecycle과 operation function table
DC_FEATURE_MASKDisplay Core feature mask
DC_DEBUG_MASKDisplay Core debug mask

마지막 directive가 전체 internal API 대신 선택적으로 포함하는 네 symbol입니다.

.. _amdgpu_memory_domains:

Memory Domains
==============

.. kernel-doc:: include/uapi/drm/amdgpu_drm.h
   :doc: memory domains

Buffer Objects
==============

.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
   :doc: amdgpu_object

.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
   :internal:

PRIME Buffer Sharing
====================

.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
   :doc: PRIME Buffer Sharing

.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
   :internal:

MMU Notifier
============

.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
   :doc: MMU Notifier

.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
   :internal:

AMDGPU Virtual Memory
=====================

.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
   :doc: GPUVM

.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
   :internal:

Interrupt Handling
==================

.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
   :doc: Interrupt Handling

.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
   :internal:

IP Blocks
=========

.. kernel-doc:: drivers/gpu/drm/amd/include/amd_shared.h
   :doc: IP Blocks

.. kernel-doc:: drivers/gpu/drm/amd/include/amd_shared.h
   :identifiers: amd_ip_block_type amd_ip_funcs DC_FEATURE_MASK DC_DEBUG_MASK