@@ -695,7 +695,7 @@ int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
*
*/
int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
- void *cpu,
+ char *cpu,
uint64_t size,
amdgpu_bo_handle *buf_handle,
uint64_t *offset_in_bo);
@@ -530,7 +530,7 @@ int amdgpu_bo_wait_for_idle(amdgpu_bo_handle bo,
}
int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
- void *cpu,
+ char *cpu,
uint64_t size,
amdgpu_bo_handle *buf_handle,
uint64_t *offset_in_bo)
@@ -551,14 +551,15 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
bo = handle_table_lookup(&dev->bo_handles, i);
if (!bo || !bo->cpu_ptr || size > bo->alloc_size)
continue;
- if (cpu >= bo->cpu_ptr && cpu < (bo->cpu_ptr + bo->alloc_size))
+ if (cpu >= (char*)bo->cpu_ptr &&
+ cpu < ((char*)bo->cpu_ptr + bo->alloc_size))
break;
}
if (i < dev->bo_handles.max_key) {
atomic_inc(&bo->refcount);
*buf_handle = bo;
- *offset_in_bo = cpu - bo->cpu_ptr;
+ *offset_in_bo = cpu - (char*)bo->cpu_ptr;
} else {
*buf_handle = NULL;
*offset_in_bo = 0;