Mesa (master): nvc0: enable shader watchdog timer
Christoph Bumiller
chrisbmr at kemper.freedesktop.org
Mon Jan 9 23:44:37 UTC 2012
Module: Mesa
Branch: master
Commit: 601fb4b746ac498e69356fba0c17a1f6ce78df6c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=601fb4b746ac498e69356fba0c17a1f6ce78df6c
Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date: Tue Jan 10 00:38:19 2012 +0100
nvc0: enable shader watchdog timer
Prevent infinite loops in shaders from locking up the GPU.
---
src/gallium/drivers/nvc0/nvc0_3d.xml.h | 2 ++
src/gallium/drivers/nvc0/nvc0_screen.c | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/nvc0/nvc0_3d.xml.h b/src/gallium/drivers/nvc0/nvc0_3d.xml.h
index c32fa3a..8d6ea7e 100644
--- a/src/gallium/drivers/nvc0/nvc0_3d.xml.h
+++ b/src/gallium/drivers/nvc0/nvc0_3d.xml.h
@@ -315,6 +315,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_PATCH_VERTICES 0x00000dcc
+#define NVC0_3D_WATCHDOG_TIMER 0x00000de4
+
#define NVC0_3D_WINDOW_OFFSET_X 0x00000df8
#define NVC0_3D_WINDOW_OFFSET_Y 0x00000dfc
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
index cecca0d..a991e67 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -466,6 +466,12 @@ nvc0_screen_create(struct nouveau_device *dev)
BEGIN_RING(chan, RING_3D(COND_MODE), 1);
OUT_RING (chan, NVC0_3D_COND_MODE_ALWAYS);
+ if (debug_get_bool_option("NOUVEAU_SHADER_WATCHDOG", TRUE)) {
+ /* kill shaders after about 1 second (at 100 MHz) */
+ BEGIN_RING(chan, RING_3D(WATCHDOG_TIMER), 1);
+ OUT_RING (chan, 0x17);
+ }
+
BEGIN_RING(chan, RING_3D(RT_CONTROL), 1);
OUT_RING (chan, 1);
More information about the mesa-commit
mailing list