diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2014-02-04 02:30:18 -0500 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2014-02-07 17:10:10 -0800 |
commit | 31911f8d37fe149626c4810ef264730dab204598 (patch) | |
tree | 0e7f85e7b1ed1f56c184f4ca5767e4d4a5d61859 | |
parent | 142f6cc0b4b1582e6e9183ac13f55c672228bdca (diff) |
nv50: only over-allocate by a page for code
The pre-fetching doesn't go too far. Tested with over-allocating by only
a page, and didn't see any errors in dmesg. Saves ~512KB of VRAM.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
(cherry picked from commit f76c7ad5b14f5646a56ca3518f0c2e739811f223)
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_screen.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index 5bb341d549c..b219a3b971c 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -741,12 +741,13 @@ nv50_screen_create(struct nouveau_device *dev) goto fail; } - /* This over-allocates by a whole code BO. The GP, which would execute at - * the end of the last page, would trigger faults. The going theory is that - * it prefetches up to a certain amount. This avoids dmesg spam. + /* This over-allocates by a page. The GP, which would execute at the end of + * the last page, would trigger faults. The going theory is that it + * prefetches up to a certain amount. */ ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 1 << 16, - 4 << NV50_CODE_BO_SIZE_LOG2, NULL, &screen->code); + (3 << NV50_CODE_BO_SIZE_LOG2) + 0x1000, + NULL, &screen->code); if (ret) { NOUVEAU_ERR("Failed to allocate code bo: %d\n", ret); goto fail; |