Struct smithay::backend::drm::DrmDevice [−][src]
pub struct DrmDevice<A: AsRawFd + 'static> { /* fields omitted */ }
Expand description
An open drm device
Implementations
Create a new DrmDevice
from an open drm node
Arguments
fd
- Open drm nodedisable_connectors
- Setting this to true will initialize all connectors
as disabled on device creation. smithay enables connectors, when attached
to a surface, and disables them, when detached. Setting this tofalse
requires usage ofdrm-rs
to disable unused connectors to prevent them
showing garbage, but will also prevent flickering of already turned on
connectors (assuming you won’t change the resolution).logger
- Optionalslog::Logger
to be used by this device.
Return
Returns an error if the file is no valid drm node or the device is not accessible.
Returns if the underlying implementation uses atomic-modesetting or not.
Returns a set of available planes for a given crtc
pub fn create_surface(
&self,
crtc: Handle,
mode: Mode,
connectors: &[Handle]
) -> Result<DrmSurface<A>, Error>
pub fn create_surface(
&self,
crtc: Handle,
mode: Mode,
connectors: &[Handle]
) -> Result<DrmSurface<A>, Error>
Creates a new rendering surface.
Arguments
Initialization of surfaces happens through the types provided by
drm-rs
.
crtcs
represent scanout engines of the device pointing to one framebuffer.
Their responsibility is to read the data of the framebuffer and export it into an “Encoder”.
The number of crtc’s represent the number of independent output devices the hardware may handle.mode
describes the resolution and rate of images produced by the crtc and
has to be compatible with the providedconnectors
.connectors
- List of connectors driven by the crtc. At least one(!) connector needs to be
attached to a crtc in smithay.
Trait Implementations
type Error = SystemError
type Error = SystemError
Error type thrown if allocations fail
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
fn add_framebuffer<B>(
&self,
buffer: &B,
depth: u32,
bpp: u32
) -> Result<Handle, SystemError> where
B: Buffer + ?Sized,
fn add_framebuffer<B>(
&self,
buffer: &B,
depth: u32,
bpp: u32
) -> Result<Handle, SystemError> where
B: Buffer + ?Sized,
Add a new framebuffer
fn add_planar_framebuffer<B>(
&self,
planar_buffer: &B,
modifiers: &[Option<DrmModifier>; 4],
flags: u32
) -> Result<Handle, SystemError> where
B: PlanarBuffer + ?Sized,
fn add_planar_framebuffer<B>(
&self,
planar_buffer: &B,
modifiers: &[Option<DrmModifier>; 4],
flags: u32
) -> Result<Handle, SystemError> where
B: PlanarBuffer + ?Sized,
Add framebuffer (with modifiers)
fn dirty_framebuffer(
&self,
handle: Handle,
clips: &[drm_clip_rect]
) -> Result<(), SystemError>
fn dirty_framebuffer(
&self,
handle: Handle,
clips: &[drm_clip_rect]
) -> Result<(), SystemError>
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.
fn set_property<T>(
&self,
handle: T,
prop: Handle,
value: u64
) -> Result<(), SystemError> where
T: ResourceHandle,
fn set_property<T>(
&self,
handle: T,
prop: Handle,
value: u64
) -> Result<(), SystemError> where
T: ResourceHandle,
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 Mode
s that a particular connector supports.
fn get_properties<T>(&self, handle: T) -> Result<PropertyValueSet, SystemError> where
T: ResourceHandle,
fn get_properties<T>(&self, handle: T) -> Result<PropertyValueSet, SystemError> where
T: ResourceHandle,
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
fn create_dumb_buffer(
&self,
size: (u32, u32),
format: DrmFourcc,
bpp: u32
) -> Result<DumbBuffer, SystemError>
fn create_dumb_buffer(
&self,
size: (u32, u32),
format: DrmFourcc,
bpp: u32
) -> Result<DumbBuffer, SystemError>
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
fn set_cursor<B>(
&self,
crtc: Handle,
buffer: Option<&B>
) -> Result<(), SystemError> where
B: Buffer + ?Sized,
fn set_cursor<B>(
&self,
crtc: Handle,
buffer: Option<&B>
) -> Result<(), SystemError> where
B: Buffer + ?Sized,
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
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
Usage of deprecated ioctl move_cursor: use a cursor plane instead
Moves a set cursor on a given crtc
fn atomic_commit(
&self,
flags: &[AtomicCommitFlags],
req: AtomicModeReq
) -> Result<(), SystemError>
fn atomic_commit(
&self,
flags: &[AtomicCommitFlags],
req: AtomicModeReq
) -> Result<(), SystemError>
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
fn page_flip(
&self,
handle: Handle,
framebuffer: Handle,
flags: &[PageFlipFlags],
target: Option<PageFlipTarget>
) -> Result<(), SystemError>
fn page_flip(
&self,
handle: Handle,
framebuffer: Handle,
flags: &[PageFlipFlags],
target: Option<PageFlipTarget>
) -> Result<(), SystemError>
Queue a page flip on the given crtc
Receive pending events
Acquires the DRM Master lock for this process. Read more
Releases the DRM Master lock for another process to use.
Authenticates an AuthToken
from another process.
fn set_client_capability(
&self,
cap: ClientCapability,
enable: bool
) -> Result<(), SystemError>
fn set_client_capability(
&self,
cap: ClientCapability,
enable: bool
) -> Result<(), SystemError>
Requests the driver to expose or hide certain capabilities. See
ClientCapability
for more information. Read more
Gets the BusID
of this device.
Gets the value of a capability.
Possible errors: Read more
Auto Trait Implementations
impl<A> !RefUnwindSafe for DrmDevice<A>
impl<A> !UnwindSafe for DrmDevice<A>
Blanket Implementations
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
pub fn vzip(self) -> V