#[non_exhaustive]pub struct PropertyInfo {
pub id: u32,
pub name: String,
pub value: u64,
pub immutable: bool,
pub range: Option<(u64, u64)>,
}Expand description
One cached property.
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.id: u32The property id, for use in an atomic request.
name: StringThe property name as the kernel reports it.
value: u64The value at the time the object was cached.
immutable: boolWhether the kernel marks this property DRM_MODE_PROP_IMMUTABLE.
The C++ keeps the whole raw flags word so callers can distinguish
immutable, range, enum, and blob properties without re-querying. Only
the immutable bit is actually consulted anywhere in the tree, and the
drm crate surfaces the rest through typed accessors, so this carries
the one flag bit that has a caller – an unsigned range’s bounds are in
range – and leaves the rest to
get_property.
range: Option<(u64, u64)>Inclusive (min, max) for an unsigned range property, None for
every other kind – signed ranges included.
The kernel rejects a range write outside these bounds with EINVAL,
and an atomic commit is all-or-nothing: one out-of-range value fails
the whole frame, including every layer that was fine. A caller that
derives a value rather than echoing one back – a zpos computed from a
layer count, say – has no other way to know what the plane will take.
Signed ranges are deliberately not reported. The atomic ioctl carries
every value as a u64, so a signed range arrives as two’s complement:
CRTC_X’s bounds are (-2^31, 2^31 - 1), which as u64 is
(18446744071562067968, 2147483647) – a pair where the minimum
compares greater than the maximum. Anything doing unsigned arithmetic
on that would turn a small negative offset into INT32_MAX, so the
safe thing is to hand back nothing rather than a bound that is wrong in
a direction the caller cannot see.