aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJammy Zhou2015-08-16 22:09:08 -0500
committerAlex Deucher2015-08-17 15:26:26 -0500
commitffa305d0fc926418e4dff432381ead8907dc18d9 (patch)
tree1581c8b5ba358942fe6a376bf85e7750af6d3d3a /amdgpu/amdgpu_internal.h
parent102ab6f0049c2c85857fd19f098bc5b51e2a8a60 (diff)
downloadexternal-libdrm-ffa305d0fc926418e4dff432381ead8907dc18d9.tar.gz
external-libdrm-ffa305d0fc926418e4dff432381ead8907dc18d9.tar.xz
external-libdrm-ffa305d0fc926418e4dff432381ead8907dc18d9.zip
amdgpu: add flag to support 32bit VA address v4
The AMDGPU_VA_RANGE_32_BIT flag is added to request VA range in the 32bit address space for amdgpu_va_range_alloc. The 32bit address space is reserved at initialization time, and managed with a separate VAMGR as part of the global VAMGR. And if no enough VA space available in range above 4GB, this reserved range can be used as fallback. v2: add comment for AMDGPU_VA_RANGE_32_BIT, and add vamgr to va_range v3: rebase to Emil's drm_private series v4: fix one warning Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian K├Ânig <christian.koenig@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_internal.h')
-rw-r--r--amdgpu/amdgpu_internal.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index 4b07aff8..3ce0969e 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -66,6 +66,7 @@ struct amdgpu_va {
66 uint64_t address; 66 uint64_t address;
67 uint64_t size; 67 uint64_t size;
68 enum amdgpu_gpu_va_range range; 68 enum amdgpu_gpu_va_range range;
69 struct amdgpu_bo_va_mgr *vamgr;
69}; 70};
70 71
71struct amdgpu_device { 72struct amdgpu_device {
@@ -83,7 +84,10 @@ struct amdgpu_device {
83 pthread_mutex_t bo_table_mutex; 84 pthread_mutex_t bo_table_mutex;
84 struct drm_amdgpu_info_device dev_info; 85 struct drm_amdgpu_info_device dev_info;
85 struct amdgpu_gpu_info info; 86 struct amdgpu_gpu_info info;
87 /** The global VA manager for the whole virtual address space */
86 struct amdgpu_bo_va_mgr *vamgr; 88 struct amdgpu_bo_va_mgr *vamgr;
89 /** The VA manager for the 32bit address space */
90 struct amdgpu_bo_va_mgr *vamgr_32;
87}; 91};
88 92
89struct amdgpu_bo { 93struct amdgpu_bo {
@@ -128,6 +132,11 @@ drm_private void
128amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst, 132amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst,
129 struct amdgpu_bo_va_mgr *src); 133 struct amdgpu_bo_va_mgr *src);
130 134
135drm_private void amdgpu_vamgr_init(struct amdgpu_bo_va_mgr *mgr, uint64_t start,
136 uint64_t max, uint64_t alignment);
137
138drm_private void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr);
139
131drm_private uint64_t 140drm_private uint64_t
132amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size, 141amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
133 uint64_t alignment, uint64_t base_required); 142 uint64_t alignment, uint64_t base_required);