winsys/radeon: clamp vram_vis_size to 256MB
authorMarek Olšák <marek.olsak@amd.com>
Fri, 27 Jan 2017 11:11:33 +0000 (12:11 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 30 Jan 2017 16:45:29 +0000 (17:45 +0100)
the value from the kernel is wrong

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

index 278d4f317e83db43706a22b56d9e26f4d6f3e0c4..a8da62fd361d7d15f6f5548d727c562b38d572e2 100644 (file)
@@ -372,7 +372,7 @@ 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.vram_vis_size = gem_info.vram_visible;
+    ws->info.vram_vis_size = MIN2(gem_info.vram_visible, 256*1024*1024);
 
     /* Radeon allocates all buffers as contigous, which makes large allocations
      * unlikely to succeed. */