aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König2017-11-07 08:31:45 -0600
committerChristian König2018-01-09 10:15:09 -0600
commit07ea20d5beb24315b721adf83bbfa72ce016e146 (patch)
tree32859072439f3ccad03f4daa1005004f542a4b11 /amdgpu/amdgpu_device.c
parent0a3c01f4ad6a09450e59008085c7bf8151aeb5c4 (diff)
downloadexternal-libdrm-07ea20d5beb24315b721adf83bbfa72ce016e146.tar.gz
external-libdrm-07ea20d5beb24315b721adf83bbfa72ce016e146.tar.xz
external-libdrm-07ea20d5beb24315b721adf83bbfa72ce016e146.zip
amdgpu: use the high VA range if possible v2
Retire the low range on Vega10 this frees up everything below 0xffff800000000000 for HMM. v2: keep the 32bit range working. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_device.c')
-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