Struct VirtIOGPU

Source
pub struct VirtIOGPU<'a, 'b> { /* private fields */ }
Expand description

Driver for a VirtIO GPUDevice-class device.

Implements Tock’s Screen HIL, and supports a single head with the ARGB_8888 pixel mode.

Implementations§

Source§

impl<'a, 'b> VirtIOGPU<'a, 'b>

Source

pub fn new( control_queue: &'a SplitVirtqueue<'a, 'b, 2>, req_buffer: &'b mut [u8; 56], resp_buffer: &'b mut [u8; 24], width: usize, height: usize, ) -> Result<VirtIOGPU<'a, 'b>, ErrorCode>

Source

pub fn initialize(&self) -> Result<(), ErrorCode>

Trait Implementations§

Source§

impl DeferredCallClient for VirtIOGPU<'_, '_>

Source§

fn register(&'static self)

Source§

fn handle_deferred_call(&self)

Software interrupt function that is called when the deferred call is triggered.
Source§

impl<'a> Screen<'a> for VirtIOGPU<'a, '_>

Source§

fn set_client(&self, client: &'a dyn ScreenClient)

Set the object to receive the asynchronous command callbacks.
Source§

fn get_resolution(&self) -> (usize, usize)

Get a tuple (width, height) with the current resolution (in pixels). Read more
Source§

fn get_pixel_format(&self) -> ScreenPixelFormat

Get the current pixel format. Read more
Source§

fn get_rotation(&self) -> ScreenRotation

Get the current rotation. Read more
Source§

fn set_write_frame( &self, x: usize, y: usize, width: usize, height: usize, ) -> Result<(), ErrorCode>

Sets the write frame. Read more
Source§

fn write( &self, buffer: SubSliceMut<'static, u8>, continue_write: bool, ) -> Result<(), ErrorCode>

Write data from buffer to the selected write frame. Read more
Source§

fn set_brightness(&self, _brightness: u16) -> Result<(), ErrorCode>

Set the display brightness value. Read more
Source§

fn set_power(&self, enabled: bool) -> Result<(), ErrorCode>

Controls the screen power supply. Read more
Source§

fn set_invert(&self, _enabled: bool) -> Result<(), ErrorCode>

Controls the color inversion mode. Read more
Source§

impl<'b> SplitVirtqueueClient<'b> for VirtIOGPU<'_, 'b>

Source§

fn buffer_chain_ready( &self, _queue_number: u32, buffer_chain: &mut [Option<VirtqueueBuffer<'b>>], bytes_used: usize, )

Source§

impl VirtIODeviceDriver for VirtIOGPU<'_, '_>

Source§

fn negotiate_features(&self, _offered_features: u64) -> Option<u64>

VirtIO feature negotiation. Read more
Source§

fn device_type(&self) -> VirtIODeviceType

VirtIO device type which the driver supports. Read more
Source§

fn pre_device_initialization(&self) -> Result<(), ErrorCode>

Hook called before the transport indicates DRIVER_OK to the device. Read more
Source§

fn device_initialized(&self) -> Result<(), ErrorCode>

Hook called after the transport indicated DRIVER_OK to the device. Read more

Auto Trait Implementations§

§

impl<'a, 'b> !Freeze for VirtIOGPU<'a, 'b>

§

impl<'a, 'b> !RefUnwindSafe for VirtIOGPU<'a, 'b>

§

impl<'a, 'b> !Send for VirtIOGPU<'a, 'b>

§

impl<'a, 'b> !Sync for VirtIOGPU<'a, 'b>

§

impl<'a, 'b> Unpin for VirtIOGPU<'a, 'b>

§

impl<'a, 'b> !UnwindSafe for VirtIOGPU<'a, 'b>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.