Ashlar
A display connection stack in Rust — HDMI 2.1 first.
Ashlar takes a display link from raw capability bytes to a trained link: parse what the sink can do, negotiate the best mode the source, sink and cable can all carry, describe it in InfoFrames, and bring up the link over SCDC, with FRL training or over TMDS. Each layer is its own crate — use one, or use them all.
An ashlar is a stone dressed to fit its neighbours exactly. The crates are built the same way: each one is small, does one job completely, and meets the next layer at a typed, documented boundary.
- The stack — the layers and what each one is responsible for
- Crates — every crate, its layer and its status
- Getting started — which crates to add for what you are building
- Principles — the design rules every crate follows
All crates are open source under the MPL-2.0 and published on crates.io.
The stack
Integration layer compositor glue · DRM/KMS · source capability query (planned)
Driver-adjacent layer FRL link training · TMDS bring-up plumbob · plumbob-async · spiritlevel · spiritlevel-async
Protocol layer CEC · eARC (planned)
Signaling layer InfoFrames · SCDC cartouche · culvert · culvert-async
Negotiation layer enumeration · validation · ranking concordance
Parsing layer EDID · DisplayID piaf
Shared types display vocabulary display-types
Hardware abstraction DDC bus · SCDC transport · PHY · time hdmi-hal · hdmi-hal-async · hdmi-hal-i2c-dev
Test support simulated sink · conformance checks maquette
From bytes to a trained link
The critical path — what a minimal working HDMI 2.1 link needs, in order:
| Step | What happens | Crate | Status |
|---|---|---|---|
| 1 | Parse the sink’s EDID / DisplayID into typed capabilities | piaf | Released |
| 2 | Negotiate a ranked list of configurations the sink, source and cable can all carry | concordance | Released |
| 3 | Read and write the sink’s SCDC registers | culvert | Released |
| 4 | Train the FRL link, stepping down rates when the sink asks, falling back to TMDS | plumbob | Released |
| 5 | Choose the TMDS link: clock ratio, scrambling and the sink’s TMDS_Config | spiritlevel | Released |
| 6 | Bring the TMDS link up over the PHY and SCDC, and check the sink follows | spiritlevel | Released |
| 7 | Run the above against real hardware from Linux userspace | hdmi-hal-i2c-dev | Released |
| 8 | Describe the chosen configuration in InfoFrames | cartouche | Released |
| 9 | Discover the source’s capabilities from DRM/KMS | — | Planned |
| 10 | Turn the negotiated configuration into a DRM atomic modeset | — | Planned |
CEC, eARC and further PHY configuration are off the critical path, but planned (soon™).
Where policy lives
The parsing and protocol layers are judgment-free: they implement the standard and
report what they find. The negotiation layer is where opinions live — it ranks candidates
by a NegotiationPolicy you can override, and every accepted or rejected candidate carries
a reasoning trace explaining why.
End-to-End Data Flow
flowchart TD
A[Raw EDID bytes] --> B["piaf <br> Parse EDID / DisplayID"]
B --> C[piaf::DisplayCapabilities]
C --> C2["Integration Layer<br>Convert to SinkCapabilities"]
C2 --> D["concordance <br>Negotiation Layer"]
E["SourceCapabilities<br>caller-supplied"] --> D
F["CableCapabilities<br>caller-supplied"] --> D
D --> G["Iterator of<br>NegotiatedConfig"]
G --> H["Select Configuration<br>(policy / caller)"]
H --> I["culvert <br>SCDC register access"]
H -->|TMDS configuration| T["spiritlevel <br>TMDS bring-up"]
T -->|"sink's TMDS_Config"| I
I --> I2["plumbob <br>FRL state machine"]
I2 --> J{Training Outcome}
J -->|Success| K[Achieved FRL Rate]
J -->|Fallback Required| D
K --> L["cartouche <br>InfoFrame Encoding"]
H --> L
L --> M[Encoded HDMI Packets]
H -.-> LV["InfoFrame builder<br>(planned)<br>Build and validate<br>against NegotiatedConfig"]
L -.-> LV
M --> N["DRM/KMS Integration<br>(planned)"]
N --> O["Atomic Commit<br>to Hardware"]
Crates
| Crate | Layer | What it does | Docs |
|---|---|---|---|
| display-types | Shared types | Display capability vocabulary shared across the stack | docs.rs |
| piaf | Parsing | EDID and DisplayID parser | docs.rs |
| concordance | Negotiation | HDMI 2.1 mode negotiation with a full reasoning trace | docs.rs |
| cartouche | Signaling | InfoFrame encoding and decoding (AVI, Audio, HDR Static, HDMI Forum VSI, Dynamic HDR) | docs.rs |
| culvert | Signaling | Typed SCDC register access | docs.rs |
| culvert-async | Signaling | Async companion to culvert | docs.rs |
| plumbob | Driver-adjacent | FRL link training state machine | docs.rs |
| plumbob-async | Driver-adjacent | Async companion to plumbob | docs.rs |
| spiritlevel | Driver-adjacent | TMDS link bring-up: clock ratio, scrambling and the sink’s TMDS_Config | docs.rs |
| spiritlevel-async | Driver-adjacent | Async companion to spiritlevel | docs.rs |
| hdmi-hal | Hardware abstraction | Traits for the DDC bus, SCDC transport, TMDS and FRL PHYs, PHY power, clock and delay | docs.rs |
| hdmi-hal-async | Hardware abstraction | Async companion to hdmi-hal | docs.rs |
| hdmi-hal-i2c-dev | Hardware abstraction | Linux userspace backend over /dev/i2c-N, for development and validation | docs.rs |
| ashlar | — | Facade: one feature per crate above, re-exported under its own name | docs.rs |
| maquette | Test support | Simulated HDMI sink for tests, and conformance checks for hdmi-hal implementations | docs.rs |
Current versions are on crates.io; each crate’s
CHANGELOG.md records what changed in each release.
Getting started
Pick the layers you need. Each crate’s README has a worked example; this page tells you which crates to start from.
| You are building… | Start with |
|---|---|
| A tool that reads and explains a display’s EDID | piaf |
| Mode selection: “what can I drive on this display?” | piaf + concordance |
| InfoFrame generation or inspection | cartouche |
| HDMI 2.1 link bring-up on your own hardware | hdmi-hal + culvert + plumbob |
| The same, on an async executor | the -async companions of the three above |
TMDS link bring-up: clock ratio, scrambling, the sink’s TMDS_Config | spiritlevel, with culvert for SCDC; on an async executor, spiritlevel-async with culvert-async |
| Experiments against a real sink from Linux userspace | hdmi-hal-i2c-dev under culvert and plumbob |
| Tests of code over hdmi-hal’s traits, against a simulated sink | maquette, as a dev-dependency |
Add crates individually:
cargo add piaf concordance
or through the facade, one feature per crate:
cargo add ashlar --features piaf,concordance
For no_std targets, disable default features; each crate’s README lists what remains
available with alloc and without it.
Supported Rust versions
Every crate in the stack builds on Rust 1.85 or newer (rust-version in each
Cargo.toml), and CI checks every crate on that version. 1.85 is the first release with
edition 2024, and the floor stays there for as long as it can: HAL and no_std users often
build with distro or vendor toolchains that trail stable.
When the minimum version is raised:
- There is a reason: a stable language or library feature the code needs, or a dependency that needs a newer Rust. A new stable release on its own is not one.
- The new minimum is a Rust release at least six months old.
- It ships in a minor release (the next
0.ybefore 1.0), never in a patch release. - Every crate raises together, so a project using several crates has one toolchain floor.
- The changelog says so, naming the old and new minimum and the reason.
A raise does not break your build on an older toolchain. Cargo’s MSRV-aware resolver
(the default with edition 2024, or resolver = "3") picks the newest release of each
crate that supports your package’s rust-version, or your toolchain’s version when
rust-version is not set.
An end-to-end walkthrough — EDID bytes in, a ranked configuration, its InfoFrames and a link-training plan out — is on its way.
Principles
- Policy at the right layer. Parsing layers make no judgements. The negotiation layer is explicitly opinionated but configurable. Hardware layers implement the standard, not policy.
- Modular: pick, combine, replace. Every layer can be used on its own, combined with the others, or replaced by an implementation of the trait the layer above defines
- Extensible without forking. Every library in the stack is designed to be customized and configured without modifying its source.
- Diagnostics are first-class. Structured reasoning traces and typed warnings instead of logs. Rejected candidates are explained; nothing fails silently.
no_stdwhere it matters, async companions where they help.- Hardware behind traits. SCDC transport and PHY control are injected, so all protocol logic is testable without hardware; maquette simulates a sink behind those traits, under deterministic time.
- No unsafe code.
#![forbid(unsafe_code)]across the stack. - Stable output types. Consumer-facing structs are
#[non_exhaustive], so new fields do not break you. - Verifiable releases. Trusted publishing, with SLSA provenance you can check with
gh attestation verify.
Beyond HDMI
Much of Ashlar is not HDMI-specific:
- EDID and DisplayID describe displays on every link — DisplayPort, eDP panels, DVI,
USB-C DisplayPort Alt Mode and USB display adapters.
piafanddisplay-typesserve all of them. - CTA-861 InfoFrame payloads — AVI, HDR Static and Dynamic HDR — are carried by
DisplayPort too, inside its secondary data packets.
cartoucheencodes the payloads. - Negotiation — enumerate, check constraints, rank — has the same shape for any link;
concordance’s built-in constraints are HDMI’s today.
The transport crates (hdmi-hal, culvert, plumbob) are HDMI-only by nature: SCDC and FRL
exist only in HDMI. DisplayPort’s counterparts — the AUX channel, DPCD registers and its own
link training — would be sister crates built the same way. DisplayPort support is a
direction the stack is designed to grow into.