Skip to main content

Driver

Trait Driver 

Source
pub trait Driver {
    type Data: Sync + Send;
    type RegistrationData<'a>: Send + Sync + 'a;
    type Object: AllocImpl;
    type File: DriverFile;
    type ParentDevice<Ctx: DeviceContext>: AsBusDevice<Ctx>;
    type OwnerModule: ModuleMetadata;

    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-privilege 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 RegistrationData<'a>: Send + Sync + 'a

Data owned by the Registration and accessible within a RegistrationGuard critical section via Device::registration_data_with().

The lifetime parameter is tied to the Registration scope, which is enclosed in the parent bus device binding scope but may be shorter.

Source

type Object: AllocImpl

The type used to manage memory for this driver.

Source

type File: DriverFile

The type used to represent a DRM File (client)

Source

type ParentDevice<Ctx: DeviceContext>: AsBusDevice<Ctx>

The bus device type of the parent device that the DRM device is associated with.

Source

type OwnerModule: ModuleMetadata

The module implementing this vtable trait.

Automatically set to crate::LocalModule by the #[vtable] impl macro.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§