Mesa (master): nvc0: work around what looks like a code prefetch bug

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Sat Apr 16 15:18:28 PDT 2011


Module: Mesa
Branch: master
Commit: 25a7f662145f56ad15dbdf3da203a8a85594276f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=25a7f662145f56ad15dbdf3da203a8a85594276f

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Sat Apr 16 15:24:07 2011 +0200

nvc0: work around what looks like a code prefetch bug

Sounds very unlikely, but I don't have a better explanation at the
moment.
The GPU throws page faults at the first page after the code buffer
quite frequently on startup, and traces don't show us overflowing.

---

 src/gallium/drivers/nvc0/nvc0_screen.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
index c4cdfac..de62fd6 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -447,7 +447,10 @@ nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
    if (ret)
       goto fail;
 
-   nouveau_resource_init(&screen->text_heap, 0, 1 << 20);
+   /* XXX: getting a page fault at the end of the code buffer every few
+    *  launches, don't use the last 256 bytes to work around them - prefetch ?
+    */
+   nouveau_resource_init(&screen->text_heap, 0, (1 << 20) - 0x100);
 
    ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 1 << 12, 6 << 16,
                         &screen->uniforms);



More information about the mesa-commit mailing list