sync with OpenBSD -current
This commit is contained in:
parent
abc24a81d1
commit
921461fcd8
53 changed files with 2169 additions and 443 deletions
|
@ -63,6 +63,7 @@ amdgpu_query_crtc_from_id
|
|||
amdgpu_query_firmware_version
|
||||
amdgpu_query_gds_info
|
||||
amdgpu_query_gpu_info
|
||||
amdgpu_query_gpuvm_fault_info
|
||||
amdgpu_query_heap_info
|
||||
amdgpu_query_hw_ip_count
|
||||
amdgpu_query_hw_ip_info
|
||||
|
@ -72,6 +73,7 @@ amdgpu_query_video_caps_info
|
|||
amdgpu_read_mm_registers
|
||||
amdgpu_va_range_alloc
|
||||
amdgpu_va_range_free
|
||||
amdgpu_va_get_start_addr
|
||||
amdgpu_va_range_query
|
||||
amdgpu_vm_reserve_vmid
|
||||
amdgpu_vm_unreserve_vmid
|
||||
|
|
|
@ -1282,6 +1282,22 @@ int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
|
|||
int amdgpu_query_video_caps_info(amdgpu_device_handle dev, unsigned cap_type,
|
||||
unsigned size, void *value);
|
||||
|
||||
/**
|
||||
* Query information about VM faults
|
||||
*
|
||||
* The return sizeof(struct drm_amdgpu_info_gpuvm_fault)
|
||||
*
|
||||
* \param dev - \c [in] Device handle. See #amdgpu_device_initialize()
|
||||
* \param size - \c [in] Size of the returned value.
|
||||
* \param value - \c [out] Pointer to the return value.
|
||||
*
|
||||
* \return 0 on success\n
|
||||
* <0 - Negative POSIX Error code
|
||||
*
|
||||
*/
|
||||
int amdgpu_query_gpuvm_fault_info(amdgpu_device_handle dev, unsigned size,
|
||||
void *value);
|
||||
|
||||
/**
|
||||
* Read a set of consecutive memory-mapped registers.
|
||||
* Not all registers are allowed to be read by userspace.
|
||||
|
@ -1368,6 +1384,11 @@ int amdgpu_va_range_alloc(amdgpu_device_handle dev,
|
|||
*/
|
||||
int amdgpu_va_range_free(amdgpu_va_handle va_range_handle);
|
||||
|
||||
/**
|
||||
* Return the starting address of the allocated virtual address range.
|
||||
*/
|
||||
uint64_t amdgpu_va_get_start_addr(amdgpu_va_handle va_handle);
|
||||
|
||||
/**
|
||||
* Query virtual address range
|
||||
*
|
||||
|
|
|
@ -551,7 +551,7 @@ drm_public int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
|
|||
if (!bo || !bo->cpu_ptr || size > bo->alloc_size)
|
||||
continue;
|
||||
if (cpu >= bo->cpu_ptr &&
|
||||
cpu < (void*)((uintptr_t)bo->cpu_ptr + bo->alloc_size))
|
||||
cpu < (void*)((uintptr_t)bo->cpu_ptr + (size_t)bo->alloc_size))
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,10 +56,22 @@ drm_public int amdgpu_cs_ctx_create2(amdgpu_device_handle dev,
|
|||
union drm_amdgpu_ctx args;
|
||||
int i, j, k;
|
||||
int r;
|
||||
char *override_priority;
|
||||
|
||||
if (!dev || !context)
|
||||
return -EINVAL;
|
||||
|
||||
override_priority = getenv("AMD_PRIORITY");
|
||||
if (override_priority) {
|
||||
/* The priority is a signed integer. The variable type is
|
||||
* wrong. If parsing fails, priority is unchanged.
|
||||
*/
|
||||
if (sscanf(override_priority, "%i", &priority) == 1) {
|
||||
printf("amdgpu: context priority changed to %i\n",
|
||||
priority);
|
||||
}
|
||||
}
|
||||
|
||||
gpu_context = calloc(1, sizeof(struct amdgpu_context));
|
||||
if (!gpu_context)
|
||||
return -ENOMEM;
|
||||
|
@ -128,8 +140,8 @@ drm_public int amdgpu_cs_ctx_free(amdgpu_context_handle context)
|
|||
for (i = 0; i < AMDGPU_HW_IP_NUM; i++) {
|
||||
for (j = 0; j < AMDGPU_HW_IP_INSTANCE_MAX_COUNT; j++) {
|
||||
for (k = 0; k < AMDGPU_CS_MAX_RINGS; k++) {
|
||||
amdgpu_semaphore_handle sem;
|
||||
LIST_FOR_EACH_ENTRY(sem, &context->sem_list[i][j][k], list) {
|
||||
amdgpu_semaphore_handle sem, tmp;
|
||||
LIST_FOR_EACH_ENTRY_SAFE(sem, tmp, &context->sem_list[i][j][k], list) {
|
||||
list_del(&sem->list);
|
||||
amdgpu_cs_reset_sem(sem);
|
||||
amdgpu_cs_unreference_sem(sem);
|
||||
|
|
|
@ -346,3 +346,17 @@ drm_public int amdgpu_query_video_caps_info(amdgpu_device_handle dev, unsigned c
|
|||
return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request,
|
||||
sizeof(struct drm_amdgpu_info));
|
||||
}
|
||||
|
||||
drm_public int amdgpu_query_gpuvm_fault_info(amdgpu_device_handle dev,
|
||||
unsigned size, void *value)
|
||||
{
|
||||
struct drm_amdgpu_info request;
|
||||
|
||||
memset(&request, 0, sizeof(request));
|
||||
request.return_pointer = (uintptr_t)value;
|
||||
request.return_size = size;
|
||||
request.query = AMDGPU_INFO_GPUVM_FAULT;
|
||||
|
||||
return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request,
|
||||
sizeof(struct drm_amdgpu_info));
|
||||
}
|
||||
|
|
|
@ -57,7 +57,6 @@ struct amdgpu_bo_va_mgr {
|
|||
};
|
||||
|
||||
struct amdgpu_va {
|
||||
amdgpu_device_handle dev;
|
||||
uint64_t address;
|
||||
uint64_t size;
|
||||
enum amdgpu_gpu_va_range range;
|
||||
|
|
|
@ -274,7 +274,6 @@ drm_public int amdgpu_va_range_alloc(amdgpu_device_handle dev,
|
|||
amdgpu_vamgr_free_va(vamgr, *va_base_allocated, size);
|
||||
return -ENOMEM;
|
||||
}
|
||||
va->dev = dev;
|
||||
va->address = *va_base_allocated;
|
||||
va->size = size;
|
||||
va->range = va_range_type;
|
||||
|
@ -296,3 +295,8 @@ drm_public int amdgpu_va_range_free(amdgpu_va_handle va_range_handle)
|
|||
free(va_range_handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_public uint64_t amdgpu_va_get_start_addr(amdgpu_va_handle va_handle)
|
||||
{
|
||||
return va_handle->address;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ libdrm_amdgpu = library(
|
|||
],
|
||||
include_directories : [inc_root, inc_drm],
|
||||
link_with : libdrm,
|
||||
dependencies : [dep_pthread_stubs, dep_atomic_ops, dep_rt],
|
||||
dependencies : [dep_threads, dep_atomic_ops, dep_rt],
|
||||
version : '1.0.0',
|
||||
install : true,
|
||||
)
|
||||
|
@ -65,6 +65,6 @@ test(
|
|||
args : [
|
||||
'--lib', libdrm_amdgpu,
|
||||
'--symbols-file', files('amdgpu-symbols.txt'),
|
||||
'--nm', prog_nm.path(),
|
||||
'--nm', prog_nm.full_path(),
|
||||
],
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue