aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Wang2015-05-21 04:21:21 -0500
committerAlex Deucher2015-08-05 12:47:50 -0500
commit322d02d025cad1a74138c86937c5d5f3ef6215c7 (patch)
treeccedcb0de4a6da4b4b1bd4b5a8fe897e647fe5f3 /amdgpu/amdgpu_internal.h
parentba1653eff8bd8ecc3d5fd5b2bbab604878cfa7e0 (diff)
downloadexternal-libdrm-322d02d025cad1a74138c86937c5d5f3ef6215c7.tar.gz
external-libdrm-322d02d025cad1a74138c86937c5d5f3ef6215c7.tar.xz
external-libdrm-322d02d025cad1a74138c86937c5d5f3ef6215c7.zip
amdgpu: make vamgr global
This is the first sub-patch of va interface task, the va task is about adding more va management interfaces for UMD, by design, the vamgr should be per-process rather than per-device. Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Christian K├Ânig <christian.koenig@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_internal.h')
-rw-r--r--amdgpu/amdgpu_internal.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index 77b12443..c1cd4da7 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -49,6 +49,7 @@ struct amdgpu_bo_va_hole {
49}; 49};
50 50
51struct amdgpu_bo_va_mgr { 51struct amdgpu_bo_va_mgr {
52 atomic_t refcount;
52 /* the start virtual address */ 53 /* the start virtual address */
53 uint64_t va_offset; 54 uint64_t va_offset;
54 uint64_t va_max; 55 uint64_t va_max;
@@ -70,9 +71,9 @@ struct amdgpu_device {
70 struct util_hash_table *bo_flink_names; 71 struct util_hash_table *bo_flink_names;
71 /** This protects all hash tables. */ 72 /** This protects all hash tables. */
72 pthread_mutex_t bo_table_mutex; 73 pthread_mutex_t bo_table_mutex;
73 struct amdgpu_bo_va_mgr vamgr;
74 struct drm_amdgpu_info_device dev_info; 74 struct drm_amdgpu_info_device dev_info;
75 struct amdgpu_gpu_info info; 75 struct amdgpu_gpu_info info;
76 struct amdgpu_bo_va_mgr *vamgr;
76}; 77};
77 78
78struct amdgpu_bo { 79struct amdgpu_bo {
@@ -142,13 +143,15 @@ void amdgpu_device_free_internal(amdgpu_device_handle dev);
142 143
143void amdgpu_bo_free_internal(amdgpu_bo_handle bo); 144void amdgpu_bo_free_internal(amdgpu_bo_handle bo);
144 145
145void amdgpu_vamgr_init(struct amdgpu_device *dev); 146struct amdgpu_bo_va_mgr* amdgpu_vamgr_get_global(struct amdgpu_device *dev);
147
148void amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst, struct amdgpu_bo_va_mgr *src);
146 149
147uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, 150uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr,
148 uint64_t size, uint64_t alignment); 151 uint64_t size, uint64_t alignment);
149 152
150void amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, 153void amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va,
151 uint64_t size); 154 uint64_t size);
152 155
153int amdgpu_query_gpu_info_init(amdgpu_device_handle dev); 156int amdgpu_query_gpu_info_init(amdgpu_device_handle dev);
154 157