summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJammy Zhou <Jammy.Zhou@amd.com>2015-07-15 11:26:28 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-07-16 17:28:17 -0400
commitea32253541959cc36a40fb0118200a8f493dc98a (patch)
treee232f5fe645284fcea88d846116ff2e326da7304
parent3010d3259d3bc74263d526e54e02bc169c8d4b4d (diff)
Adapt to the interface change of amdgpu_bo_alloc v3
The amdgpu_bo_alloc_result structure is removed from libdrm_amdgpu, and the amdgpu_bo_handle is returned directly v2: remove the va_map/unmap v3: simply the code a bit Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--src/amdgpu_bo_helper.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
index 00e8643..0a32934 100644
--- a/src/amdgpu_bo_helper.c
+++ b/src/amdgpu_bo_helper.c
@@ -193,11 +193,9 @@ struct amdgpu_buffer *amdgpu_bo_open(amdgpu_device_handle pDev,
uint32_t domains)
{
struct amdgpu_bo_alloc_request alloc_request;
- struct amdgpu_bo_alloc_result buffer;
struct amdgpu_buffer *bo = NULL;
memset(&alloc_request, 0, sizeof(struct amdgpu_bo_alloc_request));
- memset(&buffer, 0, sizeof(struct amdgpu_bo_alloc_result));
bo = (struct amdgpu_buffer *)calloc(1, sizeof(struct amdgpu_buffer));
if (bo == NULL) {
@@ -208,12 +206,11 @@ struct amdgpu_buffer *amdgpu_bo_open(amdgpu_device_handle pDev,
alloc_request.phys_alignment = phys_alignment;
alloc_request.preferred_heap = domains;
- if (amdgpu_bo_alloc(pDev, &alloc_request, &buffer)) {
+ if (amdgpu_bo_alloc(pDev, &alloc_request, &bo->bo.amdgpu)) {
free(bo);
return NULL;
}
- bo->bo.amdgpu = buffer.buf_handle;
bo->ref_count = 1;
return bo;