#[non_exhaustive]pub struct DriverProfile {
pub name: String,
pub addfb2_modifiers: bool,
pub async_page_flip: bool,
pub timestamp_monotonic: bool,
pub prime_import: bool,
pub prime_export: bool,
pub cursor_width: u64,
pub cursor_height: u64,
pub fb_damage_clips: bool,
pub vrr_capable: bool,
pub psr: PanelSelfRefresh,
}Expand description
A device’s capabilities.
One field per DRM_CAP_* the presenter consults, rather than a bitflags
type: these are independent questions with independent answers, and a
reader checking one against the kernel’s documentation should find the
kernel’s name for it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe driver’s name. Informational — see the module docs.
addfb2_modifiers: boolAddFB2 accepts explicit modifiers.
async_page_flip: boolAsynchronous page flip is supported.
timestamp_monotonic: boolVblank timestamps are CLOCK_MONOTONIC.
prime_import: booldma-bufs can be imported.
prime_export: booldma-bufs can be exported.
cursor_width: u64Maximum cursor width. 64 where the driver reports nothing, which is the figure every KMS driver has historically accepted.
cursor_height: u64Maximum cursor height, defaulted the same way.
fb_damage_clips: boolAt least one plane advertises FB_DAMAGE_CLIPS.
vrr_capable: boolAt least one CRTC exposes VRR_ENABLED.
psr: PanelSelfRefreshWhether a connected panel might self-refresh. Telemetry only.
Implementations§
Source§impl DriverProfile
impl DriverProfile
Sourcepub fn probe(device: &Device) -> Result<Self, CoreError>
pub fn probe(device: &Device) -> Result<Self, CoreError>
Probe device.
Capabilities the driver does not report are taken as absent rather than
as an error: DRM_CAP_* is additive, and a kernel too old to know a cap
answers the same way as one whose hardware lacks it.
Turns on universal planes and atomic for device first, as the
reference does: without them the kernel hides primary and cursor
planes, and FB_DAMAGE_CLIPS is only shown to atomic clients, so
fb_damage_clips would read false on a device
that has it. Either being refused leaves the scan to see what it can.
The per-object scans are best-effort the same way: a resource list that
cannot be read leaves vrr_capable and
psr at their defaults rather than failing the probe.
§Errors
drmkit_core::CoreError if the driver name cannot be read — which
means this is not a DRM node at all.