diff options
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/graph/nve0.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c index b0a5a8847a89..8cb12c74d6e5 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nve0.c | |||
| @@ -121,13 +121,13 @@ static const struct nouveau_enum nve0_sked_error[] = { | |||
| 121 | }; | 121 | }; |
| 122 | 122 | ||
| 123 | static void | 123 | static void |
| 124 | nve0_graph_mp_trap(struct nvc0_graph_priv *priv, int gpc, int tp) | 124 | nve0_graph_mp_trap(struct nvc0_graph_priv *priv, int gpc, int tpc) |
| 125 | { | 125 | { |
| 126 | u32 werr = nv_rd32(priv, TPC_UNIT(gpc, tpc, 0x648)); | ||
| 127 | u32 gerr = nv_rd32(priv, TPC_UNIT(gpc, tpc, 0x650)); | ||
| 126 | int i; | 128 | int i; |
| 127 | u32 werr = nv_rd32(priv, TPC_UNIT(gpc, tp, 0x648)); | ||
| 128 | u32 gerr = nv_rd32(priv, TPC_UNIT(gpc, tp, 0x650)); | ||
| 129 | 129 | ||
| 130 | nv_error(priv, "GPC%i/TP%i/MP trap:", gpc, tp); | 130 | nv_error(priv, "GPC%i/TPC%i/MP trap:", gpc, tpc); |
| 131 | 131 | ||
| 132 | for (i = 0; i <= 31; ++i) { | 132 | for (i = 0; i <= 31; ++i) { |
| 133 | if (!(gerr & (1 << i))) | 133 | if (!(gerr & (1 << i))) |
| @@ -135,6 +135,7 @@ nve0_graph_mp_trap(struct nvc0_graph_priv *priv, int gpc, int tp) | |||
| 135 | pr_cont(" "); | 135 | pr_cont(" "); |
| 136 | nouveau_enum_print(nve0_mp_global_error, i); | 136 | nouveau_enum_print(nve0_mp_global_error, i); |
| 137 | } | 137 | } |
| 138 | |||
| 138 | if (werr) { | 139 | if (werr) { |
| 139 | pr_cont(" "); | 140 | pr_cont(" "); |
| 140 | nouveau_enum_print(nve0_mp_warp_error, werr & 0xffff); | 141 | nouveau_enum_print(nve0_mp_warp_error, werr & 0xffff); |
| @@ -142,51 +143,51 @@ nve0_graph_mp_trap(struct nvc0_graph_priv *priv, int gpc, int tp) | |||
| 142 | pr_cont("\n"); | 143 | pr_cont("\n"); |
| 143 | 144 | ||
| 144 | /* disable MP trap to avoid spam */ | 145 | /* disable MP trap to avoid spam */ |
| 145 | nv_mask(priv, TPC_UNIT(gpc, tp, 0x50c), 0x2, 0x0); | 146 | nv_mask(priv, TPC_UNIT(gpc, tpc, 0x50c), 0x2, 0x0); |
| 146 | 147 | ||
| 147 | /* TODO: figure out how to resume after an MP trap */ | 148 | /* TODO: figure out how to resume after an MP trap */ |
| 148 | } | 149 | } |
| 149 | 150 | ||
| 150 | static void | 151 | static void |
| 151 | nve0_graph_tp_trap(struct nvc0_graph_priv *priv, int gpc, int tp) | 152 | nve0_graph_tpc_trap(struct nvc0_graph_priv *priv, int gpc, int tpc) |
| 152 | { | 153 | { |
| 153 | u32 stat = nv_rd32(priv, TPC_UNIT(gpc, tp, 0x508)); | 154 | u32 stat = nv_rd32(priv, TPC_UNIT(gpc, tpc, 0x508)); |
| 154 | 155 | ||
| 155 | if (stat & 0x1) { | 156 | if (stat & 0x1) { |
| 156 | u32 trap = nv_rd32(priv, TPC_UNIT(gpc, tp, 0x224)); | 157 | u32 trap = nv_rd32(priv, TPC_UNIT(gpc, tpc, 0x224)); |
| 157 | nv_error(priv, "GPC%i/TP%i/TEX trap: %08x\n", | 158 | nv_error(priv, "GPC%i/TPC%i/TEX trap: %08x\n", |
| 158 | gpc, tp, trap); | 159 | gpc, tpc, trap); |
| 159 | 160 | ||
| 160 | nv_wr32(priv, TPC_UNIT(gpc, tp, 0x224), 0xc0000000); | 161 | nv_wr32(priv, TPC_UNIT(gpc, tpc, 0x224), 0xc0000000); |
| 161 | stat &= ~0x1; | 162 | stat &= ~0x1; |
| 162 | } | 163 | } |
| 163 | 164 | ||
| 164 | if (stat & 0x2) { | 165 | if (stat & 0x2) { |
| 165 | nve0_graph_mp_trap(priv, gpc, tp); | 166 | nve0_graph_mp_trap(priv, gpc, tpc); |
| 166 | stat &= ~0x2; | 167 | stat &= ~0x2; |
| 167 | } | 168 | } |
| 168 | 169 | ||
| 169 | if (stat & 0x4) { | 170 | if (stat & 0x4) { |
| 170 | u32 trap = nv_rd32(priv, TPC_UNIT(gpc, tp, 0x084)); | 171 | u32 trap = nv_rd32(priv, TPC_UNIT(gpc, tpc, 0x084)); |
| 171 | nv_error(priv, "GPC%i/TP%i/POLY trap: %08x\n", | 172 | nv_error(priv, "GPC%i/TPC%i/POLY trap: %08x\n", |
| 172 | gpc, tp, trap); | 173 | gpc, tpc, trap); |
| 173 | 174 | ||
| 174 | nv_wr32(priv, TPC_UNIT(gpc, tp, 0x084), 0xc0000000); | 175 | nv_wr32(priv, TPC_UNIT(gpc, tpc, 0x084), 0xc0000000); |
| 175 | stat &= ~0x4; | 176 | stat &= ~0x4; |
| 176 | } | 177 | } |
| 177 | 178 | ||
| 178 | if (stat & 0x8) { | 179 | if (stat & 0x8) { |
| 179 | u32 trap = nv_rd32(priv, TPC_UNIT(gpc, tp, 0x48c)); | 180 | u32 trap = nv_rd32(priv, TPC_UNIT(gpc, tpc, 0x48c)); |
| 180 | nv_error(priv, "GPC%i/TP%i/L1C trap: %08x\n", | 181 | nv_error(priv, "GPC%i/TPC%i/L1C trap: %08x\n", |
| 181 | gpc, tp, trap); | 182 | gpc, tpc, trap); |
| 182 | 183 | ||
| 183 | nv_wr32(priv, TPC_UNIT(gpc, tp, 0x48c), 0xc0000000); | 184 | nv_wr32(priv, TPC_UNIT(gpc, tpc, 0x48c), 0xc0000000); |
| 184 | stat &= ~0x8; | 185 | stat &= ~0x8; |
| 185 | } | 186 | } |
| 186 | 187 | ||
| 187 | if (stat) { | 188 | if (stat) { |
| 188 | nv_error(priv, "GPC%i/TP%i: unknown stat %08x\n", | 189 | nv_error(priv, "GPC%i/TPC%i: unknown stat %08x\n", |
| 189 | gpc, tp, stat); | 190 | gpc, tpc, stat); |
| 190 | } | 191 | } |
| 191 | } | 192 | } |
| 192 | 193 | ||
| @@ -198,7 +199,7 @@ nve0_graph_gpc_trap(struct nvc0_graph_priv *priv) | |||
| 198 | 199 | ||
| 199 | for (gpc = 0; gpc < 4; ++gpc) { | 200 | for (gpc = 0; gpc < 4; ++gpc) { |
| 200 | u32 stat; | 201 | u32 stat; |
| 201 | int tp; | 202 | int tpc; |
| 202 | 203 | ||
| 203 | if (!(mask & (1 << gpc))) | 204 | if (!(mask & (1 << gpc))) |
| 204 | continue; | 205 | continue; |
| @@ -257,9 +258,9 @@ nve0_graph_gpc_trap(struct nvc0_graph_priv *priv) | |||
| 257 | stat &= ~0x0008; | 258 | stat &= ~0x0008; |
| 258 | } | 259 | } |
| 259 | 260 | ||
| 260 | for (tp = 0; tp < 8; ++tp) { | 261 | for (tpc = 0; tpc < 8; ++tpc) { |
| 261 | if (stat & (1 << (16 + tp))) | 262 | if (stat & (1 << (16 + tpc))) |
| 262 | nve0_graph_tp_trap(priv, gpc, tp); | 263 | nve0_graph_tpc_trap(priv, gpc, tpc); |
| 263 | } | 264 | } |
| 264 | stat &= ~0xff0000; | 265 | stat &= ~0xff0000; |
| 265 | 266 | ||
