From 95ff7cbe4e0f6e1f4a59e8666b7d729341216b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= Date: Sun, 9 Sep 2012 19:37:07 +0200 Subject: [PATCH] exa: set max dimensions based on available VRAM It ensures that we always have enough space in VRAM to process images. Fix memory flush on 64 MB cards, and add back exa support for cards that have 32 MB or less memory (with a minimal 8 MB VRAM). Resolves https://bugs.freedesktop.org/show_bug.cgi?id=39010 --- src/nouveau_exa.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c index 13d7e1f..b192633 100644 --- a/src/nouveau_exa.c +++ b/src/nouveau_exa.c @@ -125,7 +125,7 @@ nouveau_exa_create_pixmap(ScreenPtr pScreen, int width, int height, int depth, if (!width || !height) return calloc(1, sizeof(*nvpix)); - if (!pNv->exa_force_cp && pNv->dev->vram_size <= 32 * 1024 * 1024) + if (!pNv->exa_force_cp && pNv->dev->vram_size < 8*1020*1020) return NULL; nvpix = calloc(1, sizeof(*nvpix)); @@ -427,16 +427,20 @@ nouveau_exa_init(ScreenPtr pScreen) exa->SetSharedPixmapBacking = nouveau_exa_set_shared_pixmap_backing; #endif - if (pNv->Architecture >= NV_ARCH_50) { - exa->maxX = 8192; - exa->maxY = 8192; + if (pNv->dev->vram_size >= 512*1020*1020) { + exa->maxX = 8190; + exa->maxY = 8190; } else - if (pNv->Architecture >= NV_ARCH_10) { - exa->maxX = 4096; - exa->maxY = 4096; + if (pNv->dev->vram_size >= 128*1020*1020) { + exa->maxX = 4094; + exa->maxY = 4094; + } else + if (pNv->dev->vram_size >= 32*1020*1020) { + exa->maxX = 2046; + exa->maxY = 2046; } else { - exa->maxX = 2048; - exa->maxY = 2048; + exa->maxX = 1022; + exa->maxY = 1022; } exa->MarkSync = nouveau_exa_mark_sync; -- 1.7.12