aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--amdgpu/amdgpu_device.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index d7077184..a0d01727 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -264,13 +264,23 @@ int amdgpu_device_initialize(int fd,
264 goto cleanup; 264 goto cleanup;
265 } 265 }
266 266
267 start = dev->dev_info.virtual_address_offset; 267 if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) {
268 max = MIN2(dev->dev_info.virtual_address_max, 0x100000000ULL); 268 start = dev->dev_info.high_va_offset;
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 & ~0xffffffff) + 0x100000000ULL);
269 amdgpu_vamgr_init(&dev->vamgr_32, start, max, 276 amdgpu_vamgr_init(&dev->vamgr_32, start, max,
270 dev->dev_info.virtual_address_alignment); 277 dev->dev_info.virtual_address_alignment);
271 278
272 start = MAX2(dev->dev_info.virtual_address_offset, 0x100000000ULL); 279 start = max;
273 max = MAX2(dev->dev_info.virtual_address_max, 0x100000000ULL); 280 if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max)
281 max = dev->dev_info.high_va_max;
282 else
283 max = dev->dev_info.virtual_address_max;
274 amdgpu_vamgr_init(&dev->vamgr, start, max, 284 amdgpu_vamgr_init(&dev->vamgr, start, max,
275 dev->dev_info.virtual_address_alignment); 285 dev->dev_info.virtual_address_alignment);
276 286