Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.goldfish

PROTOCOLS

AddressSpaceChildDriver

Defined in fuchsia.hardware.goldfish/goldfish_address_space.fidl

AllocateBlock

Request

NameType
size uint64

Response

NameType
res zx/status
paddr uint64
vmo handle<vmo>?

ClaimSharedBlock

Request

NameType
offset uint64
size uint64

Response

NameType
res zx/status
vmo handle<vmo>?

DeallocateBlock

Request

NameType
paddr uint64

Response

NameType
res zx/status

Ping

Request

NameType
ping AddressSpaceChildDriverPingMessage

Response

NameType
res zx/status
ping AddressSpaceChildDriverPingMessage

UnclaimSharedBlock

Request

NameType
offset uint64

Response

NameType
res zx/status

AddressSpaceDevice

Defined in fuchsia.hardware.goldfish/goldfish_address_space.fidl

OpenChildDriver

Request

NameType
type AddressSpaceChildDriverType
req request<AddressSpaceChildDriver>

ControlDevice

Defined in fuchsia.hardware.goldfish/goldfish_control.fidl

Interface for the Goldfish control driver providing color buffers and data buffers.

CreateBuffer

Create shared data buffer. Buffer is automatically freed when all references to vmo have been closed. Fails if VMO is not associated with goldfish heap memory.

Returns ZX_ERR_ALREADY_EXISTS if a buffer or color buffer has already been created for this VMO.

Request

NameType
vmo handle<vmo>
size uint32

Response

NameType
res zx/status

CreateBuffer2

Create shared data buffer. Buffer is automatically freed when all references to vmo have been closed. Fails if VMO is not associated with goldfish heap memory.

Arguments Refer to CreateBuffer2Params for input arguments.

Return value Error: - ZX_ERR_ALREADY_EXISTS if a buffer or color buffer has already been created for this VMO. - ZX_ERR_INVALID_ARGS if arguments are invalid. (see CreateBuffer2Params)

 `hw_address_page_offset`:
     Memory page offset of the buffer's hardware-mapped memory.
     For buffers with HOST_VISIBLE memory property bits, this
     value is a non-negative integer in [0, 4095]. For
     non-HOST_VISIBLE memory, this value is negative.

Request

NameType
vmo handle<vmo>
create_params CreateBuffer2Params

Response

NameType
result ControlDevice_CreateBuffer2_Result

CreateColorBuffer2

Create shared color buffer. Color buffer is automatically freed when all references to vmo have been closed. Fails if VMO is not associated with goldfish heap memory.

Arguments Refer to CreateColorBuffer2Params for input arguments.

Return value res: ZX_ERR_ALREADY_EXISTS if a buffer or color buffer has already been created for this VMO. ZX_ERR_INVALID_ARGS if arguments are invalid. (see CreateColorBuffer2Params) Otherwise returns ZX_OK. hw_address_page_offset: memory page offset of the buffer's hardware-mapped memory. For color buffers with HOST_VISIBLE memory property bits, this value is a non-negative integer in [0, 4095]. For non-HOST_VISIBLE memory or failed allocation, this value is negative.

Request

NameType
vmo handle<vmo>
create_params CreateColorBuffer2Params

Response

NameType
res zx/status
hw_address_page_offset int32

GetBufferHandle

Get a buffer handle for VMO and the type of the handle. Fails if VMO is not associated with neither a color buffer nor a buffer.

Request

NameType
vmo handle<vmo>

Response

NameType
res zx/status
id uint32
type BufferHandleType

Pipe

Defined in fuchsia.hardware.goldfish/goldfish_pipe.fidl

DoCall

Writes count bytes from the IO buffer at specified write offset. Returns ZX_ERR_SHOULD_WAIT if pipe device is not writable.

If it writes to device successfully, it subsequently reads read_count bytes into the IO buffer at specified read_offset. Returns ZX_ERR_SHOULD_WAIT if pipe device is not readable.

Return value actual is the total bytes read from and written to the IO buffer.

The name "DoCall" (instead of "Call") is to avoid collision with LLCPP generated code "class Call" (generated per protocol). We don't want this method attempting to compile as if it were a constructor.

Request

NameType
count uint64
offset uint64
read_count uint64
read_offset uint64

Response

NameType
res zx/status
actual uint64

GetBuffer

Acquire VMO for IO buffer. Can be called multiple times. Each call returns a new handle to the VMO.

Request

NameType

Response

NameType
res zx/status
vmo handle<vmo>?

Read

Attempt to read up to count bytes into IO buffer at specified offset. Returns ZX_ERR_SHOULD_WAIT if pipe device is not readable.

Request

NameType
count uint64
offset uint64

Response

NameType
res zx/status
actual uint64

SetBufferSize

Request new IO buffer size. Can fail if out of memory. Discards contents of existing buffer on success. Leaves existing buffer intact on failure.

Request

NameType
size uint64

Response

NameType
res zx/status

SetEvent

Set event used to signal device state. Discards existing event after having transferred device state to the new event.

Request

NameType
event handle<event>

Write

Writes up to count bytes from the IO buffer at specified offset. Returns ZX_ERR_SHOULD_WAIT if pipe device is not writable.

Request

NameType
count uint64
offset uint64

Response

NameType
res zx/status
actual uint64

PipeDevice

Defined in fuchsia.hardware.goldfish/goldfish_pipe.fidl

Interface for the Goldfish pipe driver.

OpenPipe

Open pipe. A protocol request pipe_request provides an interface to the pipe. Multiple pipes can be opened for a single device. Closing the device connection will also close all pipe connections. TODO(fxbug.dev/6547): Unify device and pipe.

Request

NameType
pipe_request request<Pipe>

STRUCTS

AddressSpaceChildDriverPingMessage

Defined in fuchsia.hardware.goldfish/goldfish_address_space.fidl

After opening the child driver, the client and hardware communicate via a child driver-specific protocol, with notifications driven by Ping(), each of which writes and reads messages to the hardware that follow this AddressSpaceChildDriverPingMessage struct. Each child driver type will have its own semantics for each field. It's common for child drivers to refer to offset/size plus a metadata field. We also provide extra data fields for other use cases in particular child drivers.

NameTypeDescriptionDefault
offset uint64 No default
size uint64 No default
metadata uint64 No default
data0 uint64 No default
data1 uint64 No default
data2 uint32 No default
data3 uint32 No default

ControlDevice_CreateBuffer2_Response

Defined in fuchsia.hardware.goldfish/goldfish_control.fidl

NameTypeDescriptionDefault
hw_address_page_offset int32 No default

ENUMS

AddressSpaceChildDriverType

Type: uint32

Defined in fuchsia.hardware.goldfish/goldfish_address_space.fidl

NameValueDescription
DEFAULT 0

The DEFAULT child driver type is for graphics.

BufferHandleType

Type: uint32

Defined in fuchsia.hardware.goldfish/goldfish_control.fidl

NameValueDescription
INVALID 0
BUFFER 1
COLOR_BUFFER 2

ColorBufferFormatType

Type: uint32

Defined in fuchsia.hardware.goldfish/goldfish_control.fidl

Color buffer formats.

NameValueDescription
RGBA 6408
BGRA 32993

TABLES

CreateBuffer2Params

Defined in fuchsia.hardware.goldfish/goldfish_control.fidl

Input arguments of ControlDevice.CreateBuffer2() method. Includes necessary properties of a Vulkan-backed data buffer.

OrdinalNameTypeDescription
1 size uint64

Size of the buffer (unit: byte).

This argument is mandatory. CreateBuffer2() method returns ZX_ERR_INVALID_ARGS if size is missing.

2 memory_property uint32

Memory property flags the buffer should support. Only bits from fuchsia.hardware.goldfish.MEMORY_PROPERTY_* are allowed.

This argument is mandatory. CreateBuffer2() method returns ZX_ERR_INVALID_ARGS if memory_property is missing.

3 physical_address uint64

Goldfish address space device allocates a physical memory address for each host-visible buffer. This address is mapped to a corresponding hardware address when that host-visible buffer is created, and is unmapped when the buffer is torn down.

This field stores the physical memory address allocated by address space device.

If memory_property has the bit MEMORY_PROPERTY_HOST_VISIBLE set, this argument is mandatory. If physical_address is missing, CreateBuffer2() returns ZX_ERR_INVALID_ARGS.

If memory_property doesn't have the MEMORY_PROPERTY_HOST_VISIBLE bit, this argument is ignored.

CreateColorBuffer2Params

Defined in fuchsia.hardware.goldfish/goldfish_control.fidl

Input arguments of ControlDevice.CreateColorBuffer2() method. Includes necessary properties of a Vulkan-backed color buffer.

OrdinalNameTypeDescription
1 width uint32

Width of the color buffer (unit: pixel).

This argument is mandatory. CreateColorBuffer2() method returns ZX_ERR_INVALID_ARGS if width is missing.

2 height uint32

Height of the color buffer (unit: pixel).

This argument is mandatory. CreateColorBuffer2() method returns ZX_ERR_INVALID_ARGS if height is missing.

3 format ColorBufferFormatType

Color format type of the color buffer.

This argument is mandatory. CreateColorBuffer2() method returns ZX_ERR_INVALID_ARGS if format is missing.

4 memory_property uint32

Memory property flags the color buffer should support. Only bits from fuchsia.hardware.goldfish.MEMORY_PROPERTY_* are allowed.

This argument is mandatory. CreateColorBuffer2() method returns ZX_ERR_INVALID_ARGS if memory_property is missing.

5 physical_address uint64

Goldfish address space device allocates a physical memory address for each host-visible color buffer. This address is mapped to a corresponding hardware address when that host-visible color buffer is created, and is unmapped when the color buffer is torn down.

This field stores the physical memory address allocated by address space device.

If memory_property has the bit MEMORY_PROPERTY_HOST_VISIBLE set, this argument is mandatory. If physical_address is missing, CreateColorBuffer2() returns ZX_ERR_INVALID_ARGS.

If memory_property doesn't have the MEMORY_PROPERTY_HOST_VISIBLE bit, this argument is ignored.

UNIONS

ControlDevice_CreateBuffer2_Result

Defined in fuchsia.hardware.goldfish/goldfish_control.fidl

NameTypeDescription
response ControlDevice_CreateBuffer2_Response
err zx/status

CONSTANTS

NameValueTypeDescription
MEMORY_PROPERTY_DEVICE_LOCAL 1 uint32

Memory property flags for color buffers and data buffers.

MEMORY_PROPERTY_DEVICE_LOCAL corresponds to Vulkan's memory property VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT. Memory allocated with this type is the most efficient for device access.

MEMORY_PROPERTY_HOST_VISIBLE 2 uint32

MEMORY_PROPERTY_HOST_VISIBLE corresponds to Vulkan's memory property VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT. Memory allocated with this type can be mapped for host access using vkMapMemory().

SIGNAL_HANGUP 67108864 uint32

Signal that will be active on event handle if the device has been disconnected.

SIGNAL_READABLE 16777216 uint32

Signal that will be active on event handle if the Read() method will return data.

SIGNAL_WRITABLE 33554432 uint32

Signal that will be active on event handle if the Write() method will accept data.