요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=======================
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
===
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
===============
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
====
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.
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 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
========================
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로 이 방식을 사용할지 표시합니다.
Device entry가 virtual pin처럼 동작하고 소수 PCM을 필요할 때 연결합니다.
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를 초기화합니다.
Hub 연결 상태에 따른 logical endpoint 수입니다.
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-39DP MST는 기존 connection list code를 재사용합니다. 같은 pin에 속한 device entry는 동일한 connection list를 가지므로 code를 공유할 수 있습니다.
따라서 DP MST가 device entry의 connection list를 가져올 때 별도의 device entry setting을 하지 않아도 됩니다.
동일 pin의 공통 list를 그대로 사용합니다.
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 차이가 크지 않아 이를 따로 구분하지 않습니다.
원문이 전제로 삼은 세 조합입니다.
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]`에 배정합니다.
Flag에 따라 boot/static 경로와 hotplug/dynamic 경로가 갈립니다.
같은 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`을 정적으로 배정합니다.
Dynamic assignment 여부에 따라 jack object 경로가 달라집니다.
Unsolicited event는 `!acomp`일 때 enable합니다. `acomp` 경로는 component notification을 사용하므로 HDA unsolicited event를 별도로 켜는 경로와 구분됩니다.
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()`입니다.
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 원문을 그대로 보존한 것입니다.
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를 처리합니다.
acomp와 dynamic assignment 조합별 최종 jack 보고 방식입니다.
마지막 `Others to 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
========================
요약·해설
dp-mst.rst:1-101HD-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 배정 시점을 결정합니다.
두 flag가 맡는 역할을 빠르게 구분합니다.