Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

The critical path — what a minimal working HDMI 2.1 link needs, in order:

StepWhat happensCrateStatus
1Parse the sink’s EDID / DisplayID into typed capabilitiespiafReleased
2Negotiate a ranked list of configurations the sink, source and cable can all carryconcordanceReleased
3Read and write the sink’s SCDC registersculvertReleased
4Train the FRL link, stepping down rates when the sink asks, falling back to TMDSplumbobReleased
5Choose the TMDS link: clock ratio, scrambling and the sink’s TMDS_ConfigspiritlevelReleased
6Bring the TMDS link up over the PHY and SCDC, and check the sink followsspiritlevelReleased
7Run the above against real hardware from Linux userspacehdmi-hal-i2c-devReleased
8Describe the chosen configuration in InfoFramescartoucheReleased
9Discover the source’s capabilities from DRM/KMS—Planned
10Turn 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

CrateLayerWhat it doesDocs
display-typesShared typesDisplay capability vocabulary shared across the stackdocs.rs
piafParsingEDID and DisplayID parserdocs.rs
concordanceNegotiationHDMI 2.1 mode negotiation with a full reasoning tracedocs.rs
cartoucheSignalingInfoFrame encoding and decoding (AVI, Audio, HDR Static, HDMI Forum VSI, Dynamic HDR)docs.rs
culvertSignalingTyped SCDC register accessdocs.rs
culvert-asyncSignalingAsync companion to culvertdocs.rs
plumbobDriver-adjacentFRL link training state machinedocs.rs
plumbob-asyncDriver-adjacentAsync companion to plumbobdocs.rs
spiritlevelDriver-adjacentTMDS link bring-up: clock ratio, scrambling and the sink’s TMDS_Configdocs.rs
spiritlevel-asyncDriver-adjacentAsync companion to spiritleveldocs.rs
hdmi-halHardware abstractionTraits for the DDC bus, SCDC transport, TMDS and FRL PHYs, PHY power, clock and delaydocs.rs
hdmi-hal-asyncHardware abstractionAsync companion to hdmi-haldocs.rs
hdmi-hal-i2c-devHardware abstractionLinux userspace backend over /dev/i2c-N, for development and validationdocs.rs
ashlar—Facade: one feature per crate above, re-exported under its own namedocs.rs
maquetteTest supportSimulated HDMI sink for tests, and conformance checks for hdmi-hal implementationsdocs.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 EDIDpiaf
Mode selection: “what can I drive on this display?”piaf + concordance
InfoFrame generation or inspectioncartouche
HDMI 2.1 link bring-up on your own hardwarehdmi-hal + culvert + plumbob
The same, on an async executorthe -async companions of the three above
TMDS link bring-up: clock ratio, scrambling, the sink’s TMDS_Configspiritlevel, with culvert for SCDC; on an async executor, spiritlevel-async with culvert-async
Experiments against a real sink from Linux userspacehdmi-hal-i2c-dev under culvert and plumbob
Tests of code over hdmi-hal’s traits, against a simulated sinkmaquette, 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.y before 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_std where 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. piaf and display-types serve all of them.
  • CTA-861 InfoFrame payloads — AVI, HDR Static and Dynamic HDR — are carried by DisplayPort too, inside its secondary data packets. cartouche encodes 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.