diff options
Diffstat (limited to '')
-rw-r--r-- | amdgpu/amdgpu.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index 9bdbf36..c9c1f12 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -139,6 +139,12 @@ typedef struct amdgpu_bo_list *amdgpu_bo_list_handle; typedef struct amdgpu_va *amdgpu_va_handle; /** + * Define handle dealing with VA allocation. An amdgpu_device + * owns one of these, but they can also be used without a device. + */ +typedef struct amdgpu_va_manager *amdgpu_va_manager_handle; + +/** * Define handle for semaphore */ typedef struct amdgpu_semaphore *amdgpu_semaphore_handle; @@ -528,6 +534,20 @@ int amdgpu_device_initialize(int fd, amdgpu_device_handle *device_handle); /** + * Same as amdgpu_device_initialize() except when deduplicate_device + * is false *and* fd points to a device that was already initialized. + * In this case, amdgpu_device_initialize would return the same + * amdgpu_device_handle while here amdgpu_device_initialize2 would + * return a new handle. + * amdgpu_device_initialize() should be preferred in most situations; + * the only use-case where not-deduplicating devices make sense is + * when one wants to have isolated device handles in the same process. + */ +int amdgpu_device_initialize2(int fd, bool deduplicate_device, + uint32_t *major_version, + uint32_t *minor_version, + amdgpu_device_handle *device_handle); +/** * * When access to such library does not needed any more the special * function must be call giving opportunity to clean up any @@ -1411,6 +1431,37 @@ int amdgpu_va_range_query(amdgpu_device_handle dev, uint64_t *end); /** + * Allocate a amdgpu_va_manager object. + * The returned object has be initialized with the amdgpu_va_manager_init + * before use. + * On release, amdgpu_va_manager_deinit needs to be called, then the memory + * can be released using free(). + */ +amdgpu_va_manager_handle amdgpu_va_manager_alloc(void); + +void amdgpu_va_manager_init(amdgpu_va_manager_handle va_mgr, + uint64_t low_va_offset, uint64_t low_va_max, + uint64_t high_va_offset, uint64_t high_va_max, + uint32_t virtual_address_alignment); + +void amdgpu_va_manager_deinit(amdgpu_va_manager_handle va_mgr); + +/** + * Similar to #amdgpu_va_range_alloc() but allocates VA + * directly from an amdgpu_va_manager_handle instead of using + * the manager from an amdgpu_device. + */ + +int amdgpu_va_range_alloc2(amdgpu_va_manager_handle va_mgr, + enum amdgpu_gpu_va_range va_range_type, + uint64_t size, + uint64_t va_base_alignment, + uint64_t va_base_required, + uint64_t *va_base_allocated, + amdgpu_va_handle *va_range_handle, + uint64_t flags); + +/** * VA mapping/unmapping for the buffer object * * \param bo - \c [in] BO handle |