summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2022-06-05 17:32:27 -0400
committerMarge Bot <emma+marge@anholt.net>2022-06-08 10:23:20 +0000
commitaee8ee17a5056bb8e1f3144d34b52612ac7d3b25 (patch)
treec2c3a33cf80e25d4473fa341649653db6314f32d /src/gallium/winsys
parentc1adb33a93e2ac576278804c4dc78455d734ea51 (diff)
radeonsi: change max TBO/SSBO sizes again and rework max alloc size
Allow 1/4 of the max heap size, but maximum of 512 MB on 32-bit architectures. Reviewed-by: Mihai Preda <mhpreda@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16901>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_winsys.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index b40f9bed945..8217632e7a6 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -375,14 +375,20 @@ static bool do_winsys_init(struct radeon_drm_winsys *ws)
/* Radeon allocates all buffers contiguously, which makes large allocations
* unlikely to succeed. */
if (ws->info.has_dedicated_vram)
- ws->info.max_alloc_size = ws->info.vram_size * 0.7;
+ ws->info.max_heap_size_kb = ws->info.vram_size_kb;
else
- ws->info.max_alloc_size = ws->info.gart_size * 0.7;
+ ws->info.max_heap_size_kb = ws->info.gart_size_kb;
+ /* Old kernel driver limitation for allocation sizes. We only use this to limit per-buffer
+ * allocation size.
+ */
if (ws->info.drm_minor < 40)
- ws->info.max_alloc_size = MIN2(ws->info.max_alloc_size, 256*1024*1024);
- /* Both 32-bit and 64-bit address spaces only have 4GB. */
- ws->info.max_alloc_size = MIN2(ws->info.max_alloc_size, 3ull*1024*1024*1024);
+ ws->info.max_heap_size_kb = MIN2(ws->info.max_heap_size_kb, 256 * 1024);
+
+ /* Both 32-bit and 64-bit address spaces only have 4GB.
+ * This is a limitation of the VM allocator in the winsys.
+ */
+ ws->info.max_heap_size_kb = MIN2(ws->info.max_heap_size_kb, 4 * 1024 * 1024); /* 4 GB */
/* Get max clock frequency info and convert it to MHz */
radeon_get_drm_value(ws->fd, RADEON_INFO_MAX_SCLK, NULL,