Commit f49dccbb authored by Junwei Zhang's avatar Junwei Zhang Committed by Christian König
Browse files

amdgpu: add bo from user memory to handle table



When create bo from user memory, add it to handle table
for future query.
Signed-off-by: Junwei Zhang's avatarJunwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König's avatarChristian König <christian.koenig@amd.com>
parent f693c468
......@@ -556,7 +556,16 @@ int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
bo->alloc_size = size;
bo->handle = args.handle;
*buf_handle = bo;
pthread_mutex_lock(&bo->dev->bo_table_mutex);
r = handle_table_insert(&bo->dev->bo_handles, bo->handle, bo);
pthread_mutex_unlock(&bo->dev->bo_table_mutex);
pthread_mutex_init(&bo->cpu_access_mutex, NULL);
if (r)
amdgpu_bo_free(bo);
else
*buf_handle = bo;
return r;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment