Skip to contentSkip to conversation

drm/nouveau: enlarge GART aperture (v2)

PATCH New Luca Barbieri 1 participant 1 message Feb 9, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: enlarge GART aperture (v2)

Changes in v2:
- Compute size based on ramin_rsvd_size

This patch enlarges the PCI GART aperture to 512 MB, or the space covered by a DMA object filling half RAMIN.

The current 64MB aperture is too small and should be enlarged. The optimal amound may be card/system-dependent, so a more sophisticated approach may be preferable.

Could anyone with an nv04 test whether this doesn't break there?

---
 drivers/gpu/drm/nouveau/nouveau_sgdma.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_sgdma.c +12 -2
index 4c7f1e4..5a52006 100644
@@ -227,11 +227,21 @@ nouveau_sgdma_init(struct drm_device *dev)
 	int i, ret;
 
 	if (dev_priv->card_type < NV_50) {
-		aper_size = (64 * 1024 * 1024);
+		/* TODO: can we safely raise this to 1GB, 2GB or 4GB? */
+		unsigned limit = 512 * 1024;
+
+		/* use up half ramin for the GART ctxdma object */
+		aper_size = dev_priv->ramin_rsvd_vram >> 1;
+		if(aper_size > limit)
+			aper_size = limit;
+		aper_size <<= 10; /* each 4KB page needs a 4 byte entry */
+
 		obj_size  = (aper_size >> NV_CTXDMA_PAGE_SHIFT) * 4;
 		obj_size += 8; /* ctxdma header */
 	} else {
-		/* 1 entire VM page table */
+		/* 1 entire VM page table
+		 * TODO: can we raise this so that it can potentially cover all system memory?
+		 */
 		aper_size = (512 * 1024 * 1024);
 		obj_size  = (aper_size >> NV_CTXDMA_PAGE_SHIFT) * 8;
 	}
Signature · 1 line
1.6.6.1.476.g01ddb