Expand description
Low-level ioctl
-based access to DRM devices.
The struct types in this module are likely to change in breaking ways
in a future release because they currently behave as a memory safety
hole by allowing safe Rust to ask the kernel to write to arbitrary
memory addresses. Prefer to use the Card
abstraction to avoid being
impacted by those changes. (Even that is subject to change until
a v1.0 release, but is less likely to be totally reworked.)
Structs§
- Fixed-point unsigned 16.16-bit number type, represented as
u32
.
Constants§
- If set to 1, the driver supports supplying modifiers in [
DRM_IOCTL_MODE_ADDFB2
]. - If set to 1, the driver supports
DRM_MODE_PAGE_FLIP_ASYNC
for legacy page-flips. - If set to 1, the driver supports
DRM_MODE_PAGE_FLIP_ASYNC
for atomic commits. - If set to 1, the kernel supports reporting the CRTC ID in
crate::event::raw::DrmEventVblank::crtc_id
forcrate::event::raw::DRM_EVENT_VBLANK
andcrate::event::raw::DRM_EVENT_FLIP_COMPLETE
events. - A plane height that is valid to use for a cursor plane.
- A plane width that is valid to use for a cursor plane.
- If set to 1, the driver supports creating “dumb buffers” via
DRM_IOCTL_MODE_CREATE_DUMB
. - The preferred bit depth for “dumb buffers”.
- If set to 1, the driver prefers userspace to render to a shadow buffer instead of directly rendering to a dumb buffer. For best speed, userspace should do streaming ordered memory copies into the dumb buffer and never read from it.
- Bitfield of supported PRIME sharing capabilities. See
DRM_PRIME_CAP_IMPORT
andDRM_PRIME_CAP_EXPORT
. - If set to 1, the driver supports sync objects.
- If set to 1, the driver supports timeline operations on sync objects.
- If set to 0, the kernel will report timestamps with
CLOCK_REALTIME
incrate::event::raw::DrmEventVblank
. If set to 1, the kernel will report timestamps withCLOCK_MONOTONIC
. - If set to 1, the kernel supports specifying a CRTC index in the high bits of [
DrmWaitVblankRequest::type
]. - If set to 1, the DRM core will provide aspect ratio information in modes.
- If set to 1, the DRM core will expose atomic properties to userspace.
- Drivers for para-virtualized hardware (e.g.
vmwgfx
,qxl
,virtio
andvirtualbox
) have additional restrictions for cursor planes (thus making cursor planes on those drivers not truly universal,) e.g. they need cursor planes to act like one would expect from a mouse cursor and have correctly set hotspot properties. If this client cap is not set the DRM core will hide cursor plane on those virtualized drivers because not setting it implies that the client is not capable of dealing with those extra restictions. Clients which do set cursor hotspot and treat the cursor plane like a mouse cursor should set this property. The client must enableDRM_CLIENT_CAP_ATOMIC
first. - If set to 1, the DRM core will expose the stereo 3D capabilities of the monitor by advertising the supported 3D layouts in the flags of struct drm_mode_modeinfo.
- If set to 1, the DRM core will expose all planes (overlay, primary, and cursor) to userspace.
- If set to 1, the DRM core will expose special connectors to be used for writing back to memory the scene setup in the commit. Depends on client also supporting DRM_CLIENT_CAP_ATOMIC
- Mark a region of a framebuffer as dirty.
- User-space can perform a
GETPROPERTY
request to retrieve information about a property. The same property may be attached to multiple objects. - Request a page flip on the specified crtc.
- Allow the update to result in temporary or transient visible artifacts while the update is being applied. Applying the update may also take significantly more time than a page flip. All visual artifacts will disappear by the time the update is completed, as signalled through the vblank event’s timestamp.
- Bitfield of flags accepted by
DRM_IOCTL_MODE_ATOMIC
inDrmModeAtomic::flags
. - Do not block while applying the atomic commit. The
DRM_IOCTL_MODE_ATOMIC
request returns immediately instead of waiting for the changes to be applied in hardware. Note, the driver will still check whether the update can be applied before retuning. - Do not apply the atomic commit, and instead check whether the hardware supports this configuration.
- Request that the page-flip is performed as soon as possible, ie. with no delay due to waiting for vblank. This may cause tearing to be visible on the screen.
- Request that the kernel sends back a vblank event (see struct drm_event_vblank) with the
crate::event::raw::DRM_EVENT_FLIP_COMPLETE
type when the page-flip is done. - Bitmask of flags suitable for
DrmModeCrtcPageFlip::flags
. - If this bit is set in
DRM_CAP_PRIME
, the driver supports exporting PRIME buffers via [DRM_IOCTL_PRIME_HANDLE_TO_FD
]. - If this bit is set in
DRM_CAP_PRIME
, the driver supports importing PRIME buffers via [DRM_IOCTL_PRIME_FD_TO_HANDLE
].