Expand description
Core DRM/KMS device access for drmkit.
Port of src/core/ plus src/modeset/atomic.{hpp,cpp} from drm-cxx @
dc2915b.
The main pieces:
Device— an open DRM node, owning or borrowing its descriptor.PropertyStore— a per-object property cache, so building a frame’s atomic request is hash-map lookups rather than an ioctl per property.AtomicRequest— accumulated property writes, testable and committable.
§Relationship to the drm crate
Per DR-2 drmkit wraps the Smithay drm crate and never re-binds the
ioctls. Device implements drm::Device and drm::control::Device,
so the whole KMS surface those traits expose is available directly. What
this crate adds is the parts the C++ gives a different contract: descriptor
ownership, the property cache, and the atomic request’s export seam.
§Example
use drmkit_core::{AtomicRequest, Device, ObjectType, PropertyStore};
use drm::control::AtomicCommitFlags;
let device = Device::open("/dev/dri/card0")?;
device.enable_universal_planes()?;
device.enable_atomic()?;
let mut props = PropertyStore::new();
props.cache_properties(&device, 31, ObjectType::Plane)?;
let mut request = AtomicRequest::new();
request.add_property(31, props.property_id(31, "FB_ID")?, 42)?;
request.test(&device, AtomicCommitFlags::empty())?;Structs§
- Atomic
Commit Flags - Commit flags for atomic mode setting
- Atomic
Request - An atomic modeset request under construction.
- Device
- An open DRM device.
- Mode
- Resolution and timing information for a display mode.
- Property
Blob - A kernel property blob, freed when it is dropped.
- Property
Info - One cached property.
- Property
Store - Per-object property cache.
- Property
Write - One accumulated
(object, property, value)write.
Enums§
- Client
Capability - Used to enable/disable capabilities for the process.
- Core
Error - Errors from device, property, and atomic-request operations.
- Object
Type - A DRM object kind, for property queries.
Functions§
- commit_
with_ out_ fence - Commit
build’s request and collect the CRTC’s out-fence. - crtc_
sequence - The CRTC’s current vblank sequence.
- event_
pending - Whether an event – a page-flip completion, a vblank – is queued on the device, without reading it.
- framebuffer_
modifier - The modifier to declare when registering a framebuffer, or
Noneto take the legacy path, which leaves the layout to the driver. - supports_
framebuffer_ modifiers - Whether the driver accepts
DRM_MODE_FB_MODIFIERS(DRM_CAP_ADDFB2_MODIFIERS).
Type Aliases§
- Result
- Convenience alias.