Struct gbm::Device

source ·
pub struct Device<T: AsRawFd + 'static> { /* private fields */ }
Expand description

An open GBM device

Implementations§

Open a GBM device from a given unix file descriptor.

The file descriptor passed in is used by the backend to communicate with platform for allocating the memory. For allocations using DRI this would be the file descriptor returned when opening a device such as /dev/dri/card0.

Unsafety

The lifetime of the resulting device depends on the ownership of the file descriptor. Closing the file descriptor before dropping the Device will lead to undefined behavior.

Open a GBM device from a given open DRM device.

The underlying file descriptor passed in is used by the backend to communicate with platform for allocating the memory. For allocations using DRI this would be the file descriptor returned when opening a device such as /dev/dri/card0.

Get the backend name

Test if a format is supported for a given set of usage flags

Allocate a new surface object

Allocate a buffer object for the given dimensions

Create a gbm buffer object from a wayland buffer

This function imports a foreign WlBuffer object and creates a new gbm buffer object for it. This enabled using the foreign object with a display API such as KMS.

The gbm bo shares the underlying pixels but its life-time is independent of the foreign object.

Create a gbm buffer object from an egl buffer

This function imports a foreign EGLImage object and creates a new gbm buffer object for it. This enabled using the foreign object with a display API such as KMS.

The gbm bo shares the underlying pixels but its life-time is independent of the foreign object.

Unsafety

The given EGLImage is a raw pointer. Passing null or an invalid EGLImage will cause undefined behavior.

Create a gbm buffer object from an dma buffer

This function imports a foreign dma buffer from an open file descriptor and creates a new gbm buffer object for it. This enabled using the foreign object with a display API such as KMS.

The gbm bo shares the underlying pixels but its life-time is independent of the foreign object.

Trait Implementations§

Receive a raw pointer representing this type.
Extracts the raw file descriptor. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Generates and returns a magic token unique to the current process. Read more
Tells the DRM device whether we understand or do not understand a particular capability. Read more
Attempts to acquire the DRM Master lock.
Attempts to release the DRM Master lock.
Attaches a framebuffer to a CRTC’s built-in plane, attaches the CRTC to a connector, and sets the CRTC’s mode to output the pixel data. Read more
Creates a framebuffer from a Buffer, returning framebuffer::Info. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.