Struct drm::Device [] [src]

pub struct Device { /* fields omitted */ }

Open fd for a dri device. Such as /dev/dri/card0.

Methods

impl Device
[src]

List the cards found at the "Usual place" (/dev/dri).

This is mostly for convienience. It's simply iterating over: /dev/dri/card*

A more nuanced solution might need to be implemented. Such as support control and render nodes.

Opens a card at a particular path.

Grab the first card availble (by filename order), this is probably not what you want to do. Except when:

  • You have a stupid demo application (like the ones in ../examples)
  • Fallback for a configurable program that is not configured.
  • You have a completely bespoke system and you know which card should be there. (eg embedded systems)

(i.e don't be asinine and force future users to use hacks to make your program work on multicard systems)

Set this process to be the current card master.

Returns a Guard that will unset master on drop. The card master can set the mode of the device and can update the frame buffer.

Returns a Invalid Arguement error (ErrorKind::InvalidInput) when another process already is already card master.

Get driver version information.

Fetches the busid of the card.

Dev notes: on my system this is an empty string. In xf86drm.h there are functions that use this string to open the device. I assume it might be realted to path names in /sys/.

Request a vblank event, that can be late read by an read_event.

crtc_num is the index of the CRTC id returned by Resources::crtcs.

Reads the next available event.

Errors

  • If no events are availble an error with kind ErrorKind::WouldBlock is returned.
  • If a syscall is interrupted ErrorKind::Interrupted
  • If suprising data is returned ErrorKind::InvalidData.
  • Any other io:Error from the kernel.

Trait Implementations

impl Debug for Device
[src]

Formats the value using the given formatter.

impl AsRawFd for Device
[src]

Extracts the raw file descriptor. Read more

impl IntoRawFd for Device
[src]

Consumes this object, returning the raw underlying file descriptor. Read more

impl FromRawFd for Device
[src]

Constructs a new instances of Self from the given raw file descriptor. Read more