summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2007-08-22 13:17:19 +1000
committerBen Skeggs <skeggsb@gmail.com>2007-08-22 13:19:21 +1000
commita654c0341a7892307522ed6e7f4518cc7e28a99e (patch)
treec8bbcf1d1bdbb9a7363f4e61c3b71c72a80f5519 /shared-core
parent81eaff44c47cfb23e96b1cb848df5fd7ea24f913 (diff)
nouveau/nv40: Dump extra info on ucode state if ctx switch fails.
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/nouveau_reg.h4
-rw-r--r--shared-core/nv40_graph.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/shared-core/nouveau_reg.h b/shared-core/nouveau_reg.h
index 65614627..1023e75e 100644
--- a/shared-core/nouveau_reg.h
+++ b/shared-core/nouveau_reg.h
@@ -178,6 +178,10 @@
#define NV10_PGRAPH_CTX_CACHE5 0x004001E0
#define NV40_PGRAPH_CTXCTL_0304 0x00400304
#define NV40_PGRAPH_CTXCTL_0304_XFER_CTX 0x00000001
+#define NV40_PGRAPH_CTXCTL_UCODE_STAT 0x00400308
+#define NV40_PGRAPH_CTXCTL_UCODE_STAT_IP_MASK 0xff000000
+#define NV40_PGRAPH_CTXCTL_UCODE_STAT_IP_SHIFT 24
+#define NV40_PGRAPH_CTXCTL_UCODE_STAT_OP_MASK 0x00ffffff
#define NV40_PGRAPH_CTXCTL_0310 0x00400310
#define NV40_PGRAPH_CTXCTL_0310_XFER_SAVE 0x00000020
#define NV40_PGRAPH_CTXCTL_0310_XFER_LOAD 0x00000040
diff --git a/shared-core/nv40_graph.c b/shared-core/nv40_graph.c
index 8882e62b..25ee5c77 100644
--- a/shared-core/nv40_graph.c
+++ b/shared-core/nv40_graph.c
@@ -1310,7 +1310,11 @@ nv40_graph_transfer_context(struct drm_device *dev, uint32_t inst, int save)
NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, old_cp);
if (i == tv) {
- DRM_ERROR("failed: inst=0x%08x save=%d\n", inst, save);
+ uint32_t ucstat = NV_READ(NV40_PGRAPH_CTXCTL_UCODE_STAT);
+ DRM_ERROR("Failed: Instance=0x%08x Save=%d\n", inst, save);
+ DRM_ERROR("IP: 0x%02x, Opcode: 0x%08x\n",
+ ucstat >> NV40_PGRAPH_CTXCTL_UCODE_STAT_IP_SHIFT,
+ ucstat & NV40_PGRAPH_CTXCTL_UCODE_STAT_OP_MASK);
DRM_ERROR("0x40030C = 0x%08x\n",
NV_READ(NV40_PGRAPH_CTXCTL_030C));
return -EBUSY;