class ImportedImage

Defined at line 23 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.h

State associated with an image in an imported sysmem buffer.

Public Methods

zx::result<ImportedImage> Create (const zx::bti & bti, zx::vmo & image_vmo, uint64_t image_vmo_offset, size_t image_size, virtio_abi::ResourceFormat resource_format, uint32_t stride)

Creates an instance without an associated virtio resource ID.

`bti` must be valid for the duration of the call. `image_vmo` must point to

a valid VMO whose size is at least image_vmo_offset + image_size.

Defined at line 27 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.cc

void ImportedImage (const ImportedImage & )

Defined at line 42 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.h

ImportedImage & operator= (const ImportedImage & )

Defined at line 43 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.h

void ImportedImage (ImportedImage && rhs)

Defined at line 45 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.h

ImportedImage CreateEmpty ()

Creates an instance representing the image moved-out state.

Defined at line 54 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.cc

ImportedImage & operator= (ImportedImage && rhs)

Defined at line 57 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.h

void ImportedImage (zx_paddr_t physical_address, zx::pmt pinned_memory_token, uint32_t virtio_resource_id, virtio_abi::ResourceFormat resource_format, uint32_t stride)

Exposed for testing. Production code must use Create*() factory methods.

Defined at line 58 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.cc

void ~ImportedImage ()

Defined at line 69 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.cc

zx_paddr_t physical_address ()

The starting physical address of the image's pixel data.

The image's pixel data is stored in continuous memory.

Defined at line 75 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.h

uint32_t virtio_resource_id ()

The virtio resource ID used to attach this image.

Defined at line 78 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.h

virtio_abi::ResourceFormat resource_format ()

Defined at line 80 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.h

size_t RoundedUpImageSize (size_t original_image_size)

Rounds up the given size to the system's page size.

Defined at line 80 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.cc

uint32_t stride ()

Defined at line 82 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.h

ImportedImage & set_virtio_resource_id (uint32_t virtio_resource_id)

See `virtio_resource_id()` for details.

`virtio_resource_id` must be attached while it is used in this instance.

TODO(costan): Use a RAII handle for `virtio_resource_id` that

auto-detaches and releases the resource on destruction.

`VirtioImageResource` seems like a good name.

Defined at line 91 of file ../../src/graphics/display/drivers/virtio-gpu-display/imported-image.h