← Documents Documentation/sound/hd-audio/dp-mst.rst GitHub 원문 ↗

Linux 6.18.37 · Sound

HD-Audio DP-MST 지원

HD-Audio HDMI codec의 DP MST audio에서 virtual pin, device entry, dynamic PCM assignment, jack object와 acomp/unsolicited hotplug event 경로를 설명합니다.

Source pathDocumentation/sound/hd-audio/dp-mst.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

dp-mst.rst:1-101

HD-Audio HDMI codec의 DP MST audio에서 virtual pin, device entry, dynamic PCM assignment, jack object와 acomp/unsolicited hotplug event 경로를 설명합니다.

핵심은 여러 virtual pin에 PCM을 하나씩 고정 생성하지 않고 작은 PCM pool을 hotplug 시점에 동적으로 연결하는 것입니다. `acomp` 여부는 event source를, `dyn_pcm_assign` 여부는 jack object와 PCM pointer 배정 시점을 결정합니다.

핵심 분기
조건결정하는 항목
spec->dyn_pcm_assignPCM assignment 시점과 snd_jack/hda_jack 사용 방식
acompComponent notification 또는 unsolicited event 경로
DP MST hub 연결Intel device entry 수 3 또는 1

두 flag가 맡는 역할을 빠르게 구분합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 =======================
2 HD-Audio DP-MST Support
3 =======================
4
5 To support DP MST audio, HD Audio hdmi codec driver introduces virtual pin
6 and dynamic pcm assignment.
7
8 Virtual pin is an extension of per_pin. The most difference of DP MST
9 from legacy is that DP MST introduces device entry. Each pin can contain
10 several device entries. Each device entry behaves as a pin.
11
12 As each pin may contain several device entries and each codec may contain
13 several pins, if we use one pcm per per_pin, there will be many PCMs.
14 The new solution is to create a few PCMs and to dynamically bind pcm to
15 per_pin. Driver uses spec->dyn_pcm_assign flag to indicate whether to use
16 the new solution.
17
18 PCM
19 ===
20 To be added
21
22 Pin Initialization
23 ==================
24 Each pin may have several device entries (virtual pins). On Intel platform,
25 the device entries number is dynamically changed. If DP MST hub is connected,
26 it is in DP MST mode, and the device entries number is 3. Otherwise, the
27 device entries number is 1.
28
29 To simplify the implementation, all the device entries will be initialized
30 when bootup no matter whether it is in DP MST mode or not.
31
32 Connection list
33 ===============
34 DP MST reuses connection list code. The code can be reused because
35 device entries on the same pin have the same connection list.
36
37 This means DP MST gets the device entry connection list without the
38 device entry setting.
39
40 Jack
41 ====
42
43 Presume:
44 - MST must be dyn_pcm_assign, and it is acomp (for Intel scenario);
45 - NON-MST may or may not be dyn_pcm_assign, it can be acomp or !acomp;
46
47 So there are the following scenarios:
48 a. MST (&& dyn_pcm_assign && acomp)
49 b. NON-MST && dyn_pcm_assign && acomp
50 c. NON-MST && !dyn_pcm_assign && !acomp
51
52 Below discussion will ignore MST and NON-MST difference as it doesn't
53 impact on jack handling too much.
54
55 Driver uses struct hdmi_pcm pcm[] array in hdmi_spec and snd_jack is
56 a member of hdmi_pcm. Each pin has one struct hdmi_pcm * pcm pointer.
57
58 For !dyn_pcm_assign, per_pin->pcm will assigned to spec->pcm[n] statically.
59
60 For dyn_pcm_assign, per_pin->pcm will assigned to spec->pcm[n]
61 when monitor is hotplugged.
62
63
64 Build Jack
65 ----------
66
67 - dyn_pcm_assign
68
69 Will not use hda_jack but use snd_jack in spec->pcm_rec[pcm_idx].jack directly.
70
71 - !dyn_pcm_assign
72
73 Use hda_jack and assign spec->pcm_rec[pcm_idx].jack = jack->jack statically.
74
75
76 Unsolicited Event Enabling
77 --------------------------
78 Enable unsolicited event if !acomp.
79
80
81 Monitor Hotplug Event Handling
82 ------------------------------
83 - acomp
84
85 pin_eld_notify() -> check_presence_and_report() -> hdmi_present_sense() ->
86 sync_eld_via_acomp().
87
88 Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for
89 both dyn_pcm_assign and !dyn_pcm_assign
90
91 - !acomp
92
93 hdmi_unsol_event() -> hdmi_intrinsic_event() -> check_presence_and_report() ->
94 hdmi_present_sense() -> hdmi_prepsent_sense_via_verbs()
95
96 Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for dyn_pcm_assign.
97 Use hda_jack mechanism to handle jack events.
98
99
100 Others to be added later
101 ========================
102

3. 한국어 전문 번역

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

Virtual pin과 dynamic PCM assignment

1-17

`Documentation/sound/hd-audio/dp-mst.rst`는 HD Audio HDMI codec driver가 DP MST audio를 지원하기 위해 도입한 virtual pin과 dynamic PCM assignment를 설명합니다.

Virtual pin은 `per_pin`의 확장입니다. Legacy DisplayPort와 가장 큰 차이는 DP MST가 device entry를 도입한다는 점입니다. Pin 하나가 여러 device entry를 가질 수 있고, 각 device entry는 pin 하나처럼 동작합니다.

각 pin이 여러 device entry를 가질 수 있고 codec도 여러 pin을 가질 수 있으므로 `per_pin`마다 PCM 하나를 만들면 PCM 수가 지나치게 많아집니다. 새 방식은 PCM 몇 개만 만든 뒤 PCM을 `per_pin`에 동적으로 bind합니다. Driver는 `spec->dyn_pcm_assign` flag로 이 방식을 사용할지 표시합니다.

DP MST audio object 관계
HD Audio HDMI codec여러 physical pinPin마다 여러 device entry(virtual pin)소수의 PCM pool 생성Hotplug 상황에 맞춰 PCM을 per_pin에 동적 bind

Device entry가 virtual pin처럼 동작하고 소수 PCM을 필요할 때 연결합니다.

Legacy와 DP MST 비교
항목LegacyDP MST
Pin 모델Pin당 하나의 endpointPin 안에 여러 device entry
Device entry없음각 entry가 virtual pin처럼 동작
PCM 배정per_pin별 고정 PCM 가능소수 PCM을 per_pin에 동적으로 bind
선택 flag고정 방식spec->dyn_pcm_assign

PCM 수가 폭증하지 않도록 object와 assignment 모델을 바꿉니다.

=======================
HD-Audio DP-MST Support
=======================

To support DP MST audio, HD Audio hdmi codec driver introduces virtual pin
and dynamic pcm assignment.

Virtual pin is an extension of per_pin. The most difference of DP MST
from legacy is that DP MST introduces device entry. Each pin can contain
several device entries. Each device entry behaves as a pin.

As each pin may contain several device entries and each codec may contain
several pins, if we use one pcm per per_pin, there will be many PCMs.
The new solution is to create a few PCMs and to dynamically bind pcm to
per_pin. Driver uses spec->dyn_pcm_assign flag to indicate whether to use
the new solution.

PCM 미완성 절과 pin 초기화

18-31

원문의 `PCM` 절은 아직 `To be added` 상태로 남아 있어 추가 설명이 없습니다. 이 상태를 그대로 보존합니다.

Pin 하나에는 여러 device entry, 즉 virtual pin이 있을 수 있습니다. Intel platform에서는 device entry 수가 동적으로 바뀝니다. DP MST hub가 연결되어 DP MST mode가 되면 entry 수는 3이고, 그렇지 않으면 1입니다.

구현을 단순화하기 위해 boot 시점에는 실제 DP MST mode 여부와 관계없이 모든 device entry를 초기화합니다.

Intel device entry 수
상태Device entry 수의미
DP MST hub 연결3DP MST mode에서 세 virtual pin endpoint 사용
DP MST hub 미연결1일반 단일-stream endpoint

Hub 연결 상태에 따른 logical endpoint 수입니다.

Boot 초기화 정책
Codec bootDP MST mode 여부와 무관하게 진행가능한 모든 device entry 초기화Runtime 연결 상태에 따라 실제 entry 수 사용

Runtime mode 분기를 줄이기 위해 모든 entry를 미리 준비합니다.

PCM
===
To be added

Pin Initialization
==================
Each pin may have several device entries (virtual pins). On Intel platform,
the device entries number is dynamically changed. If DP MST hub is connected,
it is in DP MST mode, and the device entries number is 3. Otherwise, the
device entries number is 1.

To simplify the implementation, all the device entries will be initialized
when bootup no matter whether it is in DP MST mode or not.

Connection list 재사용

32-39

DP MST는 기존 connection list code를 재사용합니다. 같은 pin에 속한 device entry는 동일한 connection list를 가지므로 code를 공유할 수 있습니다.

따라서 DP MST가 device entry의 connection list를 가져올 때 별도의 device entry setting을 하지 않아도 됩니다.

Connection list 조회
Physical pin 선택해당 pin의 공통 connection list 확인Device entry별 별도 setting 생략각 virtual pin이 같은 connection list 사용

동일 pin의 공통 list를 그대로 사용합니다.

재사용 근거
범위Connection list설정
같은 pin의 device entries동일공통 code 재사용
개별 device entryPin list를 참조별도 device entry setting 없음

Per-device 중복 설정이 필요 없는 이유입니다.

Connection list
===============
DP MST reuses connection list code. The code can be reused because
device entries on the same pin have the same connection list.

This means DP MST gets the device entry connection list without the
device entry setting.

Jack 시나리오와 PCM pointer

40-63

문서는 Intel 시나리오를 기준으로 MST는 반드시 `dyn_pcm_assign`와 `acomp`를 사용한다고 가정합니다. NON-MST는 `dyn_pcm_assign` 사용 여부가 모두 가능하고 `acomp` 또는 `!acomp`일 수 있습니다.

검토하는 조합은 세 가지입니다. a는 `MST && dyn_pcm_assign && acomp`, b는 `NON-MST && dyn_pcm_assign && acomp`, c는 `NON-MST && !dyn_pcm_assign && !acomp`입니다. 이후 jack 처리에서는 MST/NON-MST 차이가 크지 않아 이를 따로 구분하지 않습니다.

Jack 처리 시나리오
시나리오MSTdyn_pcm_assignacomp
a
b아니요
c아니요아니요아니요

원문이 전제로 삼은 세 조합입니다.

Driver는 `hdmi_spec` 안의 `struct hdmi_pcm pcm[]` array를 사용하며 `snd_jack`은 `hdmi_pcm`의 member입니다. 각 pin은 `struct hdmi_pcm *pcm` pointer 하나를 가집니다.

`!dyn_pcm_assign`에서는 `per_pin->pcm`을 `spec->pcm[n]`에 정적으로 배정합니다. `dyn_pcm_assign`에서는 monitor가 hotplug될 때 `per_pin->pcm`을 `spec->pcm[n]`에 배정합니다.

PCM pointer assignment
per_pin에 hdmi_pcm pointer 필요dyn_pcm_assign 확인False: spec->pcm[n]을 정적으로 지정True: monitor hotplug 대기Hotplug 시 사용 가능한 spec->pcm[n] 지정

Flag에 따라 boot/static 경로와 hotplug/dynamic 경로가 갈립니다.

PCM assignment 비교
ModeAssignment 시점Target
!dyn_pcm_assign정적 초기화per_pin->pcm = spec->pcm[n]
dyn_pcm_assignMonitor hotplugper_pin->pcm = spec->pcm[n]

같은 pointer를 언제 연결하는지가 다릅니다.

Jack
====

Presume:
 - MST must be dyn_pcm_assign, and it is acomp (for Intel scenario);
 - NON-MST may or may not be dyn_pcm_assign, it can be acomp or !acomp;

So there are the following scenarios:
 a. MST (&& dyn_pcm_assign && acomp)
 b. NON-MST && dyn_pcm_assign && acomp
 c. NON-MST && !dyn_pcm_assign && !acomp

Below discussion will ignore MST and NON-MST difference as it doesn't
impact on jack handling too much.

Driver uses struct hdmi_pcm pcm[] array in hdmi_spec and snd_jack is
a member of hdmi_pcm. Each pin has one struct hdmi_pcm * pcm pointer.

For !dyn_pcm_assign, per_pin->pcm will assigned to spec->pcm[n] statically.

For dyn_pcm_assign, per_pin->pcm will assigned to spec->pcm[n]
when monitor is hotplugged.

Jack 생성과 unsolicited event

64-80

`dyn_pcm_assign`에서는 `hda_jack`을 사용하지 않고 `spec->pcm_rec[pcm_idx].jack`의 `snd_jack`을 직접 사용합니다.

`!dyn_pcm_assign`에서는 `hda_jack`을 사용하고 `spec->pcm_rec[pcm_idx].jack = jack->jack`을 정적으로 배정합니다.

Build Jack 방식
ModeJack mechanismAssignment
dyn_pcm_assignsnd_jack 직접 사용spec->pcm_rec[pcm_idx].jack
!dyn_pcm_assignhda_jack 사용spec->pcm_rec[pcm_idx].jack = jack->jack

Dynamic assignment 여부에 따라 jack object 경로가 달라집니다.

Unsolicited event는 `!acomp`일 때 enable합니다. `acomp` 경로는 component notification을 사용하므로 HDA unsolicited event를 별도로 켜는 경로와 구분됩니다.

Event source 선택
acomp 확인acomp: component notification 경로 사용!acomp: unsolicited event enable각 경로에서 presence와 ELD 갱신

acomp 사용 여부가 hotplug notification source를 결정합니다.

Build Jack
----------

- dyn_pcm_assign

  Will not use hda_jack but use snd_jack in spec->pcm_rec[pcm_idx].jack directly.

- !dyn_pcm_assign

  Use hda_jack and assign spec->pcm_rec[pcm_idx].jack = jack->jack statically.


Unsolicited Event Enabling
--------------------------
Enable unsolicited event if !acomp.

Monitor hotplug event 처리

81-101

`acomp` 경로의 호출 순서는 `pin_eld_notify()` → `check_presence_and_report()` → `hdmi_present_sense()` → `sync_eld_via_acomp()`입니다.

acomp hotplug 호출 경로
pin_eld_notify()check_presence_and_report()hdmi_present_sense()sync_eld_via_acomp()snd_jack_report(spec->pcm_rec[pcm_idx].jack)

Component notification에서 ELD를 동기화하고 jack 상태를 보고합니다.

`acomp`에서는 `dyn_pcm_assign`와 `!dyn_pcm_assign` 모두 `spec->pcm_rec[pcm_idx].jack`에 `snd_jack_report()`를 직접 사용합니다.

`!acomp` 경로의 호출 순서는 `hdmi_unsol_event()` → `hdmi_intrinsic_event()` → `check_presence_and_report()` → `hdmi_present_sense()` → `hdmi_prepsent_sense_via_verbs()`입니다. 마지막 symbol의 `prepsent` 철자는 Linux v6.18.37 원문을 그대로 보존한 것입니다.

!acomp hotplug 호출 경로
hdmi_unsol_event()hdmi_intrinsic_event()check_presence_and_report()hdmi_present_sense()hdmi_prepsent_sense_via_verbs()

HDA unsolicited event와 verb 기반 presence sense를 사용합니다.

`!acomp && dyn_pcm_assign`에서는 `spec->pcm_rec[pcm_idx].jack`에 `snd_jack_report()`를 직접 사용합니다. `!acomp && !dyn_pcm_assign`에서는 `hda_jack` mechanism으로 jack event를 처리합니다.

Hotplug report mechanism
acompdyn_pcm_assign최종 보고
snd_jack_report() 직접 호출
아니요snd_jack_report() 직접 호출
아니요snd_jack_report() 직접 호출
아니요아니요hda_jack mechanism

acomp와 dynamic assignment 조합별 최종 jack 보고 방식입니다.

마지막 `Others to be added later` 절은 추가 내용이 아직 작성되지 않은 상태임을 표시합니다.

문서의 미완성 절
원문 상태
PCMTo be added
Othersto be added later

원문에서 후속 작성 대상으로 남긴 항목입니다.

Monitor Hotplug Event Handling
------------------------------
- acomp

  pin_eld_notify() -> check_presence_and_report() -> hdmi_present_sense() ->
  sync_eld_via_acomp().

  Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for
  both dyn_pcm_assign and !dyn_pcm_assign

- !acomp

  hdmi_unsol_event() -> hdmi_intrinsic_event() -> check_presence_and_report() ->
  hdmi_present_sense() -> hdmi_prepsent_sense_via_verbs()

  Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for dyn_pcm_assign.
  Use hda_jack mechanism to handle jack events.


Others to be added later
========================