[go: up one dir, main page]

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.

Safety

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 new surface object with explicit modifiers

Allocate a new surface object with explicit modifiers and flags

Allocate a buffer object for the given dimensions

Allocate a buffer object for the given dimensions with explicit modifiers

Allocate a buffer object for the given dimensions with explicit modifiers and flags

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 enables 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 enables 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.

Safety

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

Create a GBM buffer object from a dma buffer

This function imports a foreign dma buffer from an open file descriptor and creates a new GBM buffer object for it. This enables 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 a dma buffer with explicit modifiers

This function imports a foreign dma buffer from an open file descriptor and creates a new GBM buffer object for it. This enables 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Acquires the DRM Master lock for this process. Read more

Releases the DRM Master lock for another process to use.

👎Deprecated:

Consider opening a render node instead.

Generates an AuthToken for this process.

Authenticates an AuthToken from another process.

Requests the driver to expose or hide certain capabilities. See ClientCapability for more information. Read more

Gets the [BusID] of this device.

Check to see if our AuthToken has been authenticated by the DRM Master Read more

Gets the value of a capability.

Possible errors: Read more

Waits for a vblank.

Gets the set of resource handles that this device currently controls

Gets the set of plane handles that this device currently has

Returns information about a specific connector

Returns information about a specific encoder

Returns information about a specific CRTC

Set CRTC state

Returns information about a specific framebuffer

Returns information about a specific framebuffer (with modifiers)

Add a new framebuffer

Add framebuffer (with modifiers)

Mark parts of a framebuffer dirty

Destroy a framebuffer

Returns information about a specific plane

Set plane state. Read more

Returns information about a specific property.

Sets a property for a specific resource.

Create a property blob value from a given data blob

Get a property blob’s data

Destroy a given property blob value

Returns the set of Modes that a particular connector supports.

Gets a list of property handles and values for this resource.

Receive the currently set gamma ramp of a crtc

Set a gamma ramp for the given crtc

Open a GEM buffer handle by name

Close a GEM buffer handle

Create a new dumb buffer with a given size and pixel format

Map the buffer for access

Free the memory resources of a dumb buffer

👎Deprecated:

Usage of deprecated ioctl set_cursor: use a cursor plane instead

Sets a hardware-cursor on the given crtc with the image of a given buffer Read more

👎Deprecated:

Usage of deprecated ioctl set_cursor2: use a cursor plane instead

Sets a hardware-cursor on the given crtc with the image of a given buffer and a hotspot marking the click point of the cursor. Read more

👎Deprecated:

Usage of deprecated ioctl move_cursor: use a cursor plane instead

Moves a set cursor on a given crtc

Request an atomic commit with given flags and property-value pair for a list of objects.

Convert a prime file descriptor to a GEM buffer handle

Convert a prime file descriptor to a GEM buffer handle

Queue a page flip on the given crtc

Receive pending events

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

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. 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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.