drm/nouveau: Make PCIE GART size depend on the available RAMIN space.
authorFrancisco Jerez <currojerez@riseup.net>
Mon, 1 Nov 2010 17:08:26 +0000 (18:08 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 18 Nov 2010 04:38:57 +0000 (14:38 +1000)
Reported-by: Tomas Miljenovic <tomasmiljenovic@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_sgdma.c

index 0b309c1cc3d79c95a86d7b2acb0ca29f93cd36b9..d4ac970070386cea340283ba459194eb8b1de50a 100644 (file)
@@ -224,11 +224,11 @@ nouveau_sgdma_init(struct drm_device *dev)
        int i, ret;
 
        if (dev_priv->card_type < NV_50) {
-               if(dev_priv->card_type < NV_40) {
-                       aper_size = (64 * 1024 * 1024);
-               } else {
-                       aper_size = (512 * 1024 * 1024);
-               }
+               if(dev_priv->ramin_rsvd_vram < 2 * 1024 * 1024)
+                       aper_size = 64 * 1024 * 1024;
+               else
+                       aper_size = 512 * 1024 * 1024;
+
                obj_size  = (aper_size >> NV_CTXDMA_PAGE_SHIFT) * 4;
                obj_size += 8; /* ctxdma header */
        } else {