Crate drm

Source
Expand description

A safe interface to the Direct Rendering Manager subsystem found in various operating systems.

§Summary

The Direct Rendering Manager (DRM) is subsystem found in various operating systems that exposes graphical functionality to userspace processes. It can be used to send data and commands to a GPU driver that implements the interface.

Userspace processes can access the DRM by opening a ‘device node’ (usually found in /dev/dri/*) and using various ioctl commands on the open file descriptor. Most processes use the libdrm library (part of the mesa project) to execute these commands. This crate takes a more direct approach, bypassing libdrm and executing the commands directly and doing minimal abstraction to keep the interface safe.

While the DRM subsystem exposes many powerful GPU interfaces, it is not recommended for rendering or GPGPU operations. There are many standards made for these use cases, and they are far more fitting for those sort of tasks.

§Usage

To begin using this crate, the Device trait must be implemented. See the trait’s example section for details on how to implement it.

Modules§

buffer
Memory management and buffer functionality that the DRM subsystem exposes.
control
Modesetting operations that the DRM subsystem exposes.
node
Module for abstractions on drm device nodes.

Structs§

AuthToken
An authentication token, unique to the file descriptor of the device.
Driver
Driver version of a device.
VblankWaitFlags
Flags to alter the behaviour when waiting for a vblank
VblankWaitReply
Data returned from a vblank wait

Enums§

ClientCapability
Used to enable/disable capabilities for the process.
DriverCapability
Used to check which capabilities your graphics driver has.
VblankWaitTarget
Used to specify a vblank sequence to wait for

Constants§

CLOEXEC
RDWR

Traits§

Device
This trait should be implemented by any object that acts as a DRM device. It is a prerequisite for using any DRM functionality.