pub struct PrimarySynchronousProxy { /* private fields */ }
Implementations§
Source§impl PrimarySynchronousProxy
impl PrimarySynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<PrimaryEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<PrimaryEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
pub fn import_object2( &self, object: Handle, object_type: ObjectType, object_id: u64, ) -> Result<(), Error>
Sourcepub fn import_object(
&self,
payload: PrimaryImportObjectRequest,
) -> Result<(), Error>
pub fn import_object( &self, payload: PrimaryImportObjectRequest, ) -> Result<(), Error>
Imports an object for use in the system driver.
Sourcepub fn release_object(
&self,
object_id: u64,
object_type: ObjectType,
) -> Result<(), Error>
pub fn release_object( &self, object_id: u64, object_type: ObjectType, ) -> Result<(), Error>
Destroys the object with object_id
within this connection.
Sourcepub fn create_context(&self, context_id: u32) -> Result<(), Error>
pub fn create_context(&self, context_id: u32) -> Result<(), Error>
Creates context context_id
for use in command execution. A context may be associated
with hardware state.
Sourcepub fn destroy_context(&self, context_id: u32) -> Result<(), Error>
pub fn destroy_context(&self, context_id: u32) -> Result<(), Error>
Destroys context context_id
.
Sourcepub fn execute_command(
&self,
context_id: u32,
resources: &[BufferRange],
command_buffers: &[CommandBuffer],
wait_semaphores: &[u64],
signal_semaphores: &[u64],
flags: CommandBufferFlags,
) -> Result<(), Error>
pub fn execute_command( &self, context_id: u32, resources: &[BufferRange], command_buffers: &[CommandBuffer], wait_semaphores: &[u64], signal_semaphores: &[u64], flags: CommandBufferFlags, ) -> Result<(), Error>
Submits command buffers for execution on the hardware, with associated resources
.
resources
must refer to buffers that have been imported.
wait_semaphores
and signal_semaphores
must refer to events that have been imported.
wait_semaphores
must all be signaled before execution begins, then are reset.
signal_semaphores
will be signaled after the command buffer is completed.
Sourcepub fn execute_immediate_commands(
&self,
context_id: u32,
command_data: &[u8],
semaphores: &[u64],
) -> Result<(), Error>
pub fn execute_immediate_commands( &self, context_id: u32, command_data: &[u8], semaphores: &[u64], ) -> Result<(), Error>
Submits a series of commands for execution on the hardware without using a command buffer.
semaphores
must refer to events that have been imported, and will be signaled after
the commands are completed.
Sourcepub fn execute_inline_commands(
&self,
context_id: u32,
commands: &[InlineCommand],
) -> Result<(), Error>
pub fn execute_inline_commands( &self, context_id: u32, commands: &[InlineCommand], ) -> Result<(), Error>
Submits a series of commands for execution on the hardware without using a command buffer. The number of commands sent should be calculated so that the total message size is less than MAX_INLINE_COMMANDS_DATA_SIZE.
Sourcepub fn flush(&self, ___deadline: MonotonicInstant) -> Result<(), Error>
pub fn flush(&self, ___deadline: MonotonicInstant) -> Result<(), Error>
Incurs a round-trip to the system driver, used to ensure all previous messages have been observed, but not necessarily completed.
Sourcepub fn map_buffer(&self, payload: &PrimaryMapBufferRequest) -> Result<(), Error>
pub fn map_buffer(&self, payload: &PrimaryMapBufferRequest) -> Result<(), Error>
Maps a page range onto the hardware in the connection’s address space at address hw_va
.
flags
is a set of flags from MapFlags that specify how the hardware can access the buffer.
Sourcepub fn unmap_buffer(
&self,
payload: &PrimaryUnmapBufferRequest,
) -> Result<(), Error>
pub fn unmap_buffer( &self, payload: &PrimaryUnmapBufferRequest, ) -> Result<(), Error>
Releases the mapping at address hw_va
from the hardware for the given buffer_id
.
Buffers will also be implicitly unmapped when released.
Sourcepub fn buffer_range_op2(
&self,
op: BufferOp,
range: &BufferRange,
) -> Result<(), Error>
pub fn buffer_range_op2( &self, op: BufferOp, range: &BufferRange, ) -> Result<(), Error>
Perform an operation on a range of the buffer.
Sourcepub fn enable_flow_control(&self) -> Result<(), Error>
pub fn enable_flow_control(&self) -> Result<(), Error>
Enables the events OnNotifyMessagesConsumed and OnNotifyMemoryImported.
Sourcepub fn enable_performance_counter_access(
&self,
access_token: Event,
) -> Result<(), Error>
pub fn enable_performance_counter_access( &self, access_token: Event, ) -> Result<(), Error>
Tries to enable performance counter FIDL messages. To be successful, |access_token| must have been returned by PerformanceCounterAccess.GetPerformanceCountToken() from the matching device.
Sourcepub fn is_performance_counter_access_allowed(
&self,
___deadline: MonotonicInstant,
) -> Result<bool, Error>
pub fn is_performance_counter_access_allowed( &self, ___deadline: MonotonicInstant, ) -> Result<bool, Error>
Returns true if any EnablePerformanceCounterAccess message has succeeded.
Sourcepub fn enable_performance_counters(&self, counters: &[u64]) -> Result<(), Error>
pub fn enable_performance_counters(&self, counters: &[u64]) -> Result<(), Error>
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.
Sourcepub fn create_performance_counter_buffer_pool(
&self,
pool_id: u64,
event_channel: ServerEnd<PerformanceCounterEventsMarker>,
) -> Result<(), Error>
pub fn create_performance_counter_buffer_pool( &self, pool_id: u64, event_channel: ServerEnd<PerformanceCounterEventsMarker>, ) -> Result<(), Error>
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.
Sourcepub fn release_performance_counter_buffer_pool(
&self,
pool_id: u64,
) -> Result<(), Error>
pub fn release_performance_counter_buffer_pool( &self, pool_id: u64, ) -> Result<(), Error>
Releases a pool of performance counter buffers. Performance counter access must have been enabled using EnablePerformanceCounterAccess before calling this method.
Sourcepub fn add_performance_counter_buffer_offsets_to_pool(
&self,
pool_id: u64,
offsets: &[BufferRange],
) -> Result<(), Error>
pub fn add_performance_counter_buffer_offsets_to_pool( &self, pool_id: u64, offsets: &[BufferRange], ) -> Result<(), Error>
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.
Sourcepub fn remove_performance_counter_buffer_from_pool(
&self,
pool_id: u64,
buffer_id: u64,
) -> Result<(), Error>
pub fn remove_performance_counter_buffer_from_pool( &self, pool_id: u64, buffer_id: u64, ) -> Result<(), Error>
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.
Sourcepub fn dump_performance_counters(
&self,
pool_id: u64,
trigger_id: u32,
) -> Result<(), Error>
pub fn dump_performance_counters( &self, pool_id: u64, trigger_id: u32, ) -> Result<(), Error>
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.
Sourcepub fn clear_performance_counters(&self, counters: &[u64]) -> Result<(), Error>
pub fn clear_performance_counters(&self, counters: &[u64]) -> Result<(), Error>
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.
Trait Implementations§
Source§impl Debug for PrimarySynchronousProxy
impl Debug for PrimarySynchronousProxy
Source§impl SynchronousProxy for PrimarySynchronousProxy
impl SynchronousProxy for PrimarySynchronousProxy
Source§type Proxy = PrimaryProxy
type Proxy = PrimaryProxy
Source§type Protocol = PrimaryMarker
type Protocol = PrimaryMarker
Proxy
controls.