aboutsummaryrefslogtreecommitdiffstats
path: root/amdgpu
diff options
context:
space:
mode:
authorChristian König2018-02-28 08:39:46 -0600
committerChristian König2018-02-28 13:04:32 -0600
commitbca585b02f09e27d7adef8375630515711bd4802 (patch)
treec8b670e9a394240b6bfb0a2faf1bb2ed77a72219 /amdgpu
parentff0da7b32369a08c8a2f69cd4dcd046ad7a15bec (diff)
downloadexternal-libdrm-bca585b02f09e27d7adef8375630515711bd4802.tar.gz
external-libdrm-bca585b02f09e27d7adef8375630515711bd4802.tar.xz
external-libdrm-bca585b02f09e27d7adef8375630515711bd4802.zip
amdgpu: fix "add AMDGPU_VA_RANGE_HIGH"
The range is stored as exclusive, not inclusive. Subtracts one to get the inclusive interval for the calculation. This fixes crashes when 32bit addresses are in use. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r--amdgpu/amdgpu_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index 9ff6ad16..fb2cfb57 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -323,9 +323,9 @@ int amdgpu_query_sw_info(amdgpu_device_handle dev, enum amdgpu_sw_info info,
323 switch (info) { 323 switch (info) {
324 case amdgpu_sw_info_address32_hi: 324 case amdgpu_sw_info_address32_hi:
325 if (dev->vamgr_high_32.va_max) 325 if (dev->vamgr_high_32.va_max)
326 *val32 = dev->vamgr_high_32.va_max >> 32; 326 *val32 = (dev->vamgr_high_32.va_max - 1) >> 32;
327 else 327 else
328 *val32 = dev->vamgr_32.va_max >> 32; 328 *val32 = (dev->vamgr_32.va_max - 1) >> 32;
329 return 0; 329 return 0;
330 } 330 }
331 return -EINVAL; 331 return -EINVAL;