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>;
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§
Sourceconst INFO: DriverInfo
const INFO: DriverInfo
Driver metadata
Sourceconst IOCTLS: &'static [DrmIoctlDescriptor]
const IOCTLS: &'static [DrmIoctlDescriptor]
IOCTL list. See kernel::drm::ioctl::declare_drm_ioctls!{}.
Sourceconst USE_VTABLE_ATTR: ()
const USE_VTABLE_ATTR: ()
A marker to prevent implementors from forgetting to use #[vtable]
attribute when implementing this trait.
Provided Associated Constants§
Sourceconst FEAT_RENDER: bool = false
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§
Sourcetype RegistrationData<'a>: Send + Sync + 'a
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.
Sourcetype File: DriverFile
type File: DriverFile
The type used to represent a DRM File (client)
Sourcetype ParentDevice<Ctx: DeviceContext>: AsBusDevice<Ctx>
type ParentDevice<Ctx: DeviceContext>: AsBusDevice<Ctx>
The bus device type of the parent device that the DRM device is associated with.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".