diff options
author | Christian König <christian.koenig@amd.com> | 2015-06-08 15:05:07 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-05 13:47:51 -0400 |
commit | 933091e1d64aea4ec81c0f4a83d30b01408fe795 (patch) | |
tree | ac39ff906ed53cb6c9ec964f8e06a37f8bd858ff /amdgpu | |
parent | 804048ff65e65df6cfad6bd5c78c27af5a510362 (diff) | |
download | libdrm-933091e1d64aea4ec81c0f4a83d30b01408fe795.tar.gz libdrm-933091e1d64aea4ec81c0f4a83d30b01408fe795.tar.bz2 libdrm-933091e1d64aea4ec81c0f4a83d30b01408fe795.zip |
amdgpu: cleanup VA IOCTL handling
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r-- | amdgpu/amdgpu_bo.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c index 72688d43..770a72be 100644 --- a/amdgpu/amdgpu_bo.c +++ b/amdgpu/amdgpu_bo.c @@ -56,7 +56,7 @@ static void amdgpu_close_kms_handle(amdgpu_device_handle dev, static int amdgpu_bo_map(amdgpu_bo_handle bo, uint32_t alignment) { amdgpu_device_handle dev = bo->dev; - union drm_amdgpu_gem_va va; + struct drm_amdgpu_gem_va va; int r; memset(&va, 0, sizeof(va)); @@ -67,17 +67,17 @@ static int amdgpu_bo_map(amdgpu_bo_handle bo, uint32_t alignment) if (bo->virtual_mc_base_address == AMDGPU_INVALID_VA_ADDRESS) return -ENOSPC; - va.in.handle = bo->handle; - va.in.operation = AMDGPU_VA_OP_MAP; - va.in.flags = AMDGPU_VM_PAGE_READABLE | + va.handle = bo->handle; + va.operation = AMDGPU_VA_OP_MAP; + va.flags = AMDGPU_VM_PAGE_READABLE | AMDGPU_VM_PAGE_WRITEABLE | AMDGPU_VM_PAGE_EXECUTABLE; - va.in.va_address = bo->virtual_mc_base_address; - va.in.offset_in_bo = 0; - va.in.map_size = ALIGN(bo->alloc_size, getpagesize()); + va.va_address = bo->virtual_mc_base_address; + va.offset_in_bo = 0; + va.map_size = ALIGN(bo->alloc_size, getpagesize()); r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_GEM_VA, &va, sizeof(va)); - if (r || va.out.result == AMDGPU_VA_RESULT_ERROR) { + if (r) { amdgpu_bo_free_internal(bo); return r; } @@ -89,7 +89,7 @@ static int amdgpu_bo_map(amdgpu_bo_handle bo, uint32_t alignment) static void amdgpu_bo_unmap(amdgpu_bo_handle bo) { amdgpu_device_handle dev = bo->dev; - union drm_amdgpu_gem_va va; + struct drm_amdgpu_gem_va va; int r; if (bo->virtual_mc_base_address == AMDGPU_INVALID_VA_ADDRESS) @@ -97,17 +97,17 @@ static void amdgpu_bo_unmap(amdgpu_bo_handle bo) memset(&va, 0, sizeof(va)); - va.in.handle = bo->handle; - va.in.operation = AMDGPU_VA_OP_UNMAP; - va.in.flags = AMDGPU_VM_PAGE_READABLE | + va.handle = bo->handle; + va.operation = AMDGPU_VA_OP_UNMAP; + va.flags = AMDGPU_VM_PAGE_READABLE | AMDGPU_VM_PAGE_WRITEABLE | AMDGPU_VM_PAGE_EXECUTABLE; - va.in.va_address = bo->virtual_mc_base_address; - va.in.offset_in_bo = 0; - va.in.map_size = ALIGN(bo->alloc_size, getpagesize()); + va.va_address = bo->virtual_mc_base_address; + va.offset_in_bo = 0; + va.map_size = ALIGN(bo->alloc_size, getpagesize()); r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_GEM_VA, &va, sizeof(va)); - if (r || va.out.result == AMDGPU_VA_RESULT_ERROR) { + if (r) { fprintf(stderr, "amdgpu: VA_OP_UNMAP failed with %d\n", r); return; } |