aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák2018-02-02 11:15:00 -0600
committerMarek Olšák2018-02-09 13:30:16 -0600
commitad5b702fec3f9cb54feeb403e7b31c10ebc0ca7c (patch)
treeacc913e75267852b1e6030093146ce84700e96a9 /amdgpu/amdgpu_device.c
parentdeb59781fcc1183e19cca67e2db35c2e21f40ed5 (diff)
downloadexternal-libdrm-ad5b702fec3f9cb54feeb403e7b31c10ebc0ca7c.tar.gz
external-libdrm-ad5b702fec3f9cb54feeb403e7b31c10ebc0ca7c.tar.xz
external-libdrm-ad5b702fec3f9cb54feeb403e7b31c10ebc0ca7c.zip
amdgpu: add amdgpu_query_sw_info for querying high bits of 32-bit address space
Reviewed-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_device.c')
-rw-r--r--amdgpu/amdgpu_device.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index f34e27a9..6ee25a9e 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -275,6 +275,7 @@ int amdgpu_device_initialize(int fd,
275 max = MIN2(max, (start & ~0xffffffffULL) + 0x100000000ULL); 275 max = MIN2(max, (start & ~0xffffffffULL) + 0x100000000ULL);
276 amdgpu_vamgr_init(&dev->vamgr_32, start, max, 276 amdgpu_vamgr_init(&dev->vamgr_32, start, max,
277 dev->dev_info.virtual_address_alignment); 277 dev->dev_info.virtual_address_alignment);
278 dev->address32_hi = start >> 32;
278 279
279 start = max; 280 start = max;
280 if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max) 281 if (dev->dev_info.high_va_offset && dev->dev_info.high_va_max)
@@ -312,3 +313,16 @@ const char *amdgpu_get_marketing_name(amdgpu_device_handle dev)
312{ 313{
313 return dev->marketing_name; 314 return dev->marketing_name;
314} 315}
316
317int amdgpu_query_sw_info(amdgpu_device_handle dev, enum amdgpu_sw_info info,
318 void *value)
319{
320 uint32_t *val32 = (uint32_t*)value;
321
322 switch (info) {
323 case amdgpu_sw_info_address32_hi:
324 *val32 = dev->address32_hi;
325 return 0;
326 }
327 return -EINVAL;
328}