Module Drm.Device

Graphics devices.

type t = Unix.file_descr

Typically a device inside the /dev/dri/ directory.

Use list to find devices.

Finding devices

module Info : sig ... end
val list : ?get_pci_revision:bool -> unit -> Info.t list

list () returns available graphics devices.

  • parameter get_pci_revision

    If false, skip getting the PCI device revision field. The default is true.

Querying devices

module Version : sig ... end

Metadata about a device driver.

val is_kms : t -> bool

Whether this device supports the Kms API.

val check_modesetting_supported : string -> (unit, Unix.error) Stdlib.result

check_modesetting_supported busid checks if a modesetting capable driver has attached to the PCI ID busid.

Returns Unix.EINVAL for invalid bus id and Unix.ENOSYS if no modesetting support.

DRM masters

val is_master : t -> bool

Whether this device is currently the DRM master.

val drop_master : t -> unit

Give up being DRM master for now.

This allows the user to switch away to another VT.

val set_master : t -> unit

Become the DRM master.

This can only be called if t has been the master in the past or you have CAP_SYS_ADMIN, and if there is no current master. Opening a DRM device without a master makes you the master. This function is useful to become the master again after a VT switch.