Expand description
Display characterization and color handling.
What a connected display can do, and what has to happen to pixels before they reach it. Two halves that mostly do not talk to each other.
§Finding the display
ScanoutTarget— the connected output and the CRTC and primary plane that drive it, which is the pair everything downstream needs and the one thingcrtcs().first()reliably gets wrong on real hardware.query_connector_modes— what each connector offers, withProbedeciding whether to ask the sink or trust the cache.ConnectorCapabilitiesandCrtcCapabilities— the properties this pipe actually exposes, so a caller writes what the driver has rather than what the spec allows.HotplugMonitor— the kernel’s own uevent stream, behind thehotplugfeature.DriverProfile— device capabilities, probed and never inferred from the driver’s name.
§Getting the pixels right
ToneMapper— SDR to HDR and back, over aToneMapCurve. Color maths has too many plausible readings for a paper derivation to be worth much, so its answers are diffed against the reference’s own, vector by vector.CrtcColorPipeline— the CRTC’s degamma, CTM and gamma stages. Each refuses on its own rather than the pipeline refusing whole, because partial pipelines are the common case: of 4,129 CRTCs surveyed, 848 have no color stage at all and three more shapes sit between that and the full three.HdrSourceMetadataandHdrMetadataCache— the CTA-861.3 blob a sink needs to switch into HDR, and the cache that stops it being rewritten every frame. Its green/blue/red primary ordering and tail padding are both invisible on screen and both change the bytes, so this is diffed against the reference too, over twelve vectors.edid— what the sink says about itself, behind theedidfeature.
§Features
edid is off by default: libdisplay-info-sys links a system library, and
the cross lanes have no sysroot for it. Everything else here — the tone
mapper and color curves that downstream crates want — builds without it.
Re-exports§
pub use curves::ColorCtm;pub use curves::ColorLut;pub use hdr::HdrBlob;pub use hdr::HdrMetadataBlob;pub use hdr::HdrSourceMetadata;pub use hdr::TransferFunction;pub use hdr::hdr_metadata_hash;pub use hdr::serialize_hdr_metadata;pub use hdr_cache::HdrMetadataCache;pub use scanout::CrtcChoice;pub use scanout::ScanoutError;pub use scanout::ScanoutTarget;pub use scanout::crtc_for_connector;pub use scanout::primary_plane_for_crtc;pub use scanout::rank;pub use scanout::rank_pick;
Modules§
- color
- Color primaries, independent of where they came from.
- curves
- Transfer functions.
- edid
- What a connected display says about itself.
- hdr
- Source-side HDR static metadata, and the property blob that carries it.
- hdr_
cache - Per-CRTC cache of the
HDR_OUTPUT_METADATAblob. - scanout
- Finding something to put a picture on.
Structs§
- Connector
Capabilities - What one connector’s color properties can be set to.
- Connector
Modes - One connector and the modes it advertises.
- Crtc
Capabilities - What one CRTC’s color pipeline can be asked to do.
- Crtc
Color Pipeline - The color pipeline of one CRTC.
- Driver
Profile - A device’s capabilities.
- Hotplug
Event - One connector changing.
- Hotplug
Monitor - A pollable watch on DRM hotplug.
- MaxBpc
- The
max bpcrange, and where it currently sits. - Prime
Caps - What
DRM_CAP_PRIME’s bitmask says. - Tone
Mapper - A configured tone-mapping transform.
Enums§
- Broadcast
Rgb - A connector’s
Broadcast RGBentries. - Colorspace
- A connector’s
Colorspaceentries, by the kernel’s names. - Direction
- Which transform a mapper performs.
- Panel
Self Refresh - Whether a connected panel might hold its image without a flip.
- Pipeline
Error - What can go wrong programming the pipeline.
- Probe
- Whether to make the kernel ask the display again.
- Source
- Where the uevents are read from.
- Stage
- Which stage a call was about.
- Tone
MapCurve - The curve applied in linear light when compressing HDR into SDR.
Constants§
- LUT_
SIZE - Entries in each lookup table: 1024 buckets plus one sentinel.
Functions§
- connector_
type_ self_ refreshes - Whether a connector type can hold its image without a flip.
- decode_
prime_ caps - Decode the
DRM_CAP_PRIMEbitmask. - query_
connector_ modes - Every connector on the device, with its modes.