Skip to main content

Driver

Trait Driver 

Source
pub trait Driver {
    type Data: Sync + Send;
    type Object<Ctx: DeviceContext>: AllocImpl;
    type File: DriverFile;

    const INFO: DriverInfo;
    const IOCTLS: &'static [DrmIoctlDescriptor];
    const USE_VTABLE_ATTR: ();
    const FEAT_RENDER: bool = false;
}
Expand description

The DRM Driver trait.

This trait must be implemented by drivers in order to create a struct drm_device and struct drm_driver to be registered in the DRM subsystem.

Required Associated Constants§

Source

const INFO: DriverInfo

Driver metadata

Source

const IOCTLS: &'static [DrmIoctlDescriptor]

IOCTL list. See kernel::drm::ioctl::declare_drm_ioctls!{}.

Source

const USE_VTABLE_ATTR: ()

A marker to prevent implementors from forgetting to use #[vtable] attribute when implementing this trait.

Provided Associated Constants§

Source

const FEAT_RENDER: bool = false

Sets the DRIVER_RENDER feature for this driver.

When enabled, the driver exposes /dev/dri/renderDXX render nodes to userspace. The render node is an alternate low-priviledge way to access the driver, which is enforced on a per-ioctl level. Userspace processes that open the render node can only invoke ioctls explicitly listed as usable from the render node (i.e. marked DRM_RENDER_ALLOW), whereas userspace processes using the master node can invoke any ioctl.

Required Associated Types§

Source

type Data: Sync + Send

Context data associated with the DRM driver

Source

type Object<Ctx: DeviceContext>: AllocImpl

The type used to manage memory for this driver.

Source

type File: DriverFile

The type used to represent a DRM File (client)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§