| { |
| "magma-interface": { |
| "next-free-ordinal": 65, |
| "exports": [ |
| { |
| "ordinal": 4, |
| "name": "magma_release_connection", |
| "type": "void", |
| "description": "Releases the given connection.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| } |
| ] |
| }, |
| { |
| "ordinal": 5, |
| "name": "magma_get_error", |
| "type": "magma_status_t", |
| "description": "Returns the first recorded error since the last time this function was called, and clears the recorded error. Incurs a round-trip to the system driver", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| } |
| ] |
| }, |
| { |
| "ordinal": 6, |
| "name": "magma_create_context", |
| "type": "void", |
| "description": "Creates a context on the given connection.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "context_id_out", |
| "type": "uint32_t*", |
| "description": "The returned context id." |
| } |
| ] |
| }, |
| { |
| "ordinal": 7, |
| "name": "magma_release_context", |
| "type": "void", |
| "description": "Releases the context associated with the given id.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "context_id", |
| "type": "uint32_t", |
| "description": "A valid context id." |
| } |
| ] |
| }, |
| { |
| "ordinal": 8, |
| "name": "magma_create_buffer", |
| "type": "magma_status_t", |
| "description": "Creates a memory buffer of at least the given size.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "size", |
| "type": "uint64_t", |
| "description": "Requested buffer size." |
| }, |
| { |
| "name": "size_out", |
| "type": "uint64_t*", |
| "description": "The returned buffer's actual size." |
| }, |
| { |
| "name": "buffer_out", |
| "type": "magma_buffer_t*", |
| "description": "The returned buffer." |
| } |
| ] |
| }, |
| { |
| "ordinal": 9, |
| "name": "magma_release_buffer", |
| "type": "void", |
| "description": "Releases the given memory buffer.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| } |
| ] |
| }, |
| { |
| "ordinal": 10, |
| "name": "magma_duplicate_handle", |
| "type": "magma_status_t", |
| "description": "Duplicates the given handle, giving another handle that can be imported into a connection.", |
| "arguments": [ |
| { |
| "name": "buffer_handle", |
| "type": "magma_handle_t", |
| "description": "A valid handle." |
| }, |
| { |
| "name": "buffer_handle_out", |
| "type": "magma_handle_t*", |
| "description": "The returned duplicate handle." |
| } |
| ] |
| }, |
| { |
| "ordinal": 11, |
| "name": "magma_release_buffer_handle", |
| "type": "magma_status_t", |
| "description": "Releases the given handle.", |
| "arguments": [ |
| { |
| "name": "buffer_handle", |
| "type": "magma_handle_t", |
| "description": "A valid handle." |
| } |
| ] |
| }, |
| { |
| "ordinal": 12, |
| "name": "magma_get_buffer_id", |
| "type": "uint64_t", |
| "description": "Returns a unique id for the given buffer.", |
| "arguments": [ |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| } |
| ] |
| }, |
| { |
| "ordinal": 13, |
| "name": "magma_get_buffer_size", |
| "type": "uint64_t", |
| "description": "Returns the actual size of the given buffer.", |
| "arguments": [ |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| } |
| ] |
| }, |
| { |
| "ordinal": 14, |
| "name": "magma_clean_cache", |
| "type": "magma_status_t", |
| "description": "Cleans, and optionally invalidates, the cache for the region of memory specified by the given buffer, offset, and size, and write the contents to ram.", |
| "arguments": [ |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "offset", |
| "type": "uint64_t", |
| "description": "An offset into the buffer. Must be less than or equal to the buffer's size." |
| }, |
| { |
| "name": "size", |
| "type": "uint64_t", |
| "description": "Size of region to be cleaned. Offset + size must be less than or equal to the buffer's size." |
| }, |
| { |
| "name": "operation", |
| "type": "magma_cache_operation_t", |
| "description": "One of MAGMA_CACHE_OPERATION_CLEAN or MAGMA_CACHE_OPERATION_CLEAN_INVALIDATE." |
| } |
| ] |
| }, |
| { |
| "ordinal": 15, |
| "name": "magma_set_cache_policy", |
| "type": "magma_status_t", |
| "description": "Configures the cache for the given buffer.", |
| "arguments": [ |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "policy", |
| "type": "magma_cache_policy_t", |
| "description": "One of MAGMA_CACHE_POLICY_[CACHED|WRITE_COMBINING|UNCACHED]." |
| } |
| ] |
| }, |
| { |
| "ordinal": 16, |
| "name": "magma_get_buffer_cache_policy", |
| "type": "magma_status_t", |
| "description": "Queries the cache policy for a buffer.", |
| "arguments": [ |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "cache_policy_out", |
| "type": "magma_cache_policy_t*", |
| "description": "The returned cache policy." |
| } |
| ] |
| }, |
| { |
| "ordinal": 17, |
| "name": "magma_get_buffer_is_mappable", |
| "type": "magma_status_t", |
| "description": "Queries whether a buffer is mappable with magma_map or magma_map_aligned", |
| "arguments": [ |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "The given buffer." |
| }, |
| { |
| "name": "flags", |
| "type": "uint32_t", |
| "description": "Reserved for future use. Must be 0." |
| }, |
| { |
| "name": "is_mappable_out", |
| "type": "magma_bool_t*", |
| "description": "The returned mappability value." |
| } |
| ] |
| }, |
| { |
| "ordinal": 18, |
| "name": "magma_set_buffer_mapping_address_range", |
| "type": "magma_status_t", |
| "description": "Sets the mapping address range on the given buffer. Ownership of the handle is transferred to magma.", |
| "arguments": [ |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "The given buffer." |
| }, |
| { |
| "name": "handle", |
| "type": "magma_handle_t", |
| "description": "A platform specific handle to the address range." |
| } |
| ] |
| }, |
| { |
| "ordinal": 19, |
| "name": "magma_map", |
| "type": "magma_status_t", |
| "description": "Maps the given buffer's memory into the calling process's address space.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "addr_out", |
| "type": "void**", |
| "description": "The returned CPU virtual address for the start of the buffer." |
| } |
| ] |
| }, |
| { |
| "ordinal": 20, |
| "name": "magma_map_aligned", |
| "type": "magma_status_t", |
| "description": "Maps the given buffer's memory into the calling process's address space with a given alignment.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "alignment", |
| "type": "uint64_t", |
| "description": "The requested alignment. Must be a power of 2 and at least PAGE_SIZE." |
| }, |
| { |
| "name": "addr_out", |
| "type": "void**", |
| "description": "The returned CPU virtual address for the start of the buffer." |
| } |
| ] |
| }, |
| { |
| "ordinal": 21, |
| "name": "magma_map_specific", |
| "type": "magma_status_t", |
| "description": "Maps a region of the given buffer's memory at the given CPU virtual address. Fails if the buffer was previously mapped, or if the address range is unavailable.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "addr", |
| "type": "uint64_t", |
| "description": "A valid CPU virtual address." |
| }, |
| { |
| "name": "offset", |
| "type": "uint64_t", |
| "description": "Offset into the buffer. Must be less than or equal to the buffer's size." |
| }, |
| { |
| "name": "length", |
| "type": "uint64_t", |
| "description": "Size of region to be mapped. Offset + length must be less than or equal to the buffer's size." |
| } |
| ] |
| }, |
| { |
| "ordinal": 22, |
| "name": "magma_unmap", |
| "type": "magma_status_t", |
| "description": "Releases a CPU mapping for the given buffer. Should be paired with each call to one of the mapping interfaces.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer with at least one active CPU mapping." |
| } |
| ] |
| }, |
| { |
| "ordinal": 23, |
| "name": "magma_map_buffer_gpu", |
| "type": "void", |
| "description": "Maps a number of pages from the given buffer onto the GPU in the connection's address space at the given address.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "page_offset", |
| "type": "uint64_t", |
| "description": "Offset into the buffer in pages." |
| }, |
| { |
| "name": "page_count", |
| "type": "uint64_t", |
| "description": "Number of pages to map." |
| }, |
| { |
| "name": "gpu_va", |
| "type": "uint64_t", |
| "description": "Destination GPU virtual address for the mapping." |
| }, |
| { |
| "name": "map_flags", |
| "type": "uint64_t", |
| "description": "A valid MAGMA_GPU_MAP_FLAGS value." |
| } |
| ] |
| }, |
| { |
| "ordinal": 24, |
| "name": "magma_unmap_buffer_gpu", |
| "type": "void", |
| "description": "Releases the mapping at the given address from the GPU.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "gpu_va", |
| "type": "uint64_t", |
| "description": "A GPU virtual address associated with an existing mapping of the given buffer." |
| } |
| ] |
| }, |
| { |
| "ordinal": 25, |
| "name": "magma_commit_buffer", |
| "type": "magma_status_t", |
| "description": "Ensures that the given page range of a buffer is backed by physical memory. If the buffer is mapped, also ensures that the CPU page tables are populated to avoid unnecessary page faults when supported by the platform.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "page_offset", |
| "type": "uint64_t", |
| "description": "Page offset into the buffer." |
| }, |
| { |
| "name": "page_count", |
| "type": "uint64_t", |
| "description": "Number of pages to commit." |
| } |
| ] |
| }, |
| { |
| "ordinal": 26, |
| "name": "magma_export", |
| "type": "magma_status_t", |
| "description": "Exports the given buffer, returning a handle that may be imported into another connection.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "buffer_handle_out", |
| "type": "magma_handle_t*", |
| "description": "The returned handle." |
| } |
| ] |
| }, |
| { |
| "ordinal": 27, |
| "name": "magma_import", |
| "type": "magma_status_t", |
| "description": "Imports and takes ownership of the buffer referred to by the given handle.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer_handle", |
| "type": "magma_handle_t", |
| "description": "A valid handle." |
| }, |
| { |
| "name": "buffer_out", |
| "type": "magma_buffer_t*", |
| "description": "The returned buffer." |
| } |
| ] |
| }, |
| { |
| "ordinal": 31, |
| "name": "magma_execute_command_buffer_with_resources", |
| "type": "void", |
| "description": "Submits a command buffer for execution on the GPU, with associated resources.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "context_id", |
| "type": "uint32_t", |
| "description": "A valid context ID." |
| }, |
| { |
| "name": "command_buffer", |
| "type": "struct magma_system_command_buffer*", |
| "description": "A pointer to the command buffer to execute." |
| }, |
| { |
| "name": "resources", |
| "type": "struct magma_system_exec_resource*", |
| "description": "An array of |command_buffer->resource_count| resources associated with the command buffer." |
| }, |
| { |
| "name": "semaphore_ids", |
| "type": "uint64_t*", |
| "description": "An array of semaphore ids; first should be |command_buffer->wait_semaphore_count| wait semaphores followed by |command_buffer->signal_signal_semaphores| signal semaphores." |
| } |
| ] |
| }, |
| { |
| "ordinal": 33, |
| "name": "magma_execute_immediate_commands2", |
| "type": "void", |
| "description": "Submits a series of commands for execution on the GPU without using a command buffer.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "context_id", |
| "type": "uint32_t", |
| "description": "A valid context ID." |
| }, |
| { |
| "name": "command_count", |
| "type": "uint64_t", |
| "description": "The number of commands in the provided buffer." |
| }, |
| { |
| "name": "command_buffers", |
| "type": "struct magma_inline_command_buffer*", |
| "description": "An array of command_count magma_inline_command_buffer structs." |
| } |
| ] |
| }, |
| { |
| "ordinal": 34, |
| "name": "magma_create_semaphore", |
| "type": "magma_status_t", |
| "description": "Creates a semaphore.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "semaphore_out", |
| "type": "magma_semaphore_t*", |
| "description": "The returned semaphore." |
| } |
| ] |
| }, |
| { |
| "ordinal": 35, |
| "name": "magma_release_semaphore", |
| "type": "void", |
| "description": "Releases the given semaphore.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "semaphore", |
| "type": "magma_semaphore_t", |
| "description": "A valid semaphore." |
| } |
| ] |
| }, |
| { |
| "ordinal": 36, |
| "name": "magma_get_semaphore_id", |
| "type": "uint64_t", |
| "description": "Returns a unique id for the given semaphore.", |
| "arguments": [ |
| { |
| "name": "semaphore", |
| "type": "magma_semaphore_t", |
| "description": "A valid semaphore." |
| } |
| ] |
| }, |
| { |
| "ordinal": 37, |
| "name": "magma_signal_semaphore", |
| "type": "void", |
| "description": "Signals the given semaphore.", |
| "arguments": [ |
| { |
| "name": "semaphore", |
| "type": "magma_semaphore_t", |
| "description": "A valid semaphore." |
| } |
| ] |
| }, |
| { |
| "ordinal": 38, |
| "name": "magma_reset_semaphore", |
| "type": "void", |
| "description": "Resets the given semaphore.", |
| "arguments": [ |
| { |
| "name": "semaphore", |
| "type": "magma_semaphore_t", |
| "description": "A valid semaphore." |
| } |
| ] |
| }, |
| { |
| "ordinal": 39, |
| "name": "magma_wait_semaphores", |
| "type": "magma_status_t", |
| "description": "DEPRECATED. Waits for one or all provided semaphores to be signaled. Does not reset any semaphores.", |
| "arguments": [ |
| { |
| "name": "semaphores", |
| "type": "const magma_semaphore_t*", |
| "description": "Array of valid semaphores." |
| }, |
| { |
| "name": "count", |
| "type": "uint32_t", |
| "description": "Number of semaphores in the array." |
| }, |
| { |
| "name": "timeout_ms", |
| "type": "uint64_t", |
| "description": "Time to wait before returning MAGMA_STATUS_TIMED_OUT." |
| }, |
| { |
| "name": "wait_all", |
| "type": "magma_bool_t", |
| "description": "If true, wait for all semaphores, otherwise wait for any semaphore." |
| } |
| ] |
| }, |
| { |
| "ordinal": 40, |
| "name": "magma_export_semaphore", |
| "type": "magma_status_t", |
| "description": "Exports the given semaphore, returning a handle that may be imported into another connection", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "semaphore", |
| "type": "magma_semaphore_t", |
| "description": "A valid semaphore." |
| }, |
| { |
| "name": "semaphore_handle_out", |
| "type": "magma_handle_t*", |
| "description": "The returned handle." |
| } |
| ] |
| }, |
| { |
| "ordinal": 41, |
| "name": "magma_import_semaphore", |
| "type": "magma_status_t", |
| "description": "Imports and takes ownership of the semaphore referred to by the given handle.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "semaphore_handle", |
| "type": "magma_handle_t", |
| "description": "A valid semaphore handle." |
| }, |
| { |
| "name": "semaphore_out", |
| "type": "magma_semaphore_t*", |
| "description": "The returned semaphore." |
| } |
| ] |
| }, |
| { |
| "ordinal": 42, |
| "name": "magma_get_notification_channel_handle", |
| "type": "magma_handle_t", |
| "description": "Returns a handle that can be waited on to determine when the connection has data in the notification channel. This channel has the same lifetime as the connection and must not be closed by the client.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| } |
| ] |
| }, |
| { |
| "ordinal": 43, |
| "name": "magma_wait_notification_channel", |
| "type": "magma_status_t", |
| "description": "DEPRECATED. Returns MAGMA_STATUS_OK if a message is available on the notification channel before the given timeout expires.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "timeout_ns", |
| "type": "int64_t", |
| "description": "Time to wait before returning MAGMA_STATUS_TIMED_OUT." |
| } |
| ] |
| }, |
| { |
| "ordinal": 44, |
| "name": "magma_read_notification_channel", |
| "type": "magma_status_t", |
| "description": "Reads a notification from the channel into the given buffer.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "void*", |
| "description": "Buffer into which to read notification data." |
| }, |
| { |
| "name": "buffer_size", |
| "type": "uint64_t", |
| "description": "Size of the given buffer." |
| }, |
| { |
| "name": "buffer_size_out", |
| "type": "uint64_t*", |
| "description": "Returned size of the notification data written to the buffer, or 0 if there are no messages pending." |
| } |
| ] |
| }, |
| { |
| "ordinal": 45, |
| "name": "magma_initialize_tracing", |
| "type": "magma_status_t", |
| "description": "Initializes tracing", |
| "arguments": [ |
| { |
| "name": "channel", |
| "type": "magma_handle_t", |
| "description": "An open connection to a tracing provider." |
| } |
| ] |
| }, |
| { |
| "ordinal": 46, |
| "name": "magma_device_import", |
| "type": "magma_status_t", |
| "description": "Imports and takes ownership of a channel to a device.", |
| "arguments": [ |
| { |
| "name": "device_channel", |
| "type": "magma_handle_t", |
| "description": "A channel connecting to a gpu class device." |
| }, |
| { |
| "name": "device_out", |
| "type": "magma_device_t*", |
| "description": "Returned device." |
| } |
| ] |
| }, |
| { |
| "ordinal": 47, |
| "name": "magma_device_release", |
| "type": "void", |
| "description": "Releases a handle to a device", |
| "arguments": [ |
| { |
| "name": "device", |
| "type": "magma_device_t", |
| "description": "An open device." |
| } |
| ] |
| }, |
| { |
| "ordinal": 48, |
| "name": "magma_query2", |
| "type": "magma_status_t", |
| "description": "Performs a query and returns a result synchronously.", |
| "arguments": [ |
| { |
| "name": "device", |
| "type": "magma_device_t", |
| "description": "An open device." |
| }, |
| { |
| "name": "id", |
| "type": "uint64_t", |
| "description": "Either MAGMA_QUERY_DEVICE_ID, or a vendor-specific id starting from MAGMA_QUERY_VENDOR_PARAM_0." |
| }, |
| { |
| "name": "value_out", |
| "type": "uint64_t*", |
| "description": "Returned value." |
| } |
| ] |
| }, |
| { |
| "ordinal": 49, |
| "name": "magma_query_returns_buffer2", |
| "type": "magma_status_t", |
| "description": "Performs a query for a large amount of data and puts that into a buffer. Returns synchronously", |
| "arguments": [ |
| { |
| "name": "device", |
| "type": "magma_device_t", |
| "description": "An open device." |
| }, |
| { |
| "name": "id", |
| "type": "uint64_t", |
| "description": "A vendor-specific ID." |
| }, |
| { |
| "name": "handle_out", |
| "type": "magma_handle_t*", |
| "description": "Handle to the returned buffer." |
| } |
| ] |
| }, |
| { |
| "ordinal": 50, |
| "name": "magma_create_connection2", |
| "type": "magma_status_t", |
| "description": "Opens a connection to a device.", |
| "arguments": [ |
| { |
| "name": "device", |
| "type": "magma_device_t", |
| "description": "An open device" |
| }, |
| { |
| "name": "connection_out", |
| "type": "magma_connection_t*", |
| "description": "Returned connection." |
| } |
| ] |
| }, |
| { |
| "ordinal": 51, |
| "name": "magma_initialize_logging", |
| "type": "magma_status_t", |
| "description": "Initializes logging; used for debug and some exceptional error reporting.", |
| "arguments": [ |
| { |
| "name": "channel", |
| "type": "magma_handle_t", |
| "description": "An open connection to the syslog service." |
| } |
| ] |
| }, |
| { |
| "ordinal": 52, |
| "name": "magma_poll", |
| "type": "magma_status_t", |
| "description": "Waits for at least one of the given items to meet a condition. Does not reset any semaphores. Results are returned in the items array.", |
| "arguments": [ |
| { |
| "name": "items", |
| "type": "magma_poll_item_t*", |
| "description": "Array of poll items. Type should be either MAGMA_POLL_TYPE_SEMAPHORE or MAGMA_POLL_TYPE_HANDLE. Condition may be set to MAGMA_POLL_CONDITION_SIGNALED OR MAGMA_POLL_CONDITION_READABLE. If condition is 0 the item is ignored. Item results are set to the condition that was satisfied, otherwise 0. If the same item is given twice the behavior is undefined." |
| }, |
| { |
| "name": "count", |
| "type": "uint32_t", |
| "description": "Number of poll items in the array." |
| }, |
| { |
| "name": "timeout_ns", |
| "type": "uint64_t", |
| "description": "Time in ns to wait before returning MAGMA_STATUS_TIMED_OUT." |
| } |
| ] |
| }, |
| { |
| "ordinal": 53, |
| "name": "magma_connection_access_performance_counters", |
| "type": "magma_status_t", |
| "description": "Tries to enable access to performance counters. Returns MAGMA_STATUS_OK if counters were successfully enabled or MAGMA_STATUS_ACCESS_DENIED if channel is for the wrong device and counters were not successfully enabled previously.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection to a device." |
| }, |
| { |
| "name": "channel", |
| "type": "magma_handle_t", |
| "description": "A handle to a channel to a gpu-performance-counter device." |
| } |
| ] |
| }, |
| { |
| "ordinal": 54, |
| "name": "magma_map_constrained", |
| "type": "magma_status_t", |
| "description": "Maps the given buffer's memory below the given CPU virtual address. Fails if the buffer was previously mapped, or if a suitable address range is unavailable.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "length", |
| "type": "uint64_t", |
| "description": "The length of the region to map." |
| }, |
| { |
| "name": "upper_limit", |
| "type": "uint64_t", |
| "description": "The upper limit of the virtual address space to map the buffer." |
| }, |
| { |
| "name": "alignment", |
| "type": "uint64_t", |
| "description": "The requested alignment. Must either be 0 (default page alignment) or a power of 2 >= PAGE_SIZE." |
| }, |
| { |
| "name": "addr_out", |
| "type": "void**", |
| "description": "The returned CPU virtual address for the start of the buffer." |
| } |
| ] |
| }, |
| { |
| "ordinal": 55, |
| "name": "magma_buffer_set_padding", |
| "type": "magma_status_t", |
| "description": "Sets how much empty address space to leave after any CPU mappings of a buffer.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "padding", |
| "type": "uint64_t", |
| "description": "The number of bytes of padding to use." |
| } |
| ] |
| }, |
| { |
| "ordinal": 56, |
| "name": "magma_connection_enable_performance_counters", |
| "type": "magma_status_t", |
| "description": "Enables a set of performance counters (the precise definition depends on the GPU driver). 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 magma_connection_access_performance_counters before calling this method.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection to a device." |
| }, |
| { |
| "name": "counters", |
| "type": "uint64_t*", |
| "description": "An implementation-defined list of counters." |
| }, |
| { |
| "name": "counters_count", |
| "type": "uint64_t", |
| "description": "The number of entries in |counters|." |
| } |
| ] |
| }, |
| { |
| "ordinal": 57, |
| "name": "magma_connection_create_performance_counter_buffer_pool", |
| "type": "magma_status_t", |
| "description": "Create a pool of buffers that performance counters can be dumped into. Performance counter access must have been enabled using magma_connection_access_performance_counters before calling this method.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection to a device." |
| }, |
| { |
| "name": "pool_out", |
| "type": "magma_perf_count_pool_t*", |
| "description": "A new pool id. Must not currently be in use." |
| }, |
| { |
| "name": "notification_handle_out", |
| "type": "magma_handle_t*", |
| "description": "A handle that should be waited on." |
| } |
| ] |
| }, |
| { |
| "ordinal": 58, |
| "name": "magma_connection_release_performance_counter_buffer_pool", |
| "type": "magma_status_t", |
| "description": "Releases a pool of performance counter buffers. Performance counter access must have been enabled using magma_connection_access_performance_counters before calling this method.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection to a device." |
| }, |
| { |
| "name": "pool", |
| "type": "magma_perf_count_pool_t", |
| "description": "An existing pool id." |
| } |
| ] |
| }, |
| { |
| "ordinal": 59, |
| "name": "magma_connection_add_performance_counter_buffer_offsets_to_pool", |
| "type": "magma_status_t", |
| "description": "Adds a an array of buffers + offset to the pool. |offsets[n].buffer_id| is the koid 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].offset| bytes into the buffer, and up to |offsets[n].offset| + |offsets[n].size|. |offsets[n].size| must be large enough to fit all enabled counters. Performance counter access must have been enabled using magma_connection_access_performance_counters before calling this method.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection to a device." |
| }, |
| { |
| "name": "pool", |
| "type": "magma_perf_count_pool_t", |
| "description": "An existing pool." |
| }, |
| { |
| "name": "offsets", |
| "type": "const struct magma_buffer_offset*", |
| "description": "An array of offsets to add." |
| }, |
| { |
| "name": "offsets_count", |
| "type": "uint64_t", |
| "description": "The number of elements in offsets." |
| } |
| ] |
| }, |
| { |
| "ordinal": 60, |
| "name": "magma_connection_remove_performance_counter_buffer_from_pool", |
| "type": "magma_status_t", |
| "description": "Removes every offset of a buffer from the pool. Performance counter access must have been enabled using magma_connection_access_performance_counters before calling this method.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection to a device." |
| }, |
| { |
| "name": "pool_id", |
| "type": "magma_perf_count_pool_t", |
| "description": "An existing pool." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A magma_buffer" |
| } |
| ] |
| }, |
| { |
| "ordinal": 61, |
| "name": "magma_connection_dump_performance_counters", |
| "type": "magma_status_t", |
| "description": "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 magma_connection_access_performance_counters before calling this method.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection to a device." |
| }, |
| { |
| "name": "pool", |
| "type": "magma_perf_count_pool_t", |
| "description": "An existing pool" |
| }, |
| { |
| "name": "trigger_id", |
| "type": "uint32_t", |
| "description": "An arbitrary ID assigned by the client that will be returned in OnPerformanceCounterReadCompleted." |
| } |
| ] |
| }, |
| { |
| "ordinal": 62, |
| "name": "magma_connection_clear_performance_counters", |
| "type": "magma_status_t", |
| "description": "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 magma_connection_access_performance_counters before calling this method.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection to a device." |
| }, |
| { |
| "name": "counters", |
| "type": "uint64_t*", |
| "description": "An implementation-defined list of counters." |
| }, |
| { |
| "name": "counters_count", |
| "type": "uint64_t", |
| "description": "The number of entries in |counters|." |
| } |
| ] |
| }, |
| { |
| "ordinal": 63, |
| "name": "magma_connection_read_performance_counter_completion", |
| "type": "magma_status_t", |
| "description": "Reads one performance counter completion event, if available.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection to a device." |
| }, |
| { |
| "name": "pool", |
| "type": "magma_perf_count_pool_t", |
| "description": "An existing pool." |
| }, |
| { |
| "name": "trigger_id_out", |
| "type": "uint32_t*", |
| "description": "The trigger ID for this event." |
| }, |
| { |
| "name": "buffer_id_out", |
| "type": "uint64_t*", |
| "description": "The buffer ID for this event." |
| }, |
| { |
| "name": "buffer_offset_out", |
| "type": "uint32_t*", |
| "description": "The buffer offset for this event." |
| }, |
| { |
| "name": "time_out", |
| "type": "uint64_t*", |
| "description": "The monotonic time this event happened." |
| }, |
| { |
| "name": "result_flags_out", |
| "type": "uint32_t*", |
| "description": "A set of flags giving more information about this event." |
| } |
| ] |
| }, |
| { |
| "ordinal": 64, |
| "name": "magma_buffer_set_name", |
| "type": "magma_status_t", |
| "description": "Sets a name for the buffer for use in debugging tools.", |
| "arguments": [ |
| { |
| "name": "connection", |
| "type": "magma_connection_t", |
| "description": "An open connection." |
| }, |
| { |
| "name": "buffer", |
| "type": "magma_buffer_t", |
| "description": "A valid buffer." |
| }, |
| { |
| "name": "name", |
| "type": "const char*", |
| "description": "The 0-terminated name of the buffer. May be truncated." |
| } |
| ] |
| } |
| ] |
| } |
| } |