Expand description
PIAF — a Rust library for reading and interpreting EDID display capability data.
The core pipeline is:
parse_edid— validate and decode raw bytes intoParsedEdidRef(zero-copy).capabilities_from_edid— run extension handlers to produceDisplayCapabilities.
§Decoding philosophy
PIAF decodes everything a specification defines. No field is omitted because it appears
obscure or unlikely to be needed — that judgement belongs to the consumer. Option
fields communicate presence or absence in the source data, not relative importance.
§Quick start
use piaf::{parse_edid, capabilities_from_edid, ExtensionLibrary};
let bytes = std::fs::read("/sys/class/drm/card0-HDMI-A-1/edid").unwrap();
let library = ExtensionLibrary::with_standard_handlers();
let parsed = parse_edid(&bytes, &library).unwrap();
let caps = capabilities_from_edid(&parsed, &library);
println!("{:?}", caps.display_name);Re-exports§
pub use model::ExtensionHandler;pub use model::EdidError;pub use model::EdidSource;pub use model::EdidWarning;pub use model::ExtensionLibrary;pub use model::ExtensionMetadata;pub use model::ExtensionTagRegistry;pub use model::KnownExtensions;pub use model::ModeSink;pub use model::ParsedEdid;pub use model::ParsedEdidRef;pub use model::StaticContext;pub use model::StaticDisplayCapabilities;pub use model::StaticExtensionHandler;pub use parser::parse_edid;pub use parser::parse_edid_owned;pub use capabilities::capabilities_from_edid;pub use capabilities::capabilities_from_edid_static;pub use capabilities::CEA861_HANDLER;pub use capabilities::Cea861Handler;pub use capabilities::DISPLAYID_HANDLER;pub use capabilities::DisplayIdHandler;pub use capabilities::STANDARD_HANDLERS;
Modules§
- capabilities
- Capability extraction from a
ParsedEdid. - infoframe_
type - Well-known InfoFrame type codes from the InfoFrame Data Block (extended tag
0x20). - model
- Types for the EDID data model. Data model types for parsed EDID data and display capabilities.
- parser
- EDID byte-level parser.
Structs§
- Audio
Sample Rates - Sample-rate support mask from byte 2 of a Short Audio Descriptor.
- Cea861
Capabilities - Decoded capabilities from a CEA-861 extension block.
- Cea861
Flags - Capability flags from byte 3 of a CEA-861 extension block.
- Chromaticity
- CIE xy chromaticity coordinates for a display’s color primaries and white point,
decoded from EDID base block bytes
0x19–0x22. - Chromaticity
Point - A single CIE xy chromaticity coordinate pair, decoded from the EDID base block.
- Color
Management Data - Color Management Data decoded from a
0xF9descriptor. - Colorimetry
Block - Decoded Colorimetry Data Block (extended tag
0x05). - Colorimetry
Flags - Colorimetry standards supported by the display, from the Colorimetry
Data Block (extended tag
0x05). - CvtAspect
Ratios - Aspect ratios supported for CVT-generated timings (byte 14 of a
0xFDdescriptor). - CvtScaling
- Display scaling capabilities reported in byte 16 of a
0xFDCVT descriptor. - CvtSupport
Params - CVT support parameters decoded from a display range limits descriptor (
0xFD). - DcmChannel
- DCM polynomial coefficients for a single primary colour, decoded from a
0xF9descriptor. - Display
Capabilities - Consumer-facing display capability model produced by a display data parser.
- Display
Feature Flags - Boolean capability flags from EDID base block byte
0x18(Display Feature Support). - Display
Gamma - Display gamma, decoded from EDID base block byte
0x17. - Display
IdCapabilities - Rich capabilities extracted from a DisplayID 1.x extension section.
- Display
IdInterface - Display interface capabilities, decoded from the Display Interface Data Block
(DisplayID 1.x
0x0F). - Display
IdStereo Interface - Stereo display interface parameters, decoded from the Stereo Display Interface Data Block
(DisplayID 1.x
0x10). - Display
IdTiled Topology - Tiled display topology, decoded from the Tiled Display Topology Data Block
(DisplayID 1.x
0x12). - Display
IdTransfer Characteristic - Decoded Transfer Characteristics Block (DisplayID 1.x
0x0E). - Edid
Version - EDID specification version and revision, decoded from base block bytes 18–19.
- GtfSecondary
Params - GTF secondary curve parameters decoded from a display range limits descriptor (
0xFD). - Hdmi
Audio Block - Decoded HDMI Audio Data Block (extended tag
0x12). - Hdmi
Forum Dsc - Display Stream Compression (DSC) capabilities from the HF-SCDB.
- Hdmi
Forum Sink Cap - Decoded HDMI Forum Sink Capability Data Block (HF-SCDB, extended tag
0x79). - Hdmi
Vsdb - Decoded HDMI 1.x Vendor-Specific Data Block (OUI
0x000C03). - Hdmi
Vsdb Flags - Capability flags from byte 5 of the HDMI VSDB payload (byte 8 of the CEA block, after the 3-byte header and 3-byte OUI).
- HdrDynamic
Metadata Descriptor - One entry from an HDR Dynamic Metadata Data Block (extended tag
0x07). - HdrEotf
- Electro-Optical Transfer Functions (EOTFs) supported by the display,
from the HDR Static Metadata Data Block (extended tag
0x06). - HdrStatic
Metadata - Decoded HDR Static Metadata Data Block (extended tag
0x06). - Info
Frame Descriptor - One entry from an InfoFrame Data Block (extended tag
0x20). - Manufacturer
Id - A three-character PNP manufacturer identifier, decoded from EDID base block bytes
0x08–0x09. - Monitor
String - A monitor descriptor string, decoded from one of the 18-byte descriptor slots in the
EDID base block (
0xFCmonitor name,0xFFserial number,0xFEunspecified text). - Power
Sequencing - Panel interface power sequencing timing parameters, decoded from the Interface Power
Sequencing Block (DisplayID 1.x
0x0D). - Room
Configuration Block - Decoded Room Configuration Data Block (extended tag
0x13). - Short
Audio Descriptor - A decoded Short Audio Descriptor (3 bytes) from a CEA Audio Data Block (tag
0x01). - Speaker
Allocation - Decoded Speaker Allocation Data Block (standard tag
0x04). - Speaker
Allocation Flags - Speaker channel presence flags, byte 1 of the Speaker Allocation Data Block.
- Speaker
Allocation Flags2 - Speaker channel presence flags, byte 2 of the Speaker Allocation Data Block.
- Speaker
Allocation Flags3 - Speaker channel presence flags, byte 3 of the Speaker Allocation Data Block.
- Speaker
Location Entry - A single speaker location entry from the Speaker Location Data Block
(extended tag
0x14). - T7Vtdb
Block - A decoded DisplayID Type VII Video Timing Data Block (T7VTDB, extended tag
0x22). - T8Vtdb
Block - A decoded DisplayID Type VIII Video Timing Data Block (T8VTDB, extended tag
0x23). - T10Vtdb
Block - A decoded DisplayID Type X Video Timing Data Block (T10VTDB, extended tag
0x2A). - T10Vtdb
Entry - A single timing entry from a T10VTDB block.
- Tile
Bezel Info - Bezel sizes around a single tile, decoded from the optional bezel bytes of the Tiled
Display Topology Data Block (0x12) when the
has_bezel_infoflag is set. - Vendor
Specific Block - A decoded Vendor-Specific Video Data Block (VSVDB, extended tag
0x01) or Vendor-Specific Audio Data Block (VSADB, extended tag0x11). - Vesa
Display Device Block - Decoded VESA Display Device Data Block (extended tag
0x02). - Vesa
Transfer Characteristic - Decoded VESA Display Transfer Characteristic Data Block (standard tag
0x05). - Video
Capability - Decoded Video Capability Data Block (extended tag
0x00). - Video
Capability Flags - Flags from the Video Capability Data Block (extended tag
0x00). - Video
Input Flags - Boolean flags from EDID byte
0x14(Video Input Definition). - Video
Mode - A display video mode expressed as resolution, refresh rate, and scan type.
- VtbExt
Block - Decoded VESA Video Timing Block Extension (extended tag
0x03). - White
Point - An additional white point entry from a
0xFBdescriptor.
Enums§
- Analog
Color Type - Display color type for an analog display, decoded from EDID base block byte
0x18bits 4–3. - Analog
Sync Level - Video white and sync levels for an analog display, decoded from EDID base block
byte
0x14bits 6–5. - Audio
Format - Audio format code from bits 6–3 of the first SAD byte.
- Audio
Format Info - Format-specific information from byte 3 of a Short Audio Descriptor.
- Backlight
Type - Backlight type, decoded from Display Device Data Block (0x0C) byte 1 bits 5:4.
- Color
BitDepth - Color bit depth per primary color channel, decoded from EDID base block byte
0x14bits 6–4. - CvtAspect
Ratio - Preferred aspect ratio for CVT-generated timings, decoded from byte 15 bits 7–5.
- Digital
Color Encoding - Supported color encoding formats for a digital display, decoded from EDID base block
byte
0x18bits 4–3. - Display
Interface Type - Physical interface standard type, decoded from Display Interface Data Block (0x0F) byte 0 bits 3:0.
- Display
Technology - Display technology type, decoded from Display Device Data Block (0x0C) byte 0 bits 7:4.
- DtcPoint
Encoding - Bit-depth encoding for transfer characteristic sample points, decoded from
the Transfer Characteristics Block (DisplayID 1.x
0x0E) byte 0 bits 7:6. - Hdmi
DscMax Slices - Maximum number of horizontal DSC slices supported by a HDMI 2.1 sink.
- Hdmi
Forum Frl - Maximum Fixed Rate Link (FRL) bandwidth supported by a HDMI 2.1 sink.
- Interface
Content Protection - Content protection mechanism supported on the display interface, decoded from Display Interface Data Block (0x0F) byte 6 bits 1:0.
- Manufacture
Date - Manufacture date or model year, decoded from EDID base block bytes 16–17.
- Operating
Mode - Panel operating mode, decoded from Display Device Data Block (0x0C) byte 1 bits 3:0.
- Physical
Orientation - Physical mounting orientation of the panel, decoded from Display Device Data Block (0x0C) byte 7 bits 1:0.
- Rotation
Capability - Rotation capability, decoded from Display Device Data Block (0x0C) byte 7 bits 3:2.
- Scan
Direction - Scan direction of the fast (horizontal) scan relative to H-sync, decoded from Display Device Data Block (0x0C) byte 7 bits 7:6.
- Screen
Size - Physical screen dimensions or aspect ratio, decoded from EDID base block bytes
0x15–0x16. - Stereo
Mode - Stereo viewing support decoded from DTD byte 17 bits 6, 5, and 0.
- Stereo
Sync Interface - Physical interface used to deliver stereo synchronization to the glasses, decoded from Stereo Display Interface Data Block (0x10) byte 1.
- Stereo
Viewing Mode - Stereo content format, decoded from Stereo Display Interface Data Block (0x10) byte 0 bits 3:0.
- Subpixel
Layout - Sub-pixel layout, decoded from Display Device Data Block (0x0C) byte 8.
- Sync
Definition - Sync signal definition decoded from DTD byte 17 bits 4–1.
- Tile
Topology Behavior - Behavior when one or more tiles are missing from a tiled display, decoded from Tiled Display Topology Data Block (0x12) byte 0 bits 5:4.
- Timing
Formula - Video timing support reported in the display range limits descriptor (
0xFD), byte 10. - Transfer
Curve - Transfer curve sample data decoded from the DisplayID Transfer Characteristics
Block (
0x0E). - Transfer
Point Encoding - Bit-depth encoding for transfer characteristic sample points, decoded from
the Transfer Characteristics Block (DisplayID 1.x
0x0E) byte 0 bits 7:6. - Video
Interface - Video interface type, decoded from EDID base block byte
0x14bits 3–0. - Zero
Pixel Location - Location of the zero pixel (the upper-left pixel in the framebuffer), decoded from Display Device Data Block (0x0C) byte 7 bits 5:4.
Traits§
- Extension
Data - Trait for typed data stored in
DisplayCapabilities::extension_databy custom handlers.
Type Aliases§
- Parse
Warning - A reference-counted, type-erased warning value.