← Documents Documentation/gpu/amdgpu/display/dcn-overview.rst GitHub 원문 ↗

Linux 6.18.37 · GPU

Display Core Next (DCN)

DCN pipeline, data flow, pipe split와 global sync의 전문 번역입니다.

Source pathDocumentation/gpu/amdgpu/display/dcn-overview.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

dcn-overview.rst:1-232

DCN architecture, FE/BE 경계, pixel format 변화, hardware pipe split, global sync와 mailbox update를 하나의 흐름으로 설명합니다. 다섯 원본 SVG의 정보와 두 DTN log를 구조화해 source symbol 및 줄 좌표와 함께 보존했습니다.

DCN overview 핵심 경로
조사 주제핵심 block 또는 signal관련 source 구간
Surface fetch와 plane 처리DCHUB/HUBP, DPP, MPC1-128
Output timing과 linkOPP, OPTC, DIO85-128
Bandwidth와 pipe splitHUBP/DPP/MPCC resource, DML129-187
Atomic page flipVSTARTUP, VUPDATE, VREADY188-223
여러 configuration updateDouble buffer, UpdateLock, pending status224-232

문제 유형별로 먼저 확인할 section입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. _dcn_overview:
2
3 =======================
4 Display Core Next (DCN)
5 =======================
6
7 To equip our readers with the basic knowledge of how AMD Display Core Next
8 (DCN) works, we need to start with an overview of the hardware pipeline. Below
9 you can see a picture that provides a DCN overview, keep in mind that this is a
10 generic diagram, and we have variations per ASIC.
11
12 .. kernel-figure:: dc_pipeline_overview.svg
13
14 Based on this diagram, we can pass through each block and briefly describe
15 them:
16
17 * **Display Controller Hub (DCHUB)**: This is the gateway between the Scalable
18 Data Port (SDP) and DCN. This component has multiple features, such as memory
19 arbitration, rotation, and cursor manipulation.
20
21 * **Display Pipe and Plane (DPP)**: This block provides pre-blend pixel
22 processing such as color space conversion, linearization of pixel data, tone
23 mapping, and gamut mapping.
24
25 * **Multiple Pipe/Plane Combined (MPC)**: This component performs blending of
26 multiple planes, using global or per-pixel alpha.
27
28 * **Output Pixel Processing (OPP)**: Process and format pixels to be sent to
29 the display.
30
31 * **Output Pipe Timing Combiner (OPTC)**: It generates time output to combine
32 streams or divide capabilities. CRC values are generated in this block.
33
34 * **Display Output (DIO)**: Codify the output to the display connected to our
35 GPU.
36
37 * **Display Writeback (DWB)**: It provides the ability to write the output of
38 the display pipe back to memory as video frames.
39
40 * **Multi-Media HUB (MMHUBBUB)**: Memory controller interface for DMCUB and DWB
41 (Note that DWB is not hooked yet).
42
43 * **DCN Management Unit (DMU)**: It provides registers with access control and
44 interrupts the controller to the SOC host interrupt unit. This block includes
45 the Display Micro-Controller Unit - version B (DMCUB), which is handled via
46 firmware.
47
48 * **DCN Clock Generator Block (DCCG)**: It provides the clocks and resets
49 for all of the display controller clock domains.
50
51 * **Azalia (AZ)**: Audio engine.
52
53 The above diagram is an architecture generalization of DCN, which means that
54 every ASIC has variations around this base model. Notice that the display
55 pipeline is connected to the Scalable Data Port (SDP) via DCHUB; you can see
56 the SDP as the element from our Data Fabric that feeds the display pipe.
57
58 Always approach the DCN architecture as something flexible that can be
59 configured and reconfigured in multiple ways; in other words, each block can be
60 setup or ignored accordingly with userspace demands. For example, if we
61 want to drive an 8k@60Hz with a DSC enabled, our DCN may require 4 DPP and 2
62 OPP. It is DC's responsibility to drive the best configuration for each
63 specific scenario. Orchestrate all of these components together requires a
64 sophisticated communication interface which is highlighted in the diagram by
65 the edges that connect each block; from the chart, each connection between
66 these blocks represents:
67
68 1. Pixel data interface (red): Represents the pixel data flow;
69 2. Global sync signals (green): It is a set of synchronization signals composed
70 by VStartup, VUpdate, and VReady;
71 3. Config interface: Responsible to configure blocks;
72 4. Sideband signals: All other signals that do not fit the previous one.
73
74 These signals are essential and play an important role in DCN. Nevertheless,
75 the Global Sync deserves an extra level of detail described in the next
76 section.
77
78 All of these components are represented by a data structure named dc_state.
79 From DCHUB to MPC, we have a representation called dc_plane; from MPC to OPTC,
80 we have dc_stream, and the output (DIO) is handled by dc_link. Keep in mind
81 that HUBP accesses a surface using a specific format read from memory, and our
82 dc_plane should work to convert all pixels in the plane to something that can
83 be sent to the display via dc_stream and dc_link.
84
85 Front End and Back End
86 ----------------------
87
88 Display pipeline can be broken down into two components that are usually
89 referred as **Front End (FE)** and **Back End (BE)**, where FE consists of:
90
91 * DCHUB (Mainly referring to a subcomponent named HUBP)
92 * DPP
93 * MPC
94
95 On the other hand, BE consist of
96
97 * OPP
98 * OPTC
99 * DIO (DP/HDMI stream encoder and link encoder)
100
101 OPP and OPTC are two joining blocks between FE and BE. On a side note, this is
102 a one-to-one mapping of the link encoder to PHY, but we can configure the DCN
103 to choose which link encoder to connect to which PHY. FE's main responsibility
104 is to change, blend and compose pixel data, while BE's job is to frame a
105 generic pixel stream to a specific display's pixel stream.
106
107 Data Flow
108 ---------
109
110 Initially, data is passed in from VRAM through Data Fabric (DF) in native pixel
111 formats. Such data format stays through till HUBP in DCHUB, where HUBP unpacks
112 different pixel formats and outputs them to DPP in uniform streams through 4
113 channels (1 for alpha + 3 for colors).
114
115 The Converter and Cursor (CNVC) in DPP would then normalize the data
116 representation and convert them to a DCN specific floating-point format (i.e.,
117 different from the IEEE floating-point format). In the process, CNVC also
118 applies a degamma function to transform the data from non-linear to linear
119 space to relax the floating-point calculations following. Data would stay in
120 this floating-point format from DPP to OPP.
121
122 Starting OPP, because color transformation and blending have been completed
123 (i.e alpha can be dropped), and the end sinks do not require the precision and
124 dynamic range that floating points provide (i.e. all displays are in integer
125 depth format), bit-depth reduction/dithering would kick in. In OPP, we would
126 also apply a regamma function to introduce the gamma removed earlier back.
127 Eventually, we output data in integer format at DIO.
128
129 AMD Hardware Pipeline
130 ---------------------
131
132 When discussing graphics on Linux, the **pipeline** term can sometimes be
133 overloaded with multiple meanings, so it is important to define what we mean
134 when we say **pipeline**. In the DCN driver, we use the term **hardware
135 pipeline** or **pipeline** or just **pipe** as an abstraction to indicate a
136 sequence of DCN blocks instantiated to address some specific configuration. DC
137 core treats DCN blocks as individual resources, meaning we can build a pipeline
138 by taking resources for all individual hardware blocks to compose one pipeline.
139 In actuality, we can't connect an arbitrary block from one pipe to a block from
140 another pipe; they are routed linearly, except for DSC, which can be
141 arbitrarily assigned as needed. We have this pipeline concept for trying to
142 optimize bandwidth utilization.
143
144 .. kernel-figure:: pipeline_4k_no_split.svg
145
146 Additionally, let's take a look at parts of the DTN log (see
147 'Documentation/gpu/amdgpu/display/dc-debug.rst' for more information) since
148 this log can help us to see part of this pipeline behavior in real-time::
149
150 HUBP: format addr_hi width height ...
151 [ 0]: 8h 81h 3840 2160
152 [ 1]: 0h 0h 0 0
153 [ 2]: 0h 0h 0 0
154 [ 3]: 0h 0h 0 0
155 [ 4]: 0h 0h 0 0
156 ...
157 MPCC: OPP DPP ...
158 [ 0]: 0h 0h ...
159
160 The first thing to notice from the diagram and DTN log it is the fact that we
161 have different clock domains for each part of the DCN blocks. In this example,
162 we have just a single **pipeline** where the data flows from DCHUB to DIO, as
163 we intuitively expect. Nonetheless, DCN is flexible, as mentioned before, and
164 we can split this single pipe differently, as described in the below diagram:
165
166 .. kernel-figure:: pipeline_4k_split.svg
167
168 Now, if we inspect the DTN log again we can see some interesting changes::
169
170 HUBP: format addr_hi width height ...
171 [ 0]: 8h 81h 1920 2160 ...
172 ...
173 [ 4]: 0h 0h 0 0 ...
174 [ 5]: 8h 81h 1920 2160 ...
175 ...
176 MPCC: OPP DPP ...
177 [ 0]: 0h 0h ...
178 [ 5]: 0h 5h ...
179
180 From the above example, we now split the display pipeline into two vertical
181 parts of 1920x2160 (i.e., 3440x2160), and as a result, we could reduce the
182 clock frequency in the DPP part. This is not only useful for saving power but
183 also to better handle the required throughput. The idea to keep in mind here is
184 that the pipe configuration can vary a lot according to the display
185 configuration, and it is the DML's responsibility to set up all required
186 configuration parameters for multiple scenarios supported by our hardware.
187
188 Global Sync
189 -----------
190
191 Many DCN registers are double buffered, most importantly the surface address.
192 This allows us to update DCN hardware atomically for page flips, as well as
193 for most other updates that don't require enabling or disabling of new pipes.
194
195 (Note: There are many scenarios when DC will decide to reserve extra pipes
196 in order to support outputs that need a very high pixel clock, or for
197 power saving purposes.)
198
199 These atomic register updates are driven by global sync signals in DCN. In
200 order to understand how atomic updates interact with DCN hardware, and how DCN
201 signals page flip and vblank events it is helpful to understand how global sync
202 is programmed.
203
204 Global sync consists of three signals, VSTARTUP, VUPDATE, and VREADY. These are
205 calculated by the Display Mode Library - DML (drivers/gpu/drm/amd/display/dc/dml)
206 based on a large number of parameters and ensure our hardware is able to feed
207 the DCN pipeline without underflows or hangs in any given system configuration.
208 The global sync signals always happen during VBlank, are independent from the
209 VSync signal, and do not overlap each other.
210
211 VUPDATE is the only signal that is of interest to the rest of the driver stack
212 or userspace clients as it signals the point at which hardware latches to
213 atomically programmed (i.e. double buffered) registers. Even though it is
214 independent of the VSync signal we use VUPDATE to signal the VSync event as it
215 provides the best indication of how atomic commits and hardware interact.
216
217 Since DCN hardware is double-buffered the DC driver is able to program the
218 hardware at any point during the frame.
219
220 The below picture illustrates the global sync signals:
221
222 .. kernel-figure:: global_sync_vblank.svg
223
224 These signals affect core DCN behavior. Programming them incorrectly will lead
225 to a number of negative consequences, most of them quite catastrophic.
226
227 The following picture shows how global sync allows for a mailbox style of
228 updates, i.e. it allows for multiple re-configurations between VUpdate
229 events where only the last configuration programmed before the VUpdate signal
230 becomes effective.
231
232 .. kernel-figure:: config_example.svg
233

3. 한국어 전문 번역

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

DCN architecture와 block 관계

1-84

AMD Display Core Next(DCN)를 이해하려면 먼저 hardware pipeline의 큰 구조를 봐야 합니다. `dc_pipeline_overview.svg`는 공통 개념도이며, 실제 block 수와 연결은 ASIC마다 달라집니다. 따라서 이 그림은 고정 wiring diagram이 아니라 DC가 선택할 수 있는 resource와 interface의 기본 모델로 읽어야 합니다.

DCN 주요 block
Block위치 또는 연결역할
DCHUB / HUBPSDP와 DCN 사이memory arbitration, rotation, cursor manipulation과 pipe별 surface fetch
DPPHUBP 뒤, blend 전color-space conversion, linearization, tone mapping, gamut mapping
MPCDPP와 output path 사이global 또는 per-pixel alpha를 사용한 multiple-plane blending
OPPMPC 뒤display로 보낼 pixel의 output processing과 formatting
OPTCOPP와 DIO 사이stream 결합 또는 분할을 위한 output timing과 CRC 생성
DIOdisplay link 쪽GPU에 연결된 display용 output encoding
DWBdisplay pipe에서 memory 방향pipe output을 video frame으로 memory에 writeback
MMHUBBUBDMCUB와 DWB memory sideDMCUB 및 DWB의 memory-controller interface, 원문 시점에는 DWB가 연결되지 않음
DMU / DMCUBmanagement와 firmware 영역register access control, SOC host interrupt, DMCUB firmware 처리
DCCGdisplay clock domaindisplay controller clock과 reset 제공
AZaudio pathAzalia audio engine

원문 그림과 목록의 block 이름, 위치, 핵심 역할을 보존했습니다.

dc_pipeline_overview.svg의 pixel 경로
Data Fabric의 SDP가 DCHUB/HUBP에 surface data 공급DPP가 plane별 pre-blend pixel 처리MPC가 여러 pipe와 plane을 alpha blendingOPP가 합성 결과를 output 형식으로 처리OPTC가 timing과 stream 구성을 생성DIO가 link output을 encode해 monitor로 전송

DWB, DMU, DCCG, AZ는 보조 또는 별도 경로이며 실제 resource 수는 ASIC별로 다릅니다.

DCN은 userspace 요구에 맞춰 block을 사용하거나 생략하고 resource 수를 바꿉니다. 원문 예시의 8k@60Hz와 DSC 구성에서는 4개의 DPP와 2개의 OPP가 필요할 수 있으며, DC는 scenario마다 적합한 구성을 선택해야 합니다.

Block 사이의 네 interface
Interface원도식의미
Pixel data interfaceRedpixel data가 pipeline을 따라 이동하는 경로
Global sync signalsGreenVSTARTUP, VUPDATE, VREADY로 이루어진 동기화 신호
Config interfaceConfig. Bus각 hardware block의 register와 동작을 설정
Sideband signalsSideband signalpixel, global sync, config에 속하지 않는 기타 신호

원도식의 edge color와 신호 의미를 구조화했습니다.

DC software representation
Hardware 범위Structure의미
전체 구성dc_state현재 DCN component와 resource configuration의 집합
DCHUB에서 MPC까지dc_planememory format의 surface를 display 처리 형식으로 변환하는 plane 상태
MPC에서 OPTC까지dc_stream합성된 pixel stream과 timing/output 상태
DIO outputdc_linksink와 display link의 연결 및 제어 상태

hardware 구간과 핵심 data structure의 대응입니다.

HUBP는 memory에서 특정 format의 surface를 읽고, `dc_plane` 경로는 이 pixel들을 DPP와 MPC에서 처리해 `dc_stream` 및 `dc_link`를 통해 display로 보낼 수 있는 형태로 바꿉니다.

.. _dcn_overview:

=======================
Display Core Next (DCN)
=======================

To equip our readers with the basic knowledge of how AMD Display Core Next
(DCN) works, we need to start with an overview of the hardware pipeline. Below
you can see a picture that provides a DCN overview, keep in mind that this is a
generic diagram, and we have variations per ASIC.

.. kernel-figure:: dc_pipeline_overview.svg

Based on this diagram, we can pass through each block and briefly describe
them:

* **Display Controller Hub (DCHUB)**: This is the gateway between the Scalable
  Data Port (SDP) and DCN. This component has multiple features, such as memory
  arbitration, rotation, and cursor manipulation.

* **Display Pipe and Plane (DPP)**: This block provides pre-blend pixel
  processing such as color space conversion, linearization of pixel data, tone
  mapping, and gamut mapping.

* **Multiple Pipe/Plane Combined (MPC)**: This component performs blending of
  multiple planes, using global or per-pixel alpha.

* **Output Pixel Processing (OPP)**: Process and format pixels to be sent to
  the display.

* **Output Pipe Timing Combiner (OPTC)**: It generates time output to combine
  streams or divide capabilities. CRC values are generated in this block.

* **Display Output (DIO)**: Codify the output to the display connected to our
  GPU.

* **Display Writeback (DWB)**: It provides the ability to write the output of
  the display pipe back to memory as video frames.

* **Multi-Media HUB (MMHUBBUB)**: Memory controller interface for DMCUB and DWB
  (Note that DWB is not hooked yet).

* **DCN Management Unit (DMU)**: It provides registers with access control and
  interrupts the controller to the SOC host interrupt unit. This block includes
  the Display Micro-Controller Unit - version B (DMCUB), which is handled via
  firmware.

* **DCN Clock Generator Block (DCCG)**: It provides the clocks and resets
  for all of the display controller clock domains.

* **Azalia (AZ)**: Audio engine.

The above diagram is an architecture generalization of DCN, which means that
every ASIC has variations around this base model. Notice that the display
pipeline is connected to the Scalable Data Port (SDP) via DCHUB; you can see
the SDP as the element from our Data Fabric that feeds the display pipe.

Always approach the DCN architecture as something flexible that can be
configured and reconfigured in multiple ways; in other words, each block can be
setup or ignored accordingly with userspace demands. For example, if we
want to drive an 8k@60Hz with a DSC enabled, our DCN may require 4 DPP and 2
OPP. It is DC's responsibility to drive the best configuration for each
specific scenario. Orchestrate all of these components together requires a
sophisticated communication interface which is highlighted in the diagram by
the edges that connect each block; from the chart, each connection between
these blocks represents:

1. Pixel data interface (red): Represents the pixel data flow;
2. Global sync signals (green): It is a set of synchronization signals composed
   by VStartup, VUpdate, and VReady;
3. Config interface: Responsible to configure blocks;
4. Sideband signals: All other signals that do not fit the previous one.

These signals are essential and play an important role in DCN. Nevertheless,
the Global Sync deserves an extra level of detail described in the next
section.

All of these components are represented by a data structure named dc_state.
From DCHUB to MPC, we have a representation called dc_plane; from MPC to OPTC,
we have dc_stream, and the output (DIO) is handled by dc_link. Keep in mind
that HUBP accesses a surface using a specific format read from memory, and our
dc_plane should work to convert all pixels in the plane to something that can
be sent to the display via dc_stream and dc_link.

Front End와 Back End

85-106

Display pipeline은 보통 Front End(FE)와 Back End(BE)로 나눕니다. FE는 pixel data를 읽고 변환·합성하는 영역이며, BE는 generic pixel stream을 특정 display가 요구하는 timing과 link stream으로 framing하는 영역입니다.

FE와 BE의 책임
영역Block주요 책임
Front EndDCHUB(HUBP), DPP, MPCsurface fetch, pixel 변환, plane blending과 composition
Joining boundaryOPP, OPTC합성 결과의 output 처리와 timing 구성
Back EndOPP, OPTC, DIOgeneric stream을 DP/HDMI encoder와 link encoder 경로에 맞춤

OPP와 OPTC는 두 영역을 연결하는 joining block으로도 설명됩니다.

Link encoder와 PHY는 일대일로 mapping되지만, DCN configuration은 어느 link encoder를 어느 PHY에 연결할지 선택할 수 있습니다. 즉 resource의 수는 고정되어도 사용 pairing은 scenario에 따라 구성됩니다.

FE에서 PHY까지
FE가 plane pixel을 변환하고 합성OPP가 합성 후 output pixel을 처리OPTC가 display timing과 stream 구성을 생성DIO의 DP/HDMI stream encoder와 link encoder 사용선택된 link encoder를 대응 PHY에 연결

실제 encoder 종류와 PHY 선택은 ASIC 및 connector configuration을 따릅니다.

Front End and Back End
----------------------

Display pipeline can be broken down into two components that are usually
referred as **Front End (FE)** and **Back End (BE)**, where FE consists of:

* DCHUB (Mainly referring to a subcomponent named HUBP)
* DPP
* MPC

On the other hand, BE consist of

* OPP
* OPTC
* DIO (DP/HDMI stream encoder and link encoder)

OPP and OPTC are two joining blocks between FE and BE. On a side note, this is
a one-to-one mapping of the link encoder to PHY, but we can configure the DCN
to choose which link encoder to connect to which PHY. FE's main responsibility
is to change, blend and compose pixel data, while BE's job is to frame a
generic pixel stream to a specific display's pixel stream.

Pixel data 표현의 변화

107-128

VRAM의 data는 Data Fabric(DF)을 통해 native pixel format으로 들어옵니다. 이 format은 DCHUB의 HUBP까지 유지되며, HUBP가 format을 unpack한 뒤 alpha 한 채널과 color 세 채널의 균일한 네 채널 stream으로 DPP에 전달합니다.

DPP의 Converter and Cursor(CNVC)는 표현을 정규화하고 IEEE floating-point와 다른 DCN 전용 floating-point format으로 변환합니다. CNVC는 degamma를 적용해 non-linear space를 linear space로 바꾸므로 뒤의 floating-point color 계산을 단순화할 수 있습니다. 이 floating-point 표현은 DPP부터 OPP까지 유지됩니다.

OPP에 도달하면 color transformation과 blending이 끝났으므로 alpha를 버릴 수 있습니다. Display sink는 integer bit-depth format을 사용하므로 OPP에서 bit-depth reduction과 dithering을 적용하고, 앞에서 제거한 gamma를 regamma로 다시 넣습니다. 최종적으로 DIO는 integer format을 출력합니다.

VRAM에서 DIO까지 data representation
VRAM: native pixel formatData Fabric -> DCHUB/HUBP: native format 유지HUBP: format unpack, alpha 1 + color 3의 4-channel streamDPP CNVC: normalize, DCN-specific float 변환, degammaDPP -> MPC -> OPP: floating-point representation 유지OPP: alpha 제거, regamma, bit-depth reduction과 ditheringDIO: display용 integer format output

원문의 format 변화와 처리 위치를 순서대로 나타냅니다.

주요 format 경계
경계표현처리
VRAM -> HUBPNative surface formattiling과 pixel format에 맞춰 memory에서 fetch
HUBP -> DPPUniform 4 channelsalpha 1 channel과 color 3 channels
DPP -> OPPDCN-specific floating pointlinear-space color calculation과 blending
OPP -> DIOInteger depthregamma, bit-depth reduction, dithering 후 output

Format 자체와 color-space 처리 단계를 혼동하지 않도록 나눈 표입니다.

Data Flow
---------

Initially, data is passed in from VRAM through Data Fabric (DF) in native pixel
formats. Such data format stays through till HUBP in DCHUB, where HUBP unpacks
different pixel formats and outputs them to DPP in uniform streams through 4
channels (1 for alpha + 3 for colors).

The Converter and Cursor (CNVC) in DPP would then normalize the data
representation and convert them to a DCN specific floating-point format (i.e.,
different from the IEEE floating-point format). In the process, CNVC also
applies a degamma function to transform the data from non-linear to linear
space to relax the floating-point calculations following. Data would stay in
this floating-point format from DPP to OPP.

Starting OPP, because color transformation and blending have been completed
(i.e alpha can be dropped), and the end sinks do not require the precision and
dynamic range that floating points provide (i.e. all displays are in integer
depth format), bit-depth reduction/dithering would kick in. In OPP, we would
also apply a regamma function to introduce the gamma removed earlier back.
Eventually, we output data in integer format at DIO.

Hardware pipeline, pipe split과 DTN log

129-187

Linux graphics에서 pipeline은 여러 의미로 쓰이므로 DCN driver의 정의를 분명히 해야 합니다. DC core에서 hardware pipeline, pipeline, pipe는 특정 configuration을 위해 배치한 DCN block sequence를 뜻합니다. 각 block은 개별 resource이지만 임의의 pipe 사이를 자유롭게 교차 연결할 수 있는 것은 아니며, 일반 경로는 선형으로 routing됩니다. DSC는 필요에 따라 배정할 수 있는 예외입니다.

Pipe abstraction은 bandwidth 사용을 최적화하기 위해 존재합니다. `pipeline_4k_no_split.svg` 예시는 HUBP(0), DPP(0), MPC(0), OPP(0)를 사용하는 단일 4K pipeline이며 DPPCLK 535.916 MHz, DISPCLK 541.275 MHz, DCFCLK 506 MHz를 표시합니다.

4K no-split pipeline
SDP -> DCHUB -> HUBP(0), width 3840 x height 2160HUBP(0) -> DPP(0), DPPCLK 535.916 MHzDPP(0) -> MPC(0) -> OPP(0)OPP(0) -> OPTC, VirtualPCLK와 DISPCLK domainOPTC -> DIO, SymCLK를 사용해 link output

pipeline_4k_no_split.svg와 첫 DTN log의 active resource를 대응시켰습니다.

 HUBP:  format  addr_hi  width  height ...
 [ 0]:      8h      81h   3840    2160
 [ 1]:      0h       0h      0       0
 [ 2]:      0h       0h      0       0
 [ 3]:      0h       0h      0       0
 [ 4]:      0h       0h      0       0
 ...
 MPCC:  OPP  DPP ...
 [ 0]:   0h   0h ...
No-split DTN log
Log 영역Entry관찰
HUBP[0]format 8h, addr_hi 81h, 3840 x 2160 surface
HUBP[1]...[4]width와 height가 0인 비활성 entry
MPCC[0]OPP 0h와 DPP 0h를 연결한 단일 합성 경로

활성 entry와 비활성 entry를 구분합니다.

DCN은 같은 display를 여러 pipe로 나눌 수 있습니다. `pipeline_4k_split.svg`에서는 HUBP/DPP/MPC 0번과 5번이 각각 폭 1920을 처리하고 OPP(0) 쪽으로 결합됩니다. DPPCLK는 267.958 MHz로 낮아져 no-split의 절반 수준이지만 DISPCLK 541.275 MHz와 DCFCLK 506 MHz는 그림에서 그대로입니다.

4K vertical pipe split
HUBP(0)와 HUBP(5)가 같은 surface address의 서로 다른 1920 x 2160 영역 fetchDPP(0)와 DPP(5)가 각 half를 DPPCLK 267.958 MHz로 처리MPC(0)와 MPC(5)가 두 처리 결과를 OPP(0) 경로에 결합OPTC와 DIO가 하나의 4K display stream으로 출력

두 half-pipe가 같은 output stream에 합쳐지는 관계입니다.

 HUBP:  format  addr_hi  width  height ...
 [ 0]:      8h      81h   1920    2160 ...
 ...
 [ 4]:      0h       0h      0       0 ...
 [ 5]:      8h      81h   1920    2160 ...
 ...
 MPCC:  OPP  DPP ...
 [ 0]:   0h   0h ...
 [ 5]:   0h   5h ...
Split DTN log
Log 영역Entry관찰
HUBP[0]format 8h, addr_hi 81h, 1920 x 2160
HUBP[5]같은 format/address, 1920 x 2160
MPCC[0]OPP 0h, DPP 0h
MPCC[5]OPP 0h, DPP 5h

Pipe 0과 pipe 5가 함께 활성화된 상태입니다.

No-split과 split 비교
항목No splitVertical split
활성 HUBP/DPP0번 한 쌍0번과 5번 두 쌍
각 HUBP width38401920 + 1920
DPPCLK535.916 MHz267.958 MHz
목적단일 linear pipepower 절감과 throughput 분산

DML은 display configuration과 hardware scenario에 맞춰 이런 parameter를 계산합니다.

원문 180-182줄은 두 개의 `1920x2160` 부분을 설명하면서 괄호에 `3440x2160`이라고 적습니다. 그러나 DTN log와 앞의 3840-wide 예시를 기준으로 합계는 `3840x2160`입니다. 한국어 해설은 이 산술 불일치를 바로잡아 읽되, 영어 원문과 줄 좌표는 변경하지 않습니다.

AMD Hardware Pipeline
---------------------

When discussing graphics on Linux, the **pipeline** term can sometimes be
overloaded with multiple meanings, so it is important to define what we mean
when we say **pipeline**. In the DCN driver, we use the term **hardware
pipeline** or **pipeline** or just **pipe** as an abstraction to indicate a
sequence of DCN blocks instantiated to address some specific configuration. DC
core treats DCN blocks as individual resources, meaning we can build a pipeline
by taking resources for all individual hardware blocks to compose one pipeline.
In actuality, we can't connect an arbitrary block from one pipe to a block from
another pipe; they are routed linearly, except for DSC, which can be
arbitrarily assigned as needed. We have this pipeline concept for trying to
optimize bandwidth utilization.

.. kernel-figure:: pipeline_4k_no_split.svg

Additionally, let's take a look at parts of the DTN log (see
'Documentation/gpu/amdgpu/display/dc-debug.rst' for more information) since
this log can help us to see part of this pipeline behavior in real-time::

 HUBP:  format  addr_hi  width  height ...
 [ 0]:      8h      81h   3840    2160
 [ 1]:      0h       0h      0       0
 [ 2]:      0h       0h      0       0
 [ 3]:      0h       0h      0       0
 [ 4]:      0h       0h      0       0
 ...
 MPCC:  OPP  DPP ...
 [ 0]:   0h   0h ...

The first thing to notice from the diagram and DTN log it is the fact that we
have different clock domains for each part of the DCN blocks. In this example,
we have just a single **pipeline** where the data flows from DCHUB to DIO, as
we intuitively expect. Nonetheless, DCN is flexible, as mentioned before, and
we can split this single pipe differently, as described in the below diagram:

.. kernel-figure:: pipeline_4k_split.svg

Now, if we inspect the DTN log again we can see some interesting changes::

 HUBP:  format  addr_hi  width  height ...
 [ 0]:      8h      81h   1920    2160 ...
 ...
 [ 4]:      0h       0h      0       0 ...
 [ 5]:      8h      81h   1920    2160 ...
 ...
 MPCC:  OPP  DPP ...
 [ 0]:   0h   0h ...
 [ 5]:   0h   5h ...

From the above example, we now split the display pipeline into two vertical
parts of 1920x2160 (i.e., 3440x2160), and as a result, we could reduce the
clock frequency in the DPP part. This is not only useful for saving power but
also to better handle the required throughput. The idea to keep in mind here is
that the pipe configuration can vary a lot according to the display
configuration, and it is the DML's responsibility to set up all required
configuration parameters for multiple scenarios supported by our hardware.

Global Sync와 atomic register update

188-223

DCN register는 다수가 double-buffered이며 surface address가 대표적입니다. 이 구조 덕분에 새 pipe를 enable 또는 disable하지 않는 page flip과 대부분의 update를 atomic하게 적용할 수 있습니다. 높은 pixel clock 또는 power 절감을 위해 DC가 extra pipe를 미리 reserve하는 scenario도 있습니다.

Atomic update는 global sync signal로 구동됩니다. VSTARTUP, VUPDATE, VREADY는 Display Mode Library(DML)의 `drivers/gpu/drm/amd/display/dc/dml`이 system configuration과 bandwidth 관련 parameter를 바탕으로 계산합니다. 세 signal은 VBlank 안에서 발생하고 VSync와 독립적이며 서로 겹치지 않습니다.

Global sync 세 신호
Signal역할관계
VSTARTUP새 frame 처리와 pipeline startup timing의 기준VStartup period와 VSTARTUP_START로 배치
VUPDATEdouble-buffered register가 hardware에 latch되는 atomic 적용점VUpdateOffset과 VUpdateWidth로 위치와 폭 결정
VREADYpipeline이 update를 받을 준비가 되는 timing 조건VReadyOffset으로 배치

global_sync_vblank.svg의 label과 driver 관점의 의미입니다.

VBlank 안의 global sync timing
VSYNC를 포함하는 VBlank interval 시작DML이 계산한 offset에 따라 VSTARTUP 발생VUPDATE에서 마지막 programmed double buffer를 hardware가 latchVREADY가 정의된 준비 timing을 표시Underflow와 hang 없이 다음 active frame을 공급

세 pulse는 VSync와 별개로 계산되며 서로 overlap하지 않습니다.

Driver stack과 userspace client가 직접 관심을 갖는 신호는 VUPDATE입니다. Hardware가 atomic하게 program된 register를 latch하는 지점이기 때문입니다. VUPDATE는 VSync와 독립적이지만 atomic commit과 hardware 적용의 관계를 가장 잘 나타내므로 driver는 이를 VSync event 신호로 사용합니다.

Double-buffered atomic update
현재 active register buffer로 frame scanoutDriver가 inactive buffer에 surface address와 update 값 기록VUPDATE 전까지 active hardware state는 유지VUPDATE에서 inactive buffer의 마지막 완성 configuration을 atomic latch다음 scanout은 새 hardware state 사용

DC driver는 frame 중 어느 시점에도 inactive buffer를 program할 수 있습니다.

Global Sync
-----------

Many DCN registers are double buffered, most importantly the surface address.
This allows us to update DCN hardware atomically for page flips, as well as
for most other updates that don't require enabling or disabling of new pipes.

(Note: There are many scenarios when DC will decide to reserve extra pipes
in order to support outputs that need a very high pixel clock, or for
power saving purposes.)

These atomic register updates are driven by global sync signals in DCN. In
order to understand how atomic updates interact with DCN hardware, and how DCN
signals page flip and vblank events it is helpful to understand how global sync
is programmed.

Global sync consists of three signals, VSTARTUP, VUPDATE, and VREADY. These are
calculated by the Display Mode Library - DML (drivers/gpu/drm/amd/display/dc/dml)
based on a large number of parameters and ensure our hardware is able to feed
the DCN pipeline without underflows or hangs in any given system configuration.
The global sync signals always happen during VBlank, are independent from the
VSync signal, and do not overlap each other.

VUPDATE is the only signal that is of interest to the rest of the driver stack
or userspace clients as it signals the point at which hardware latches to
atomically programmed (i.e. double buffered) registers. Even though it is
independent of the VSync signal we use VUPDATE to signal the VSync event as it
provides the best indication of how atomic commits and hardware interact.

Since DCN hardware is double-buffered the DC driver is able to program the
hardware at any point during the frame.

The below picture illustrates the global sync signals:

.. kernel-figure:: global_sync_vblank.svg

Mailbox 방식 configuration 적용

224-232

Global sync를 잘못 program하면 underflow, hang, 잘못된 page flip timing처럼 핵심 DCN 동작에 심각한 결과가 생길 수 있습니다. `config_example.svg`는 VUPDATE 사이에 여러 configuration을 program할 수 있지만 다음 VUPDATE에서 유효해지는 것은 마지막 configuration뿐인 mailbox 동작을 보여 줍니다.

config_example.svg의 A, B, C update
Old config가 active buffer에서 동작Driver가 VUPDATE 사이에 configuration A program같은 interval에서 B, 이어서 C로 inactive buffer 갱신Register updatePending Status는 적용 대기 상태를 나타냄다음 VUPDATE에서 마지막 configuration C만 effectiveBuf 0과 Buf 1의 active/inactive 역할이 교대

UpdateLock과 pending 상태를 거쳐 마지막 값만 다음 latch point에서 적용됩니다.

Mailbox update의 의미
상태Software 관찰Hardware 결과
VUPDATE 이전A, B, C를 차례로 program 가능Old config 계속 사용
마지막 pending valueC가 inactive buffer에 남음아직 output에는 미적용
VUPDATEAtomic latch eventC가 한 번에 effective
잘못된 sync parameterLatch timing과 scanout 준비 불일치Underflow, hang 또는 심각한 display failure 가능

여러 write와 실제 hardware 적용을 구분합니다.

These signals affect core DCN behavior. Programming them incorrectly will lead
to a number of negative consequences, most of them quite catastrophic.

The following picture shows how global sync allows for a mailbox style of
updates, i.e. it allows for multiple re-configurations between VUpdate
events where only the last configuration programmed before the VUpdate signal
becomes effective.

.. kernel-figure:: config_example.svg