aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König2018-02-26 05:30:36 -0600
committerChristian König2018-02-28 06:27:38 -0600
commitcd8a80493beea4fbdd0a2e0b68ef0adbdaac1133 (patch)
tree14354a05b0ec22fda9e4d40189caa9f5ff9c6dad /amdgpu/amdgpu_device.c
parent1384c0812337515694731a18643faf504402bece (diff)
downloadexternal-libdrm-cd8a80493beea4fbdd0a2e0b68ef0adbdaac1133.tar.gz
external-libdrm-cd8a80493beea4fbdd0a2e0b68ef0adbdaac1133.tar.xz
external-libdrm-cd8a80493beea4fbdd0a2e0b68ef0adbdaac1133.zip
amdgpu: mostly revert "use the high VA range if possible v2"
This reverts commit 07ea20d5beb24315b721adf83bbfa72ce016e146. Unfortunately it turned out that this change broke some corner cases in Mesa. Revert it for now, but keep the high range in separate VA managers. 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.c28
1 files changed, 15 insertions, 13 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;