Commit a8ce8b65 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/disp/gf119-: decode exception reason to human-readable string

We also change the error strings to match NVIDIA's naming.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent eb972d14
...@@ -91,15 +91,21 @@ gf119_disp_intr_error(struct nv50_disp *disp, int chid) ...@@ -91,15 +91,21 @@ gf119_disp_intr_error(struct nv50_disp *disp, int chid)
{ {
struct nvkm_subdev *subdev = &disp->base.engine.subdev; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device; struct nvkm_device *device = subdev->device;
u32 mthd = nvkm_rd32(device, 0x6101f0 + (chid * 12)); u32 stat = nvkm_rd32(device, 0x6101f0 + (chid * 12));
u32 type = (stat & 0x00007000) >> 12;
u32 mthd = (stat & 0x00000ffc);
u32 data = nvkm_rd32(device, 0x6101f4 + (chid * 12)); u32 data = nvkm_rd32(device, 0x6101f4 + (chid * 12));
u32 unkn = nvkm_rd32(device, 0x6101f8 + (chid * 12)); u32 code = nvkm_rd32(device, 0x6101f8 + (chid * 12));
const struct nvkm_enum *reason =
nvkm_enum_find(nv50_disp_intr_error_type, type);
nvkm_error(subdev, "chid %d mthd %04x data %08x %08x %08x\n", nvkm_error(subdev, "chid %d stat %08x reason %d [%s] mthd %04x "
chid, (mthd & 0x0000ffc), data, mthd, unkn); "data %08x code %08x\n",
chid, stat, type, reason ? reason->name : "",
mthd, data, code);
if (chid < ARRAY_SIZE(disp->chan)) { if (chid < ARRAY_SIZE(disp->chan)) {
switch (mthd & 0xffc) { switch (mthd) {
case 0x0080: case 0x0080:
nv50_disp_chan_mthd(disp->chan[chid], NV_DBG_ERROR); nv50_disp_chan_mthd(disp->chan[chid], NV_DBG_ERROR);
break; break;
......
...@@ -103,10 +103,13 @@ gv100_disp_exception(struct nv50_disp *disp, int chid) ...@@ -103,10 +103,13 @@ gv100_disp_exception(struct nv50_disp *disp, int chid)
u32 mthd = (stat & 0x00000fff) << 2; u32 mthd = (stat & 0x00000fff) << 2;
u32 data = nvkm_rd32(device, 0x611024 + (chid * 12)); u32 data = nvkm_rd32(device, 0x611024 + (chid * 12));
u32 code = nvkm_rd32(device, 0x611028 + (chid * 12)); u32 code = nvkm_rd32(device, 0x611028 + (chid * 12));
const struct nvkm_enum *reason =
nvkm_enum_find(nv50_disp_intr_error_type, type);
nvkm_error(subdev, "chid %d %08x [type %d mthd %04x] " nvkm_error(subdev, "chid %d stat %08x reason %d [%s] mthd %04x "
"data %08x code %08x\n", "data %08x code %08x\n",
chid, stat, type, mthd, data, code); chid, stat, type, reason ? reason->name : "",
mthd, data, code);
if (chid < ARRAY_SIZE(disp->chan) && disp->chan[chid]) { if (chid < ARRAY_SIZE(disp->chan) && disp->chan[chid]) {
switch (mthd) { switch (mthd) {
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "rootnv50.h" #include "rootnv50.h"
#include <core/client.h> #include <core/client.h>
#include <core/enum.h>
#include <core/ramht.h> #include <core/ramht.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/disp.h> #include <subdev/bios/disp.h>
...@@ -593,12 +592,15 @@ nv50_disp_super(struct work_struct *work) ...@@ -593,12 +592,15 @@ nv50_disp_super(struct work_struct *work)
nvkm_wr32(device, 0x610030, 0x80000000); nvkm_wr32(device, 0x610030, 0x80000000);
} }
static const struct nvkm_enum const struct nvkm_enum
nv50_disp_intr_error_type[] = { nv50_disp_intr_error_type[] = {
{ 3, "ILLEGAL_MTHD" }, { 0, "NONE" },
{ 4, "INVALID_VALUE" }, { 1, "PUSHBUFFER_ERR" },
{ 2, "TRAP" },
{ 3, "RESERVED_METHOD" },
{ 4, "INVALID_ARG" },
{ 5, "INVALID_STATE" }, { 5, "INVALID_STATE" },
{ 7, "INVALID_HANDLE" }, { 7, "UNRESOLVABLE_HANDLE" },
{} {}
}; };
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include "priv.h" #include "priv.h"
struct nvkm_head; struct nvkm_head;
#include <core/enum.h>
struct nv50_disp { struct nv50_disp {
const struct nv50_disp_func *func; const struct nv50_disp_func *func;
struct nvkm_disp base; struct nvkm_disp base;
...@@ -71,6 +73,7 @@ int nv50_disp_init(struct nv50_disp *); ...@@ -71,6 +73,7 @@ int nv50_disp_init(struct nv50_disp *);
void nv50_disp_fini(struct nv50_disp *); void nv50_disp_fini(struct nv50_disp *);
void nv50_disp_intr(struct nv50_disp *); void nv50_disp_intr(struct nv50_disp *);
void nv50_disp_super(struct work_struct *); void nv50_disp_super(struct work_struct *);
extern const struct nvkm_enum nv50_disp_intr_error_type[];
int gf119_disp_init(struct nv50_disp *); int gf119_disp_init(struct nv50_disp *);
void gf119_disp_fini(struct nv50_disp *); void gf119_disp_fini(struct nv50_disp *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment