summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/radeon/drm
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/gallium/winsys/radeon/drm
parent203ef19f48b6d983dfba383b6a8fcebfe0a02aee (diff)
radeonsi: adjust and simplify max_alloc_size determination
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/gallium/winsys/radeon/drm')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_winsys.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index 3560c34c17a..cf07a8d8e26 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -362,11 +362,13 @@ static bool do_winsys_init(struct radeon_drm_winsys *ws)
if (ws->info.drm_minor < 49)
ws->info.vram_vis_size = MIN2(ws->info.vram_vis_size, 256*1024*1024);
- /* Radeon allocates all buffers as contigous, which makes large allocations
+ /* Radeon allocates all buffers contiguously, which makes large allocations
* unlikely to succeed. */
- ws->info.max_alloc_size = MAX2(ws->info.vram_size, ws->info.gart_size) * 0.7;
if (ws->info.has_dedicated_vram)
- ws->info.max_alloc_size = MIN2(ws->info.vram_size * 0.7, ws->info.max_alloc_size);
+ ws->info.max_alloc_size = ws->info.vram_size * 0.7;
+ else
+ ws->info.max_alloc_size = ws->info.gart_size * 0.7;
+
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. */