pub struct Gfxstream {
    _cookie: Box<RutabagaCookie>,
}
Expand description

The virtio-gpu backend state tracker which supports accelerated rendering.

Fields§

§_cookie: Box<RutabagaCookie>

Cookie used by Gfxstream, should be held as long as the renderer is alive.

Implementations§

source§

impl Gfxstream

source

pub fn init( display_width: u32, display_height: u32, gfxstream_flags: GfxstreamFlags, gfxstream_features: Option<String>, fence_handler: RutabagaFenceHandler, debug_handler: Option<RutabagaDebugHandler> ) -> RutabagaResult<Box<dyn RutabagaComponent>>

source

fn map_info(&self, resource_id: u32) -> RutabagaResult<u32>

source

fn vulkan_info(&self, resource_id: u32) -> RutabagaResult<VulkanInfo>

source

fn export_blob(&self, resource_id: u32) -> RutabagaResult<Arc<RutabagaHandle>>

Trait Implementations§

source§

impl Drop for Gfxstream

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl RutabagaComponent for Gfxstream

source§

fn get_capset_info(&self, capset_id: u32) -> (u32, u32)

Implementations should return the version and size of the given capset_id. (0, 0) is returned by default.
source§

fn get_capset(&self, capset_id: u32, version: u32) -> Vec<u8>

Implementations should return the capabilites of given a capset_id and version. A zero-sized array is returned by default.
source§

fn create_fence(&mut self, fence: RutabagaFence) -> RutabagaResult<()>

Implementations must create a fence that represents the completion of prior work. This is required for synchronization with the guest kernel.
source§

fn create_3d( &self, resource_id: u32, resource_create_3d: ResourceCreate3D ) -> RutabagaResult<RutabagaResource>

Implementations must create a resource with the given metadata. For 2D rutabaga components, this a system memory allocation. For 3D components, this is typically a GL texture or buffer. Vulkan components should use blob resources instead.
source§

fn attach_backing( &self, resource_id: u32, vecs: &mut Vec<RutabagaIovec> ) -> RutabagaResult<()>

Implementations must attach vecs to the resource.
source§

fn detach_backing(&self, resource_id: u32)

Implementations must detach vecs from the resource.
source§

fn unref_resource(&self, resource_id: u32)

Implementations must release the guest kernel reference on the resource.
source§

fn transfer_write( &self, ctx_id: u32, resource: &mut RutabagaResource, transfer: Transfer3D ) -> RutabagaResult<()>

Implementations must perform the transfer write operation. For 2D rutabaga components, this done via memcpy(). For 3D components, this is typically done via glTexSubImage(..).
source§

fn transfer_read( &self, ctx_id: u32, resource: &mut RutabagaResource, transfer: Transfer3D, buf: Option<IoSliceMut<'_>> ) -> RutabagaResult<()>

Implementations must perform the transfer read operation. For 2D rutabaga components, this done via memcpy(). For 3D components, this is typically done via glReadPixels(..).
source§

fn resource_flush(&self, resource: &mut RutabagaResource) -> RutabagaResult<()>

Implementations must flush the given resource to the display.
source§

fn create_blob( &mut self, ctx_id: u32, resource_id: u32, resource_create_blob: ResourceCreateBlob, iovec_opt: Option<Vec<RutabagaIovec>>, handle_opt: Option<RutabagaHandle> ) -> RutabagaResult<RutabagaResource>

Implementations must create a blob resource on success. The memory parameters, size, and usage of the blob resource is given by resource_create_blob.
source§

fn map(&self, resource_id: u32) -> RutabagaResult<RutabagaMapping>

Implementations must map the blob resource on success. This is typically done by glMapBufferRange(…) or vkMapMemory.
source§

fn unmap(&self, resource_id: u32) -> RutabagaResult<()>

Implementations must unmap the blob resource on success. This is typically done by glUnmapBuffer(…) or vkUnmapMemory.
source§

fn create_context( &self, ctx_id: u32, context_init: u32, context_name: Option<&str>, fence_handler: RutabagaFenceHandler ) -> RutabagaResult<Box<dyn RutabagaContext>>

Implementations must create a context for submitting commands. The command stream of the context is determined by context_init. For virgl contexts, it is a Gallium/TGSI command stream. For gfxstream contexts, it’s an autogenerated Vulkan or GLES streams.
source§

fn force_ctx_0(&self)

Implementations should set their internal context to be the reserved context 0.
source§

fn event_poll(&self)

Used only by VirglRenderer to poll when its poll_descriptor is signaled.
source§

fn poll_descriptor(&self) -> Option<SafeDescriptor>

Used only by VirglRenderer to return a poll_descriptor that is signaled when a poll() is necessary.
source§

fn export_fence(&self, _fence_id: u64) -> RutabagaResult<RutabagaHandle>

Implementations must return a RutabagaHandle of the fence on success.
source§

fn snapshot(&self, _directory: &str) -> RutabagaResult<()>

Implementations must snapshot to the specified directory
source§

fn restore(&self, _directory: &str) -> RutabagaResult<()>

Implementations must restore from the specified directory

Auto Trait Implementations§

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>,

§

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>,

§

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.