Expand description
TMDS link bring-up for HDMI sources.
spiritlevel decides a TMDS link’s bit clock ratio and scrambling from the TMDS
character rate, the sink’s and source’s facts and the caller’s policy, and states what
the sink’s TMDS_Config must hold (TmdsLinkParams::choose, a pure, I/O-free
function). Its procedures carry that out over the PHY and the sink’s SCDC: bring-up,
tear-down, the reconnect check after a hotplug, and the quick restore.
The procedures are written once as an I/O-free core over procedure::TmdsIo, and
TmdsLink drives them synchronously over a TmdsScdc, hdmi-hal’s TmdsPhy, a
Clock and a Delay, with an optional Cancel flag. Each makes one attempt per
call, leaving retries to the caller, and records every step as a TmdsEvent in its
_with_events form.
§Features
display-types(default) —Fromconversions from display-types’HdmiForumSinkCapinto the sink facts. Without it the caller fills the sink facts itself.culvert—TmdsScdcfor culvert’s SCDC client, with its errors asCulvertError.
Modules§
- procedure
- The procedures’ I/O-free core:
TmdsIo, the I/O they need, and the procedures over it, written once asasync fn.
Structs§
- Bring
UpConfig - Bring-up and quick-restore settings.
- Config
Error - What
BringUpConfig::validatefound: every problem, at least one. - Culvert
Error culvert - culvert’s error, as
TmdsScdcforculvert::Scdc<T>returns it. - Failed
Read - A failed read of the check, and when it came.
- Hdmi
Forum Sink Cap display-types - The sink capabilities the sink facts convert from, re-exported from display-types.
Decoded HDMI Forum Sink Capability Data Block (HF-SCDB, extended tag
0x79). - LinkUp
- A link that is up: steps up to the output’s start completed. Whether the sink reports scrambling is the check’s, part of the outcome rather than a condition of it.
- NoCancel
- The cancel flag, re-exported from hdmi-hal, so one flag stops TMDS bring-up and FRL
training alike. Implemented for
AtomicBooland any reference to a flag. Never cancels. - Restored
- A quick restore that ran to its end.
- Scdc
culvert - culvert’s client, its errors and the transport it runs over, re-exported for the adapter’s users. Typed client for the HDMI 2.1 SCDC (Status and Control Data Channel) register map.
- Scrambling
Check - What the scrambling check found, and how.
- Scrambling
Off - Every condition that keeps a 1/10 link unscrambled.
- Scrambling
Status - What the sink reports in
Scrambling_Status(SCDC offset 0x21): whether it detects scrambled TMDS, and the byte that was read. - Sink
Tmds Config - The two fields of the sink’s
TMDS_Config(SCDC offset 0x20): what is written, and what a read decodes to. - Sink
Tmds Facts - What the sink declares about TMDS scrambling.
- Source
Tmds Facts - What the source’s PHY can do.
- Tear
Down Config - Tear-down settings.
- Tear
Down Error - A tear-down in which at least one PHY step failed. Every step was still attempted, so a failed scrambler call does not leave the output running; each field holds the first failure of its step.
- Timestamp
- A point in time: microseconds from an arbitrary monotonic epoch.
- Tmds
Config Reading - What a read of the sink’s
TMDS_Configreturned: the two fields the SCDC implementation decoded, and the byte as read, reserved bits included, so a sink that sets them stays visible to a diagnostic tool. - Tmds
Event - One step or decision of a procedure, stamped by the procedure from its own clock.
- Tmds
Link - The TMDS procedures over sync parts: the sink’s SCDC, the PHY, a clock and a delay, and a
cancel flag (
NoCancelunlesswith_cancelgives one). - Tmds
Link Params - The chosen TMDS link: clock ratio, scrambling, and the sink’s
TMDS_Config. - Tmds
PhyCapabilities - What a TMDS PHY can do, as
TmdsPhy::capabilitiesreports it. - Tmds
PhyConfig - What
TmdsPhy::configuresets. - Tmds
Policy - The caller’s choices where HDMI sources differ.
- Tmds
Video - The video a TMDS link carries, as far as a PHY may need it.
- Torn
Down - A tear-down in which every PHY step succeeded: the output is stopped.
- Warnings
- The warnings a bring-up gathered, in the order they arose. Fixed storage, so no
alloc, and never full: each kind occurs at most once.
Enums§
- Bring
UpError - Why a bring-up stopped.
- Bring
UpOutcome - How a bring-up ended without an error.
- Bring
UpWarning - What went wrong without stopping a bring-up. Each kind occurs at most once per attempt.
- Cancel
Point - Where a bring-up saw the caller’s cancel flag.
- Check
Result - How the scrambling check ended.
- Cleanup
- What happened after a bring-up’s error or cancellation.
- Clear
Frl - Which sinks get the FRL clear (
Config_1andFLT_update) before a bring-up. - Clock
Ratio - The TMDS bit clock ratio, hdmi-hal’s
TmdsClockRatio: the TMDS clock runs at the bit rate divided by 10 or by 40. One type, so the link parameters pass straight toTmdsPhy::configure. The TMDS bit clock ratio, as the sink’sTMDS_Bit_Clock_Ratiobit selects it. - Color
BitDepth - The colour depth and format
phy::TmdsVideocarries; re-exported fromdisplay-typesso that implementations name the same types hdmi-hal does. Color bit depth per primary color channel, decoded from EDID base block byte0x14bits 6–4. - Color
Format - The colour depth and format
phy::TmdsVideocarries; re-exported fromdisplay-typesso that implementations name the same types hdmi-hal does. A single color encoding format, used to describe a specific negotiated or candidate configuration. - DdcError
Kind - The hdmi-hal types the procedures’ signatures use, re-exported so that callers and
implementations name the same versions
spiritleveldoes without depending on hdmi-hal themselves: the PHY trait and its configuration, the clock, delay and timestamp, the SCDC error classification, and the colour depth and format aTmdsVideocarries. The kind of aDdcBusfailure. - FrlClear
Skip - Why the FRL clear before a bring-up was skipped.
- NoAcknowledge
Source - The hdmi-hal types the procedures’ signatures use, re-exported so that callers and
implementations name the same versions
spiritleveldoes without depending on hdmi-hal themselves: the PHY trait and its configuration, the clock, delay and timestamp, the SCDC error classification, and the colour depth and format aTmdsVideocarries. Which byte of a transaction was not acknowledged. - OnTmds
Config Failure - What a failed
TMDS_Configwrite does to the bring-up. - Output
During Sink Write - Whether the output is stopped while the sink’s
TMDS_Configis written. - Output
State - Whether the output may be running. Exhaustive: it is stopped or it may not be.
- Params
Error - Why
TmdsLinkParams::chooserefused the inputs. - Protocol
Error culvert - culvert’s client, its errors and the transport it runs over, re-exported for the adapter’s users. What culvert refuses because it would violate the SCDC protocol.
- Reconnect
Check - What the reconnect check found.
- Restore
Error - A quick restore that stopped. Nothing is torn down: the link was running.
- Scdc
Error culvert - culvert’s client, its errors and the transport it runs over, re-exported for the
adapter’s users.
Errors returned by
Scdcregister operations. - Scrambler
Off - When the source’s scrambler is turned off in a tear-down, relative to the sink.
- Scrambling
Decision - Why the link is or is not scrambled.
- Scrambling
Threshold - Which TMDS character rate first requires scrambling and the 1/40 clock ratio.
- Sink
Clear - What became of the sink’s
TMDS_Configin a tear-down. - Sink
Clear Skip - Why a tear-down did not clear the sink’s
TMDS_Config. - Sink
Clear Timing - When the sink’s
TMDS_Configis cleared in a tear-down, relative to stopping the output. - Sink
Presence - Whether the sink is still there, as the caller knows from hotplug.
- Source
Version Skip - Why
Source_Versionwas not written. - Source
Version Write - When the source writes
Source_Versionbefore a bring-up. - Tmds
Config Gate - Which sinks get the
TMDS_Configwrite on a plain link. A scrambled link always writes it: the sink must be told. - Tmds
Config Skip - Why a bring-up did not write the sink’s
TMDS_Config. - Tmds
Config Write - How
TMDS_Configis written. - Tmds
Event Kind - What a procedure did, decided or saw.
- Tmds
Step - A step of a procedure, as an event or an error names it.
- Update
Error - The error of an SCDC operation made of a read and a write, saying which of them failed:
a read-modify-write of
TMDS_Config, or the clear ofFLT_update.
Constants§
- MAX_
BRING_ UP_ EVENTS - The most events one bring-up records: its start; two each for the FRL clear and
Source_Version; one for stopping the output; two for the sink’sTMDS_Config(the write and a plain link’s read-back); one for the PHY’s configuration; two for the scrambler (off, then on, when unscrambled output runs through the write); one each for the wait, the output’s start, the deadline, the scrambling check and a cancellation; the tear-down after an error or a cancellation (MAX_TEAR_DOWN_EVENTS); and its end. One more than any bring-up records: a plain link’s read-back and a scrambled link’s deadline and check never come together. - MAX_
QUICK_ RESTORE_ EVENTS - The most events one quick restore records: its start, one each for the sink’s write, the scrambler and the scrambling check, and its end.
- MAX_
RECONNECT_ CHECK_ EVENTS - The most events one reconnect check records: its start, the read (or its failure), and its end.
- MAX_
TEAR_ DOWN_ EVENTS - The most events one tear-down records: its start, one each for the sink, the scrambler and the output, and its end.
Traits§
- Cancel
- The cancel flag, re-exported from hdmi-hal, so one flag stops TMDS bring-up and FRL
training alike. Implemented for
AtomicBooland any reference to a flag. A flag the caller sets to ask a procedure to stop. - Clock
- A monotonic clock.
- DdcError
- The hdmi-hal types the procedures’ signatures use, re-exported so that callers and
implementations name the same versions
spiritleveldoes without depending on hdmi-hal themselves: the PHY trait and its configuration, the clock, delay and timestamp, the SCDC error classification, and the colour depth and format aTmdsVideocarries. An error of aDdcBus, classified. - Delay
- A delay.
- Scdc
Transport culvert - culvert’s client, its errors and the transport it runs over, re-exported for the
adapter’s users.
The transport
Scdc<T>is generic over, re-exported fromhdmi-hal. Raw register access to the SCDC register map over DDC/I²C. - TmdsPhy
- TMDS control of an HDMI transmitter PHY.
- Tmds
Scdc - The sink’s SCDC registers, as the TMDS procedures use them.