aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--amdgpu/amdgpu_device.c28
-rw-r--r--amdgpu/amdgpu_internal.h6
2 files changed, 20 insertions, 14 deletions
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index 6ee25a9e..ca0c7987 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -264,27 +264,29 @@ int amdgpu_device_initialize(int fd,
264 goto cleanup; 264 goto cleanup;
265 } 265 }
266 266
267 if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) { 267 start = dev->dev_info.virtual_address_offset;
268 start = dev->dev_info.high_va_offset; 268 max = MIN2(dev->dev_info.virtual_address_max, 0x100000000ULL);
269 max = dev->dev_info.high_va_max;
270 } else {
271 start = dev->dev_info.virtual_address_offset;
272 max = dev->dev_info.virtual_address_max;
273 }
274
275 max = MIN2(max, (start & ~0xffffffffULL) + 0x100000000ULL);
276 amdgpu_vamgr_init(&dev->vamgr_32, start, max, 269 amdgpu_vamgr_init(&dev->vamgr_32, start, max,
277 dev->dev_info.virtual_address_alignment); 270 dev->dev_info.virtual_address_alignment);
278 dev->address32_hi = start >> 32; 271 dev->address32_hi = start >> 32;
279 272
280 start = max; 273 start = max;
281 if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) 274 max = MAX2(dev->dev_info.virtual_address_max, 0x100000000ULL);
282 max = dev->dev_info.high_va_max;
283 else
284 max = dev->dev_info.virtual_address_max;
285 amdgpu_vamgr_init(&dev->vamgr, start, max, 275 amdgpu_vamgr_init(&dev->vamgr, start, max,
286 dev->dev_info.virtual_address_alignment); 276 dev->dev_info.virtual_address_alignment);
287 277
278 start = dev->dev_info.high_va_offset;
279 max = MIN2(dev->dev_info.high_va_max, (start & ~0xffffffffULL) +
280 0x100000000ULL);
281 amdgpu_vamgr_init(&dev->vamgr_high_32, start, max,
282 dev->dev_info.virtual_address_alignment);
283
284 start = max;
285 max = MAX2(dev->dev_info.high_va_max, (start & ~0xffffffffULL) +
286 0x100000000ULL);
287 amdgpu_vamgr_init(&dev->vamgr_high, start, max,
288 dev->dev_info.virtual_address_alignment);
289
288 amdgpu_parse_asic_ids(dev); 290 amdgpu_parse_asic_ids(dev);
289 291
290 *major_version = dev->major_version; 292 *major_version = dev->major_version;
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index dd0c3a61..423880ed 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -84,10 +84,14 @@ struct amdgpu_device {
84 pthread_mutex_t bo_table_mutex; 84 pthread_mutex_t bo_table_mutex;
85 struct drm_amdgpu_info_device dev_info; 85 struct drm_amdgpu_info_device dev_info;
86 struct amdgpu_gpu_info info; 86 struct amdgpu_gpu_info info;
87 /** The global VA manager for the whole virtual address space */ 87 /** The VA manager for the lower virtual address space */
88 struct amdgpu_bo_va_mgr vamgr; 88 struct amdgpu_bo_va_mgr vamgr;
89 /** The VA manager for the 32bit address space */ 89 /** The VA manager for the 32bit address space */
90 struct amdgpu_bo_va_mgr vamgr_32; 90 struct amdgpu_bo_va_mgr vamgr_32;
91 /** The VA manager for the high virtual address space */
92 struct amdgpu_bo_va_mgr vamgr_high;
93 /** The VA manager for the 32bit high address space */
94 struct amdgpu_bo_va_mgr vamgr_high_32;
91}; 95};
92 96
93struct amdgpu_bo { 97struct amdgpu_bo {