drm/nve0/fifo: single printk for sched error data
authorBen Skeggs <bskeggs@redhat.com>
Sun, 23 Feb 2014 13:20:46 +0000 (23:20 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 26 Mar 2014 04:00:51 +0000 (14:00 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c

index 9c8ff65e14a5c07bab4237d6960b855fe9719498..186523cd6e6c5099524b9067311a6cdeb6f96a52 100644 (file)
@@ -404,7 +404,8 @@ out:
        return ret;
 }
 
-static const struct nouveau_enum nve0_fifo_sched_reason[] = {
+static const struct nouveau_enum
+nve0_fifo_sched_reason[] = {
        { 0x0a, "CTXSW_TIMEOUT" },
        {}
 };
@@ -414,9 +415,14 @@ nve0_fifo_intr_sched(struct nve0_fifo_priv *priv)
 {
        u32 intr = nv_rd32(priv, 0x00254c);
        u32 code = intr & 0x000000ff;
-       nv_error(priv, "SCHED_ERROR [");
-       nouveau_enum_print(nve0_fifo_sched_reason, code);
-       pr_cont("]\n");
+       const struct nouveau_enum *en;
+       char enunk[6] = "";
+
+       en = nouveau_enum_find(nve0_fifo_sched_reason, code);
+       if (!en)
+               snprintf(enunk, sizeof(enunk), "UNK%02x", code);
+
+       nv_error(priv, "SCHED_ERROR [ %s ]\n", en ? en->name : enunk);
 }
 
 static void