drm/nv50/gr: print mpc trap name when it's not an mp trap
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 17 Jan 2014 05:13:05 +0000 (00:13 -0500)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 23 Jan 2014 03:39:17 +0000 (13:39 +1000)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
drivers/gpu/drm/nouveau/core/engine/graph/nv50.c

index 0f8d18ae6802c2211bac82ae8b1c1b7b98081fa5..30ed19c52e05ca0cd6a1e759a8fc426f61f246a7 100644 (file)
@@ -315,6 +315,20 @@ static const struct nouveau_bitfield nv50_mp_exec_errors[] = {
        {}
 };
 
+static const struct nouveau_bitfield nv50_mpc_traps[] = {
+       { 0x0000001, "LOCAL_LIMIT_READ" },
+       { 0x0000010, "LOCAL_LIMIT_WRITE" },
+       { 0x0000040, "STACK_LIMIT" },
+       { 0x0000100, "GLOBAL_LIMIT_READ" },
+       { 0x0001000, "GLOBAL_LIMIT_WRITE" },
+       { 0x0010000, "MP0" },
+       { 0x0020000, "MP1" },
+       { 0x0040000, "GLOBAL_LIMIT_RED" },
+       { 0x0400000, "GLOBAL_LIMIT_ATOM" },
+       { 0x4000000, "MP2" },
+       {}
+};
+
 static const struct nouveau_bitfield nv50_graph_trap_m2mf[] = {
        { 0x00000001, "NOTIFY" },
        { 0x00000002, "IN" },
@@ -524,6 +538,12 @@ nv50_priv_tp_trap(struct nv50_graph_priv *priv, int type, u32 ustatus_old,
                                nv50_priv_mp_trap(priv, i, display);
                                ustatus &= ~0x04030000;
                        }
+                       if (ustatus && display) {
+                               nv_error("%s - TP%d:", name, i);
+                               nouveau_bitfield_print(nv50_mpc_traps, ustatus);
+                               pr_cont("\n");
+                               ustatus = 0;
+                       }
                        break;
                case 8: /* PROP error */
                        if (display)