summaryrefslogtreecommitdiffstats
path: root/src/amd/common/ac_gpu_info.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-08-28 19:13:18 -0400
committerMarek Olšák <[email protected]>2018-09-10 15:19:56 -0400
commitb00deed66f6f3c6bf820d39d5c42f873ca081526 (patch)
tree4d79235d59e2192c89302ee84def047ebdf3eb3c /src/amd/common/ac_gpu_info.c
parent203ef19f48b6d983dfba383b6a8fcebfe0a02aee (diff)
radeonsi: adjust and simplify max_alloc_size determination
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/amd/common/ac_gpu_info.c')
-rw-r--r--src/amd/common/ac_gpu_info.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
index bfaff45219f..766ad835476 100644
--- a/src/amd/common/ac_gpu_info.c
+++ b/src/amd/common/ac_gpu_info.c
@@ -255,9 +255,6 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
info->gart_size = meminfo.gtt.total_heap_size;
info->vram_size = meminfo.vram.total_heap_size;
info->vram_vis_size = meminfo.cpu_accessible_vram.total_heap_size;
-
- info->max_alloc_size = MAX2(meminfo.vram.max_allocation,
- meminfo.gtt.max_allocation);
} else {
/* This is a deprecated interface, which reports usable sizes
* (total minus pinned), but the pinned size computation is
@@ -289,11 +286,6 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
info->gart_size = gtt.heap_size;
info->vram_size = vram.heap_size;
info->vram_vis_size = vram_vis.heap_size;
-
- /* The kernel can split large buffers in VRAM but not in GTT, so large
- * allocations can fail or cause buffer movement failures in the kernel.
- */
- info->max_alloc_size = MAX2(info->vram_size * 0.9, info->gart_size * 0.7);
}
/* Set chip identification. */
@@ -331,6 +323,14 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
info->has_dedicated_vram =
!(amdinfo->ids_flags & AMDGPU_IDS_FLAGS_FUSION);
+ /* The kernel can split large buffers in VRAM but not in GTT, so large
+ * allocations can fail or cause buffer movement failures in the kernel.
+ */
+ if (info->has_dedicated_vram)
+ info->max_alloc_size = info->vram_size * 0.8;
+ else
+ info->max_alloc_size = info->gart_size * 0.7;
+
/* Set hardware information. */
info->gds_size = gds.gds_total_size;
info->gds_gfx_partition_size = gds.gds_gfx_partition_size;