From 8a4ace4a47a07323997da5c2dbc865a32df52451 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 1 Jul 2016 00:17:36 +0200 Subject: gallium/radeon: add and use radeon_info::max_alloc_size (v2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2: - squashed the patches - use INT_MAX - clamp max_const_buffer_size - check the DRM version in radeon Reviewed-by: Nicolai Hähnle Reviewed-by: Vedran Miletić --- src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/winsys/radeon') diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c index c4d28ffe4e4..1b32c377452 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c @@ -373,6 +373,10 @@ static bool do_winsys_init(struct radeon_drm_winsys *ws) ws->info.gart_size = gem_info.gart_size; ws->info.vram_size = gem_info.vram_size; + ws->info.max_alloc_size = MAX2(ws->info.vram_size, ws->info.gart_size); + if (ws->info.drm_minor < 40) + ws->info.max_alloc_size = MIN2(ws->info.max_alloc_size, 256*1024*1024); + /* Get max clock frequency info and convert it to MHz */ radeon_get_drm_value(ws->fd, RADEON_INFO_MAX_SCLK, NULL, &ws->info.max_shader_clock); -- cgit v1.2.3