Struct drm::Master
[−]
[src]
pub struct Master<'a> { /* fields omitted */ }
Represents a card when the process is the card master.
Only one process can control modesetting of a card. To do this
they use a DRM_IOCTL_SET_MASTER
. If it successful modesetting,
calls can be performed until DRM_IOCTL_UNSET_MASTER
, is
called or the process exits.
This object is created when Device::set_master
is called and
when dropped, it will make the Unset call.
Due to some mutability constraits this also implements DerefMut
for the associated card.
(Essentailly it used to be impossible to read events and have card master
at the same time, because Read
requires mutable access).
Methods
impl<'a> Master<'a>
[src]
fn set_crtc(&self,
crtc_id: Id<Crtc>,
fb: Option<Id<Fb>>,
x: u32,
y: u32,
connectors: &[Id<Connector>],
mode: Option<&ModeInfo>)
-> Result<()>
crtc_id: Id<Crtc>,
fb: Option<Id<Fb>>,
x: u32,
y: u32,
connectors: &[Id<Connector>],
mode: Option<&ModeInfo>)
-> Result<()>
Set the mode, and the frame buffer.
The driver will pick a path from the given crtc to the given connectors.
Methods from Deref<Target=Device>
fn set_master<'a>(&'a mut self) -> Result<Master<'a>>
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.
fn version(&self) -> Result<Version>
Get driver version information.
fn get_resources(&self) -> Result<Resources>
fn get<T: Resource>(&self, id: Id<T>) -> Result<T>
fn busid(&self) -> Result<String>
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/
.
fn request_vblank(&self, data: usize, crtc_num: u32) -> Result<()>
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
.
fn read_event(&mut self) -> Result<Event>
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<'a> Debug for Master<'a>
[src]
impl<'a> Deref for Master<'a>
[src]
type Target = Device
The resulting type after dereferencing
fn deref(&self) -> &Device
The method called to dereference a value