Struct gbm::Device
[−]
[src]
pub struct Device<T: AsRawFd + 'static> { /* fields omitted */ }
An open GBM device
Methods
impl Device<FdWrapper>
[src]
unsafe fn new_from_fd(fd: RawFd) -> IoResult<Device<FdWrapper>>
[src]
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.
impl<T: AsRawFd + 'static> Device<T>
[src]
fn new(fd: T) -> IoResult<Device<T>>
[src]
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.
fn backend_name(&self) -> &str
[src]
Get the backend name
fn is_format_supported(&self, format: Format, usage: BufferObjectFlags) -> bool
[src]
Test if a format is supported for a given set of usage flags
fn create_surface<U: 'static>(
&self,
width: u32,
height: u32,
format: Format,
usage: BufferObjectFlags
) -> IoResult<Surface<U>>
[src]
&self,
width: u32,
height: u32,
format: Format,
usage: BufferObjectFlags
) -> IoResult<Surface<U>>
Allocate a new surface object
fn create_buffer_object<U: 'static>(
&self,
width: u32,
height: u32,
format: Format,
usage: BufferObjectFlags
) -> IoResult<BufferObject<U>>
[src]
&self,
width: u32,
height: u32,
format: Format,
usage: BufferObjectFlags
) -> IoResult<BufferObject<U>>
Allocate a buffer object for the given dimensions
fn import_buffer_object_from_wayland<U: 'static>(
&self,
buffer: &WlBuffer,
usage: BufferObjectFlags
) -> IoResult<BufferObject<U>>
[src]
&self,
buffer: &WlBuffer,
usage: BufferObjectFlags
) -> IoResult<BufferObject<U>>
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.
unsafe fn import_buffer_object_from_egl<U: 'static>(
&self,
buffer: EGLImage,
usage: BufferObjectFlags
) -> IoResult<BufferObject<U>>
[src]
&self,
buffer: EGLImage,
usage: BufferObjectFlags
) -> IoResult<BufferObject<U>>
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.
fn import_buffer_object_from_dma_buf<U: 'static>(
&self,
buffer: RawFd,
width: u32,
height: u32,
stride: u32,
format: Format,
usage: BufferObjectFlags
) -> IoResult<BufferObject<U>>
[src]
&self,
buffer: RawFd,
width: u32,
height: u32,
stride: u32,
format: Format,
usage: BufferObjectFlags
) -> IoResult<BufferObject<U>>
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
impl<T: AsRawFd + 'static> AsRawFd for Device<T>
[src]
impl<T: AsRawFd + 'static> AsRaw<gbm_device> for Device<T>
[src]
fn as_raw(&self) -> *const gbm_device
[src]
Receive a raw pointer representing this type.
impl<T: AsRawFd + 'static> Deref for Device<T>
[src]
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &T
[src]
Dereferences the value.
impl<T: AsRawFd + 'static> DerefMut for Device<T>
[src]
impl<T: DrmDevice + AsRawFd + 'static> DrmDevice for Device<T>
[src]
fn get_auth_token(&self) -> Result<AuthToken, Error>
[src]
Generates and returns a magic token unique to the current process. Read more
fn set_client_cap(&self, cap: ClientCapability, set: bool) -> Result<(), Error>
[src]
Tells the DRM device whether we understand or do not understand a particular capability. Read more
fn set_master(&self) -> Result<(), Error>
[src]
Attempts to acquire the DRM Master lock.
fn drop_master(&self) -> Result<(), Error>
[src]
Attempts to release the DRM Master lock.
impl<T: DrmControlDevice + AsRawFd + 'static> DrmControlDevice for Device<T>
[src]
fn resource_handles(&self) -> Result<ResourceHandles, Error>
[src]
See [ResourceHandles::load_from_device
] Read more
fn plane_handles(&self) -> Result<PlaneResourceHandles, Error>
[src]
See [PlaneResourceHandles::load_from_device
] Read more
fn resource_info<T>(
&self,
handle: <T as ResourceInfo>::Handle
) -> Result<T, Error> where
T: ResourceInfo,
[src]
&self,
handle: <T as ResourceInfo>::Handle
) -> Result<T, Error> where
T: ResourceInfo,
See [ResourceInfo::load_from_device
] Read more
fn set_crtc(
&self,
crtc: Handle,
fb: Handle,
cons: &[Handle],
position: (u32, u32),
mode: Option<Mode>
) -> Result<(), Error>
[src]
&self,
crtc: Handle,
fb: Handle,
cons: &[Handle],
position: (u32, u32),
mode: Option<Mode>
) -> Result<(), Error>
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
fn create_framebuffer<U>(&self, buffer: &U) -> Result<Info, Error> where
U: Buffer,
[src]
U: Buffer,
Creates a framebuffer from a [Buffer
], returning [framebuffer::Info
]. Read more