From f92d7969bf6ba636d193423cf2388956badde3ff Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Sun, 3 Mar 2013 22:34:38 +0100 Subject: nouveau: add a way to override single pushbuffer memory limits Currently single pushbuffer can take up to 80% of VRAM and 80% of GART. As this value seems to be arbitrary (and user may need to set it differently) this patch adds support for 2 environment variables: NOUVEAU_LIBDRM_VRAM_LIMIT_PERCENT (default 80) NOUVEAU_LIBDRM_GART_LIMIT_PERCENT (default 80) which will let users override pushbuffer VRAM/GART limits. Signed-off-by: Marcin Slusarz --- nouveau/pushbuf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nouveau/pushbuf.c') diff --git a/nouveau/pushbuf.c b/nouveau/pushbuf.c index e720a082..0fd0c47a 100644 --- a/nouveau/pushbuf.c +++ b/nouveau/pushbuf.c @@ -347,8 +347,10 @@ pushbuf_submit(struct nouveau_pushbuf *push, struct nouveau_object *chan) &req, sizeof(req)); nvpb->suffix0 = req.suffix0; nvpb->suffix1 = req.suffix1; - dev->vram_limit = (req.vram_available * 80) / 100; - dev->gart_limit = (req.gart_available * 80) / 100; + dev->vram_limit = (req.vram_available * + nouveau_device(dev)->vram_limit_percent) / 100; + dev->gart_limit = (req.gart_available * + nouveau_device(dev)->gart_limit_percent) / 100; #else if (dbg_on(31)) ret = -EINVAL; -- cgit v1.2.3