blob: 36018815e43ac85c798906eb76ebe2bcdeb857c0 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.gpu.magma
<p>Magma is the driver model for GPUs/NPUs on Fuchsia.</p>
<p>Magma has two driver components: a hardware-specific library loaded into each application’s
address space (&quot;client driver&quot;, sometimes known as &quot;Installable client driver&quot; or &quot;ICD&quot;);
and the Magma system driver that interfaces with the hardware.
The communication protocols between the two driver pieces are defined here.</p>
<p>Some names have a numeric suffix (eg, BufferRangeOp2); the number is a detail of how the
protocols have evolved, and can be ignored.</p>
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 9</span></div>
## **PROTOCOLS**
## CombinedDevice {#CombinedDevice}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=108)*
<p>A combination of all the production |Device| protocols. This protocol is implemented on the
Magma service side and should not be used by clients.</p>
### Connect2 {#CombinedDevice.Connect2}
<p>Creates a connection to the device comprised of two IPC channels.
The primary channel is for the Primary protocol (see below). The notification channel is
used for vendor-specific messages which are sent only in the reverse (server-client)
direction, typically in response to client command completion.</p>
#### Request {#CombinedDevice.Connect2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>client_id</code></td>
<td>
<code>uint64</code>
</td>
</tr>
<tr>
<td><code>primary_channel</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Primary'>Primary</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>notification_channel</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Notification'>Notification</a>&gt;</code>
</td>
</tr>
</table>
### DumpState {#CombinedDevice.DumpState}
<p>Dumps driver and hardware state to the log.</p>
#### Request {#CombinedDevice.DumpState_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>dump_type</code></td>
<td>
<code>uint32</code>
</td>
</tr>
</table>
### GetIcdList {#CombinedDevice.GetIcdList}
<p>Returns a list of ICDs that can be used with this Magma device. The list is sorted in
descending order of preference.</p>
#### Request {#CombinedDevice.GetIcdList_Request}
&lt;EMPTY&gt;
#### Response {#CombinedDevice.GetIcdList_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>icd_list</code></td>
<td>
<code>vector&lt;<a class='link' href='#IcdInfo'>IcdInfo</a>&gt;[8]</code>
</td>
</tr>
</table>
### Query {#CombinedDevice.Query}
<p>On success, returns a result either in a buffer or a simple value.</p>
#### Request {#CombinedDevice.Query_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>query_id</code></td>
<td>
<code><a class='link' href='#QueryId'>QueryId</a></code>
</td>
</tr>
</table>
#### Response {#CombinedDevice.Query_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Device_Query_Result'>Device_Query_Result</a></code>
</td>
</tr>
</table>
## DependencyInjection {#DependencyInjection}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=414)*
<p>This protocol is implemented by ZX_PROTOCOL_GPU_DEPENDENCY_INJECTION devices. It's used
to inject dependencies on other services into the MSD. It can be used
only by a privileged process.</p>
### SetMemoryPressureProvider {#DependencyInjection.SetMemoryPressureProvider}
<p>Provides a <code>fuchsia.memorypressure.Provider</code> implementation to the MSD.</p>
#### Request {#DependencyInjection.SetMemoryPressureProvider_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>provider</code></td>
<td>
<code><a class='link' href='../fuchsia.memorypressure/'>fuchsia.memorypressure</a>/<a class='link' href='../fuchsia.memorypressure/#Provider'>Provider</a></code>
</td>
</tr>
</table>
## Device {#Device}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=69)*
<p>The Magma Device protocol allow clients to learn about the hardware by making queries, such as
device and vendor IDs, and which client drivers are supported by the device's system driver.<br />
To engage further with the device, clients may establish connections formed of channel pairs:
a primary channel for making requests (see Primary protocol below), and a secondary channel
for receiving notification messages (see Notification protocol below).</p>
### Connect2 {#Device.Connect2}
<p>Creates a connection to the device comprised of two IPC channels.
The primary channel is for the Primary protocol (see below). The notification channel is
used for vendor-specific messages which are sent only in the reverse (server-client)
direction, typically in response to client command completion.</p>
#### Request {#Device.Connect2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>client_id</code></td>
<td>
<code>uint64</code>
</td>
</tr>
<tr>
<td><code>primary_channel</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Primary'>Primary</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>notification_channel</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Notification'>Notification</a>&gt;</code>
</td>
</tr>
</table>
### Query {#Device.Query}
<p>On success, returns a result either in a buffer or a simple value.</p>
#### Request {#Device.Query_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>query_id</code></td>
<td>
<code><a class='link' href='#QueryId'>QueryId</a></code>
</td>
</tr>
</table>
#### Response {#Device.Query_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Device_Query_Result'>Device_Query_Result</a></code>
</td>
</tr>
</table>
## DiagnosticDevice {#DiagnosticDevice}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=90)*
<p>Methods used to expose diagnostics from the Magma device.</p>
### DumpState {#DiagnosticDevice.DumpState}
<p>Dumps driver and hardware state to the log.</p>
#### Request {#DiagnosticDevice.DumpState_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>dump_type</code></td>
<td>
<code>uint32</code>
</td>
</tr>
</table>
## IcdLoaderDevice {#IcdLoaderDevice}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=98)*
<p>Methods implemented by an MSD and exposed for use of an ICD loader.</p>
### GetIcdList {#IcdLoaderDevice.GetIcdList}
<p>Returns a list of ICDs that can be used with this Magma device. The list is sorted in
descending order of preference.</p>
#### Request {#IcdLoaderDevice.GetIcdList_Request}
&lt;EMPTY&gt;
#### Response {#IcdLoaderDevice.GetIcdList_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>icd_list</code></td>
<td>
<code>vector&lt;<a class='link' href='#IcdInfo'>IcdInfo</a>&gt;[8]</code>
</td>
</tr>
</table>
## Notification {#Notification}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=379)*
<p>This protocol is empty as the message contents are vendor specific.</p>
## PerformanceCounterAccess {#PerformanceCounterAccess}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=382)*
<p>This protocol is implemented by ZX_PROTOCOL_GPU_PERFORMANCE_COUNTERS devices.</p>
### GetPerformanceCountToken {#PerformanceCounterAccess.GetPerformanceCountToken}
<p>This access token is not used as an event, but is instead passed to
Primary.EnablePerformanceCounterAccess.</p>
#### Request {#PerformanceCounterAccess.GetPerformanceCountToken_Request}
&lt;EMPTY&gt;
#### Response {#PerformanceCounterAccess.GetPerformanceCountToken_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>access_token</code></td>
<td>
<code>handle&lt;event&gt;</code>
</td>
</tr>
</table>
## PerformanceCounterEvents {#PerformanceCounterEvents}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=390)*
### OnPerformanceCounterReadCompleted {#PerformanceCounterEvents.OnPerformanceCounterReadCompleted}
<p>Signals that a performance counter buffer has data. These will be output in the order of
when the reads are completed.</p>
#### Response {#PerformanceCounterEvents.OnPerformanceCounterReadCompleted_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest'>PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest</a></code>
</td>
</tr>
</table>
## Primary {#Primary}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=200)*
<p>If a system driver error occurs, or if the client sends a message that the client should have
known is invalid, the connection will be closed and a zx.status sent via epitaph.</p>
### AddPerformanceCounterBufferOffsetsToPool {#Primary.AddPerformanceCounterBufferOffsetsToPool}
<p>Adds a set of offsets into buffers to the pool. |offsets[n].buffer_id| is the id of a
buffer that was previously imported using ImportBuffer(). The same buffer may be added to
multiple pools. The pool will hold on to a reference to the buffer even after ReleaseBuffer
is called. When dumped into this entry, counters will be written starting at
|offsets[n].buffer_offset| bytes into the buffer, and up to |offsets[n].buffer_offset| +
|offsets[n].buffer_size|. |offsets[n].buffer_size| must be large enough to fit all enabled
counters. Performance counter access must have been enabled using
EnablePerformanceCounterAccess before calling this method.</p>
#### Request {#Primary.AddPerformanceCounterBufferOffsetsToPool_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>pool_id</code></td>
<td>
<code><a class='link' href='#PerformanceCounterPoolId'>PerformanceCounterPoolId</a></code>
</td>
</tr>
<tr>
<td><code>offsets</code></td>
<td>
<code>vector&lt;<a class='link' href='#BufferRange'>BufferRange</a>&gt;[64]</code>
</td>
</tr>
</table>
### BufferRangeOp2 {#Primary.BufferRangeOp2}
<p>Perform an operation on a range of the buffer.</p>
#### Request {#Primary.BufferRangeOp2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>op</code></td>
<td>
<code><a class='link' href='#BufferOp'>BufferOp</a></code>
</td>
</tr>
<tr>
<td><code>range</code></td>
<td>
<code><a class='link' href='#BufferRange'>BufferRange</a></code>
</td>
</tr>
</table>
### ClearPerformanceCounters {#Primary.ClearPerformanceCounters}
<p>Sets the values of all listed performance counters to 0. May not be supported by some
hardware. Performance counter access must have been enabled using
EnablePerformanceCounterAccess before calling this method.</p>
#### Request {#Primary.ClearPerformanceCounters_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>counters</code></td>
<td>
<code><a class='link' href='#PerformanceCounterSet'>PerformanceCounterSet</a></code>
</td>
</tr>
</table>
### CreateContext {#Primary.CreateContext}
<p>Creates context <code>context_id</code> for use in command execution. A context may be associated
with hardware state.</p>
#### Request {#Primary.CreateContext_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>context_id</code></td>
<td>
<code><a class='link' href='#ContextId'>ContextId</a></code>
</td>
</tr>
</table>
### CreatePerformanceCounterBufferPool {#Primary.CreatePerformanceCounterBufferPool}
<p>Creates a pool of buffers that performance counters can be dumped into. Performance counter
access must have been enabled using EnablePerformanceCounterAccess before calling this
method.</p>
#### Request {#Primary.CreatePerformanceCounterBufferPool_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>pool_id</code></td>
<td>
<code><a class='link' href='#PerformanceCounterPoolId'>PerformanceCounterPoolId</a></code>
</td>
</tr>
<tr>
<td><code>event_channel</code></td>
<td>
<code>server_end&lt;<a class='link' href='#PerformanceCounterEvents'>PerformanceCounterEvents</a>&gt;</code>
</td>
</tr>
</table>
### DestroyContext {#Primary.DestroyContext}
<p>Destroys context <code>context_id</code>.</p>
#### Request {#Primary.DestroyContext_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>context_id</code></td>
<td>
<code><a class='link' href='#ContextId'>ContextId</a></code>
</td>
</tr>
</table>
### DumpPerformanceCounters {#Primary.DumpPerformanceCounters}
<p>Triggers dumping of the performance counters into a buffer pool. May fail silently if there
are no buffers in the pool. |trigger_id| is an arbitrary ID assigned by the client that can
be returned in OnPerformanceCounterReadCompleted. Performance counter access must have been
enabled using EnablePerformanceCounterAccess before calling this method.</p>
#### Request {#Primary.DumpPerformanceCounters_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>pool_id</code></td>
<td>
<code><a class='link' href='#PerformanceCounterPoolId'>PerformanceCounterPoolId</a></code>
</td>
</tr>
<tr>
<td><code>trigger_id</code></td>
<td>
<code><a class='link' href='#PerformanceCounterTriggerId'>PerformanceCounterTriggerId</a></code>
</td>
</tr>
</table>
### EnableFlowControl {#Primary.EnableFlowControl}
<p>Enables the events OnNotifyMessagesConsumed and OnNotifyMemoryImported.</p>
#### Request {#Primary.EnableFlowControl_Request}
&lt;EMPTY&gt;
### EnablePerformanceCounterAccess {#Primary.EnablePerformanceCounterAccess}
<p>Tries to enable performance counter FIDL messages. To be successful, |access_token| must
have been returned by PerformanceCounterAccess.GetPerformanceCountToken() from the matching
device.</p>
#### Request {#Primary.EnablePerformanceCounterAccess_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>access_token</code></td>
<td>
<code>handle&lt;event&gt;</code>
</td>
</tr>
</table>
### EnablePerformanceCounters {#Primary.EnablePerformanceCounters}
<p>Enables a set of performance counters. Disables enabled performance counters that are not
in the new set. Performance counters will also be automatically disabled on connection
close. Performance counter access must have been enabled using
EnablePerformanceCounterAccess before calling this method.</p>
#### Request {#Primary.EnablePerformanceCounters_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>counters</code></td>
<td>
<code><a class='link' href='#PerformanceCounterSet'>PerformanceCounterSet</a></code>
</td>
</tr>
</table>
### ExecuteCommand {#Primary.ExecuteCommand}
<p>Submits command buffers for execution on the hardware, with associated <code>resources</code>.
<code>resources</code> must refer to buffers that have been imported.
<code>wait_semaphores</code> and <code>signal_semaphores</code> must refer to events that have been imported.
<code>wait_semaphores</code> must all be signaled before execution begins, then are reset.
<code>signal_semaphores</code> will be signaled after the command buffer is completed.</p>
#### Request {#Primary.ExecuteCommand_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>context_id</code></td>
<td>
<code><a class='link' href='#ContextId'>ContextId</a></code>
</td>
</tr>
<tr>
<td><code>resources</code></td>
<td>
<code>vector&lt;<a class='link' href='#BufferRange'>BufferRange</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>command_buffers</code></td>
<td>
<code>vector&lt;<a class='link' href='#CommandBuffer'>CommandBuffer</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>wait_semaphores</code></td>
<td>
<code>vector&lt;uint64&gt;</code>
</td>
</tr>
<tr>
<td><code>signal_semaphores</code></td>
<td>
<code>vector&lt;uint64&gt;</code>
</td>
</tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#CommandBufferFlags'>CommandBufferFlags</a></code>
</td>
</tr>
</table>
### ExecuteImmediateCommands {#Primary.ExecuteImmediateCommands}
<p>Submits a series of commands for execution on the hardware without using a command buffer.
<code>semaphores</code> must refer to events that have been imported, and will be signaled after
the commands are completed.</p>
#### Request {#Primary.ExecuteImmediateCommands_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>context_id</code></td>
<td>
<code><a class='link' href='#ContextId'>ContextId</a></code>
</td>
</tr>
<tr>
<td><code>command_data</code></td>
<td>
<code>vector&lt;uint8&gt;[2048]</code>
</td>
</tr>
<tr>
<td><code>semaphores</code></td>
<td>
<code>vector&lt;uint64&gt;</code>
</td>
</tr>
</table>
### Flush {#Primary.Flush}
<p>Incurs a round-trip to the system driver, used to ensure all previous messages have been
observed, but not necessarily completed.</p>
#### Request {#Primary.Flush_Request}
&lt;EMPTY&gt;
#### Response {#Primary.Flush_Response}
&lt;EMPTY&gt;
### ImportObject2 {#Primary.ImportObject2}
<p>Imports an object for use in the system driver.</p>
#### Request {#Primary.ImportObject2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>object</code></td>
<td>
<code>handle&lt;handle&gt;</code>
</td>
</tr>
<tr>
<td><code>object_type</code></td>
<td>
<code><a class='link' href='#ObjectType'>ObjectType</a></code>
</td>
</tr>
<tr>
<td><code>object_id</code></td>
<td>
<code><a class='link' href='#ObjectId'>ObjectId</a></code>
</td>
</tr>
</table>
### IsPerformanceCounterAccessAllowed {#Primary.IsPerformanceCounterAccessAllowed}
<p>Returns true if any EnablePerformanceCounterAccess message has succeeded.</p>
#### Request {#Primary.IsPerformanceCounterAccessAllowed_Request}
&lt;EMPTY&gt;
#### Response {#Primary.IsPerformanceCounterAccessAllowed_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>enabled</code></td>
<td>
<code>bool</code>
</td>
</tr>
</table>
### MapBuffer {#Primary.MapBuffer}
<p>Maps a page range onto the hardware in the connection's address space at address <code>hw_va</code>.
<code>flags</code> is a set of flags from MapFlags that specify how the hardware can access the buffer.</p>
#### Request {#Primary.MapBuffer_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#PrimaryMapBufferRequest'>PrimaryMapBufferRequest</a></code>
</td>
</tr>
</table>
### OnNotifyMemoryImported {#Primary.OnNotifyMemoryImported}
<p>Indicates the given number of buffer memory bytes were imported by the server.
The caller should limit the amount of memory from inflight ImportBuffer messages:
(bytes sent - server imported) &lt;= MaxBytes (see QueryId::MAXIMUM_INFLIGHT_PARAMS).
This is a soft limit designed to prevent excessive memory consumption, but for large
messages the client may exceed the limit.
Memory is imported by the server as quickly as possible, however this event
is sent only when the consumed byte count reaches half the maximum; therefore,
if the client's count of inflight bytes is less than max/2, the client should send the
ImportBuffer message regardless of its size.</p>
#### Response {#Primary.OnNotifyMemoryImported_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>bytes</code></td>
<td>
<code>uint64</code>
</td>
</tr>
</table>
### OnNotifyMessagesConsumed {#Primary.OnNotifyMessagesConsumed}
<p>Indicates the given number of messages were consumed by the server.
The caller should limit the number of inflight messages:
(messages sent - server consumed) &lt;= MaxMessages (see QueryId::MAXIMUM_INFLIGHT_PARAMS).
Messages are actually consumed by the server as quickly as possible, however this event
is sent by the server only when the consumed count reaches half the maximum.</p>
#### Response {#Primary.OnNotifyMessagesConsumed_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>count</code></td>
<td>
<code>uint64</code>
</td>
</tr>
</table>
### ReleaseObject {#Primary.ReleaseObject}
<p>Destroys the object with <code>object_id</code> within this connection.</p>
#### Request {#Primary.ReleaseObject_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>object_id</code></td>
<td>
<code><a class='link' href='#ObjectId'>ObjectId</a></code>
</td>
</tr>
<tr>
<td><code>object_type</code></td>
<td>
<code><a class='link' href='#ObjectType'>ObjectType</a></code>
</td>
</tr>
</table>
### ReleasePerformanceCounterBufferPool {#Primary.ReleasePerformanceCounterBufferPool}
<p>Releases a pool of performance counter buffers. Performance counter access must have been
enabled using EnablePerformanceCounterAccess before calling this method.</p>
#### Request {#Primary.ReleasePerformanceCounterBufferPool_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>pool_id</code></td>
<td>
<code><a class='link' href='#PerformanceCounterPoolId'>PerformanceCounterPoolId</a></code>
</td>
</tr>
</table>
### RemovePerformanceCounterBufferFromPool {#Primary.RemovePerformanceCounterBufferFromPool}
<p>Removes every offset of a buffer from the pool. Once this method is finished being handled
on the server, no more dumps will be processed into this buffer. In-flight dumps into this
buffer may be lost. Performance counter access must have been enabled using
EnablePerformanceCounterAccess before calling this method.</p>
#### Request {#Primary.RemovePerformanceCounterBufferFromPool_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>pool_id</code></td>
<td>
<code><a class='link' href='#PerformanceCounterPoolId'>PerformanceCounterPoolId</a></code>
</td>
</tr>
<tr>
<td><code>buffer_id</code></td>
<td>
<code><a class='link' href='#ObjectId'>ObjectId</a></code>
</td>
</tr>
</table>
### UnmapBuffer {#Primary.UnmapBuffer}
<p>Releases the mapping at address <code>hw_va</code> from the hardware for the given <code>buffer_id</code>.
Buffers will also be implicitly unmapped when released.</p>
#### Request {#Primary.UnmapBuffer_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#PrimaryUnmapBufferRequest'>PrimaryUnmapBufferRequest</a></code>
</td>
</tr>
</table>
## TestDevice {#TestDevice}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=115)*
<p>Additional device methods for the purposes of testing the MSD and should not be used by ICDs.</p>
### Connect2 {#TestDevice.Connect2}
<p>Creates a connection to the device comprised of two IPC channels.
The primary channel is for the Primary protocol (see below). The notification channel is
used for vendor-specific messages which are sent only in the reverse (server-client)
direction, typically in response to client command completion.</p>
#### Request {#TestDevice.Connect2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>client_id</code></td>
<td>
<code>uint64</code>
</td>
</tr>
<tr>
<td><code>primary_channel</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Primary'>Primary</a>&gt;</code>
</td>
</tr>
<tr>
<td><code>notification_channel</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Notification'>Notification</a>&gt;</code>
</td>
</tr>
</table>
### DumpState {#TestDevice.DumpState}
<p>Dumps driver and hardware state to the log.</p>
#### Request {#TestDevice.DumpState_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>dump_type</code></td>
<td>
<code>uint32</code>
</td>
</tr>
</table>
### GetIcdList {#TestDevice.GetIcdList}
<p>Returns a list of ICDs that can be used with this Magma device. The list is sorted in
descending order of preference.</p>
#### Request {#TestDevice.GetIcdList_Request}
&lt;EMPTY&gt;
#### Response {#TestDevice.GetIcdList_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>icd_list</code></td>
<td>
<code>vector&lt;<a class='link' href='#IcdInfo'>IcdInfo</a>&gt;[8]</code>
</td>
</tr>
</table>
### GetUnitTestStatus {#TestDevice.GetUnitTestStatus}
#### Request {#TestDevice.GetUnitTestStatus_Request}
&lt;EMPTY&gt;
#### Response {#TestDevice.GetUnitTestStatus_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>status</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### Query {#TestDevice.Query}
<p>On success, returns a result either in a buffer or a simple value.</p>
#### Request {#TestDevice.Query_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>query_id</code></td>
<td>
<code><a class='link' href='#QueryId'>QueryId</a></code>
</td>
</tr>
</table>
#### Response {#TestDevice.Query_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Device_Query_Result'>Device_Query_Result</a></code>
</td>
</tr>
</table>
## **STRUCTS**
### BufferRange {#BufferRange data-text="BufferRange"}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=184)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="BufferRange.buffer_id">
<td><code>buffer_id</code></td>
<td>
<code><a class='link' href='#ObjectId'>ObjectId</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="BufferRange.offset">
<td><code>offset</code></td>
<td>
<code>uint64</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="BufferRange.size">
<td><code>size</code></td>
<td>
<code>uint64</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### CommandBuffer {#CommandBuffer data-text="CommandBuffer"}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=162)*
<p>A command buffer may be used to pass hardware instructions in a shared buffer (VMO).</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="CommandBuffer.resource_index">
<td><code>resource_index</code></td>
<td>
<code>uint32</code>
</td>
<td><p>Index of the resource containing instructions to start the command buffer.</p>
</td>
<td>No default</td>
</tr>
<tr id="CommandBuffer.start_offset">
<td><code>start_offset</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Starting offset within the resource.</p>
</td>
<td>No default</td>
</tr>
</table>
## **ENUMS**
### BufferOp [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#BufferOp data-text="BufferOp"}
Type: <code>uint32</code>
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=130)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="BufferOp.POPULATE_TABLES">
<td><h3 id="BufferOp.POPULATE_TABLES" class="add-link hide-from-toc">POPULATE_TABLES</h3></td>
<td><code>1</code></td>
<td><p>Populate the hardware page tables with the pages mapped in this range, committing pages
as needed. This is not needed for allocations mapped GROWABLE, since the page tables will
be populated on demand.</p>
</td>
</tr>
<tr id="BufferOp.DEPOPULATE_TABLES">
<td><h3 id="BufferOp.DEPOPULATE_TABLES" class="add-link hide-from-toc">DEPOPULATE_TABLES</h3></td>
<td><code>2</code></td>
<td><p>Depopulate page table mappings for this range. This prevents the hardware from accessing
pages in that range, but the pages retain their contents.</p>
</td>
</tr>
</table>
### ObjectType [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#ObjectType data-text="ObjectType"}
Type: <code>uint32</code>
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=123)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="ObjectType.EVENT">
<td><h3 id="ObjectType.EVENT" class="add-link hide-from-toc">EVENT</h3></td>
<td><code>10</code></td>
<td><p>A sync object backed by a Zircon event.</p>
</td>
</tr>
<tr id="ObjectType.BUFFER">
<td><h3 id="ObjectType.BUFFER" class="add-link hide-from-toc">BUFFER</h3></td>
<td><code>11</code></td>
<td><p>A memory object backeed by a Zircon VMO.</p>
</td>
</tr>
</table>
### QueryId [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#QueryId data-text="QueryId"}
Type: <code>uint64</code>
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=23)*
<p>Types of information about the hardware and driver that can be queried from the Magma system
driver. Vendor-specific ID numbers may be used, but those IDs will be listed elsewhere.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="QueryId.VENDOR_ID">
<td><h3 id="QueryId.VENDOR_ID" class="add-link hide-from-toc">VENDOR_ID</h3></td>
<td><code>0</code></td>
<td><p>Returns the hardware vendor ID (simple result) - should be the PCI ID of the hardware
vendor if possible, or the Khronos vendor ID otherwise.</p>
</td>
</tr>
<tr id="QueryId.DEVICE_ID">
<td><h3 id="QueryId.DEVICE_ID" class="add-link hide-from-toc">DEVICE_ID</h3></td>
<td><code>1</code></td>
<td><p>Returns the hardware device ID (simple result)</p>
</td>
</tr>
<tr id="QueryId.IS_TOTAL_TIME_SUPPORTED">
<td><h3 id="QueryId.IS_TOTAL_TIME_SUPPORTED" class="add-link hide-from-toc">IS_TOTAL_TIME_SUPPORTED</h3></td>
<td><code>3</code></td>
<td><p>Returns true if MAGMA_QUERY_TOTAL_TIME is supported (simple result)</p>
</td>
</tr>
<tr id="QueryId.MAXIMUM_INFLIGHT_PARAMS">
<td><h3 id="QueryId.MAXIMUM_INFLIGHT_PARAMS" class="add-link hide-from-toc">MAXIMUM_INFLIGHT_PARAMS</h3></td>
<td><code>5</code></td>
<td><p>Upper 32bits: max inflight messages, lower 32bits: max inflight memory (MB) (simple result)</p>
</td>
</tr>
<tr id="QueryId.MAGMA_QUERY_TOTAL_TIME">
<td><h3 id="QueryId.MAGMA_QUERY_TOTAL_TIME" class="add-link hide-from-toc">MAGMA_QUERY_TOTAL_TIME</h3></td>
<td><code>500</code></td>
<td><p>Returns a struct magma_total_time_query_result (buffer result); see:
src/graphics/lib/magma/include/magma/magma_common_defs.h</p>
</td>
</tr>
<tr id="QueryId.VENDOR_QUERY_0">
<td><h3 id="QueryId.VENDOR_QUERY_0" class="add-link hide-from-toc">VENDOR_QUERY_0</h3></td>
<td><code>10000</code></td>
<td><p>Vendor specific query IDs start here</p>
</td>
</tr>
</table>
## **TABLES**
### IcdInfo {#IcdInfo data-text="IcdInfo"}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=56)*
<p>Information about an ICD implementation that can be used with a Magma device.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="IcdInfo.component_url">
<td><h3 id="IcdInfo.component_url" class="add-link hide-from-toc">1</h3></td>
<td><code>component_url</code></td>
<td>
<code><a class='link' href='../fuchsia.url/'>fuchsia.url</a>/<a class='link' href='../fuchsia.url/#Url'>Url</a></code>
</td>
<td><p>URL of the component implementation that provides the ICD.</p>
</td>
</tr>
<tr id="IcdInfo.flags">
<td><h3 id="IcdInfo.flags" class="add-link hide-from-toc">2</h3></td>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#IcdFlags'>IcdFlags</a></code>
</td>
<td><p>Flags describing the basic capabilities of the ICD, including what APIs it supports.</p>
</td>
</tr>
</table>
### PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest {#PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest data-text="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest"}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=393)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest.trigger_id">
<td><h3 id="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest.trigger_id" class="add-link hide-from-toc">1</h3></td>
<td><code>trigger_id</code></td>
<td>
<code><a class='link' href='#PerformanceCounterTriggerId'>PerformanceCounterTriggerId</a></code>
</td>
<td><p>Required.</p>
</td>
</tr>
<tr id="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest.buffer_id">
<td><h3 id="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest.buffer_id" class="add-link hide-from-toc">2</h3></td>
<td><code>buffer_id</code></td>
<td>
<code><a class='link' href='#ObjectId'>ObjectId</a></code>
</td>
<td><p>Required.</p>
</td>
</tr>
<tr id="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest.buffer_offset">
<td><h3 id="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest.buffer_offset" class="add-link hide-from-toc">3</h3></td>
<td><code>buffer_offset</code></td>
<td>
<code>uint32</code>
</td>
<td><p>Required.</p>
</td>
</tr>
<tr id="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest.timestamp">
<td><h3 id="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest.timestamp" class="add-link hide-from-toc">4</h3></td>
<td><code>timestamp</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code>
</td>
<td><p>Required.</p>
</td>
</tr>
<tr id="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest.flags">
<td><h3 id="PerformanceCounterEventsOnPerformanceCounterReadCompletedRequest.flags" class="add-link hide-from-toc">5</h3></td>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#ResultFlags'>ResultFlags</a></code>
</td>
<td><p>Required.</p>
</td>
</tr>
</table>
### PrimaryMapBufferRequest {#PrimaryMapBufferRequest data-text="PrimaryMapBufferRequest"}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=254)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="PrimaryMapBufferRequest.hw_va">
<td><h3 id="PrimaryMapBufferRequest.hw_va" class="add-link hide-from-toc">1</h3></td>
<td><code>hw_va</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Required.</p>
</td>
</tr>
<tr id="PrimaryMapBufferRequest.range">
<td><h3 id="PrimaryMapBufferRequest.range" class="add-link hide-from-toc">2</h3></td>
<td><code>range</code></td>
<td>
<code><a class='link' href='#BufferRange'>BufferRange</a></code>
</td>
<td><p>Required.</p>
</td>
</tr>
<tr id="PrimaryMapBufferRequest.flags">
<td><h3 id="PrimaryMapBufferRequest.flags" class="add-link hide-from-toc">3</h3></td>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#MapFlags'>MapFlags</a></code>
</td>
<td></td>
</tr>
</table>
### PrimaryUnmapBufferRequest {#PrimaryUnmapBufferRequest data-text="PrimaryUnmapBufferRequest"}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=266)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="PrimaryUnmapBufferRequest.hw_va">
<td><h3 id="PrimaryUnmapBufferRequest.hw_va" class="add-link hide-from-toc">1</h3></td>
<td><code>hw_va</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Required.</p>
</td>
</tr>
<tr id="PrimaryUnmapBufferRequest.buffer_id">
<td><h3 id="PrimaryUnmapBufferRequest.buffer_id" class="add-link hide-from-toc">2</h3></td>
<td><code>buffer_id</code></td>
<td>
<code><a class='link' href='#ObjectId'>ObjectId</a></code>
</td>
<td><p>Required.</p>
</td>
</tr>
</table>
## **UNIONS**
### Device_Query_Response [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Device_Query_Response data-text="Device_Query_Response"}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=73)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Device_Query_Response.simple_result">
<td><h3 id="Device_Query_Response.simple_result" class="add-link hide-from-toc">1</h3></td>
<td><code>simple_result</code></td>
<td>
<code>uint64</code>
</td>
<td></td>
</tr>
<tr id="Device_Query_Response.buffer_result">
<td><h3 id="Device_Query_Response.buffer_result" class="add-link hide-from-toc">2</h3></td>
<td><code>buffer_result</code></td>
<td>
<code>handle&lt;vmo&gt;</code>
</td>
<td></td>
</tr>
</table>
### Device_Query_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Device_Query_Result data-text="Device_Query_Result"}
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=73)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Device_Query_Result.response">
<td><h3 id="Device_Query_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Device_Query_Response'>Device_Query_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Device_Query_Result.err">
<td><h3 id="Device_Query_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
## **BITS**
### CommandBufferFlags [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#CommandBufferFlags}
Type: <code>uint64</code>
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=156)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="CommandBufferFlags.VENDOR_FLAG_0">
<td><h3 id="CommandBufferFlags.VENDOR_FLAG_0" class="add-link hide-from-toc">VENDOR_FLAG_0</h3></td>
<td>65536</td>
<td><p>Vendor specific definitions start here</p>
</td>
</tr>
</table>
### IcdFlags [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#IcdFlags}
Type: <code>uint32</code>
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=48)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="IcdFlags.SUPPORTS_VULKAN">
<td><h3 id="IcdFlags.SUPPORTS_VULKAN" class="add-link hide-from-toc">SUPPORTS_VULKAN</h3></td>
<td>1</td>
<td></td>
</tr>
<tr id="IcdFlags.SUPPORTS_OPENCL">
<td><h3 id="IcdFlags.SUPPORTS_OPENCL" class="add-link hide-from-toc">SUPPORTS_OPENCL</h3></td>
<td>2</td>
<td></td>
</tr>
<tr id="IcdFlags.SUPPORTS_MEDIA_CODEC_FACTORY">
<td><h3 id="IcdFlags.SUPPORTS_MEDIA_CODEC_FACTORY" class="add-link hide-from-toc">SUPPORTS_MEDIA_CODEC_FACTORY</h3></td>
<td>4</td>
<td></td>
</tr>
</table>
### MapFlags [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#MapFlags}
Type: <code>uint64</code>
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=144)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="MapFlags.READ">
<td><h3 id="MapFlags.READ" class="add-link hide-from-toc">READ</h3></td>
<td>1</td>
<td></td>
</tr>
<tr id="MapFlags.WRITE">
<td><h3 id="MapFlags.WRITE" class="add-link hide-from-toc">WRITE</h3></td>
<td>2</td>
<td></td>
</tr>
<tr id="MapFlags.EXECUTE">
<td><h3 id="MapFlags.EXECUTE" class="add-link hide-from-toc">EXECUTE</h3></td>
<td>4</td>
<td></td>
</tr>
<tr id="MapFlags.GROWABLE">
<td><h3 id="MapFlags.GROWABLE" class="add-link hide-from-toc">GROWABLE</h3></td>
<td>8</td>
<td><p>Uncommitted pages may be comitted on a hardware fault. If this flag is not set, access
faults should cause an error.</p>
</td>
</tr>
<tr id="MapFlags.VENDOR_FLAG_0">
<td><h3 id="MapFlags.VENDOR_FLAG_0" class="add-link hide-from-toc">VENDOR_FLAG_0</h3></td>
<td>65536</td>
<td><p>Vendor specific definitions start here</p>
</td>
</tr>
</table>
### ResultFlags [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#ResultFlags}
Type: <code>uint32</code>
*Defined in [fuchsia.gpu.magma/magma.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=176)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="ResultFlags.DISCONTINUITY">
<td><h3 id="ResultFlags.DISCONTINUITY" class="add-link hide-from-toc">DISCONTINUITY</h3></td>
<td>1</td>
<td><p>This bit is set in result_flags if the performance counters missed some samples, e.g. due to
the hardware being in protected mode for part of the time.</p>
</td>
</tr>
</table>
## **CONSTANTS**
<table>
<tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr>
<tr id="MAX_ICD_COUNT">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=46">MAX_ICD_COUNT</a></td>
<td>
<code>8</code>
</td>
<td><code>uint64</code></td>
<td><p>The maximum number of ICDs supported by a Magma system driver.</p>
</td>
</tr>
<tr id="MAX_IMMEDIATE_COMMANDS_DATA_SIZE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=142">MAX_IMMEDIATE_COMMANDS_DATA_SIZE</a></td>
<td>
<code>2048</code>
</td>
<td><code>uint32</code></td>
<td><p>The batch size used to send multiple immediate commands in a single message.</p>
</td>
</tr>
</table>
## **ALIASES**
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="ContextId">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=190">ContextId</a></td>
<td>
<code>uint32</code></td>
<td></td>
</tr>
<tr id="ObjectId">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=182">ObjectId</a></td>
<td>
<code>uint64</code></td>
<td></td>
</tr>
<tr id="PerformanceCounterPoolId">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=174">PerformanceCounterPoolId</a></td>
<td>
<code>uint64</code></td>
<td><p>Performance counter pools contain byte ranges of buffers. Whenever a performance counter dump is
triggered, the driver removes a range from the pool, writes the performance counter values from
the hardware into it, then signals the client using OnPerformanceCounterReadCompleted. Pool IDs
are arbitrary uint64 values that are allocated by the client.</p>
</td>
</tr>
<tr id="PerformanceCounterSet">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=196">PerformanceCounterSet</a></td>
<td>
<code>vector</code>[<code>64</code>]</td>
<td><p>Describes a set of performance counters. The exact meaning depends on the specific driver, but
often is a bitvector representing whether each performance counter is enabled or disabled.</p>
</td>
</tr>
<tr id="PerformanceCounterTriggerId">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.gpu.magma/magma.fidl;l=192">PerformanceCounterTriggerId</a></td>
<td>
<code>uint32</code></td>
<td></td>
</tr>
</table>