[Nouveau] [PATCH] drm/nouveau: enlarge GART aperture (v2)
Luca Barbieri
luca at luca-barbieri.com
Mon Feb 8 21:59:36 PST 2010
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?
Signed-off-by: Luca Barbieri <luca at luca-barbieri.com>
---
drivers/gpu/drm/nouveau/nouveau_sgdma.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
index 4c7f1e4..5a52006 100644
--- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
@@ -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;
}
--
1.6.6.1.476.g01ddb
More information about the Nouveau
mailing list