winsys/radeon: Allow visible VRAM size > 256MB with kernel driver >= 2.49
authorMichel Dänzer <michel.daenzer@amd.com>
Tue, 31 Jan 2017 06:33:19 +0000 (15:33 +0900)
committerMichel Dänzer <michel@daenzer.net>
Wed, 1 Feb 2017 07:38:14 +0000 (16:38 +0900)
The kernel driver reports correct values now.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

index a8da62fd361d7d15f6f5548d727c562b38d572e2..cacd683879b76b587e50a0dba42369ec4a85f88b 100644 (file)
@@ -372,7 +372,12 @@ 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 = MIN2(gem_info.vram_visible, 256*1024*1024);
+    ws->info.vram_vis_size = gem_info.vram_visible;
+    /* Older versions of the kernel driver reported incorrect values, and
+     * didn't support more than 256MB of visible VRAM anyway
+     */
+    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
      * unlikely to succeed. */