Skip to main content

DriverProfile

Struct DriverProfile 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

The driver’s name. Informational — see the module docs.

§addfb2_modifiers: bool

AddFB2 accepts explicit modifiers.

§async_page_flip: bool

Asynchronous page flip is supported.

§timestamp_monotonic: bool

Vblank timestamps are CLOCK_MONOTONIC.

§prime_import: bool

dma-bufs can be imported.

§prime_export: bool

dma-bufs can be exported.

§cursor_width: u64

Maximum cursor width. 64 where the driver reports nothing, which is the figure every KMS driver has historically accepted.

§cursor_height: u64

Maximum cursor height, defaulted the same way.

§fb_damage_clips: bool

At least one plane advertises FB_DAMAGE_CLIPS.

§vrr_capable: bool

At least one CRTC exposes VRR_ENABLED.

§psr: PanelSelfRefresh

Whether a connected panel might self-refresh. Telemetry only.

Implementations§

Source§

impl DriverProfile

Source

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.

Trait Implementations§

Source§

impl Clone for DriverProfile

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DriverProfile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DriverProfile

Source§

impl PartialEq for DriverProfile

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DriverProfile

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.