Commit 84407824 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/disp: switch to subdev printk macros

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent e37f5433
...@@ -49,7 +49,7 @@ struct nvkm_connector_impl { ...@@ -49,7 +49,7 @@ struct nvkm_connector_impl {
#ifndef MSG #ifndef MSG
#define MSG(l,f,a...) do { \ #define MSG(l,f,a...) do { \
struct nvkm_connector *_conn = (void *)conn; \ struct nvkm_connector *_conn = (void *)conn; \
nv_##l(_conn, "%02x:%02x%02x: "f, _conn->index, \ nvkm_##l(&nvkm_disp(_conn)->engine.subdev, "%02x:%02x%02x: "f, _conn->index, \
_conn->info.location, _conn->info.type, ##a); \ _conn->info.location, _conn->info.type, ##a); \
} while(0) } while(0)
#define DBG(f,a...) MSG(debug, f, ##a) #define DBG(f,a...) MSG(debug, f, ##a)
......
...@@ -69,7 +69,8 @@ nv50_dac_power(NV50_DISP_MTHD_V1) ...@@ -69,7 +69,8 @@ nv50_dac_power(NV50_DISP_MTHD_V1)
int int
nv50_dac_sense(NV50_DISP_MTHD_V1) nv50_dac_sense(NV50_DISP_MTHD_V1)
{ {
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
union { union {
struct nv50_disp_dac_load_v0 v0; struct nv50_disp_dac_load_v0 v0;
} *args = data; } *args = data;
...@@ -104,7 +105,7 @@ nv50_dac_sense(NV50_DISP_MTHD_V1) ...@@ -104,7 +105,7 @@ nv50_dac_sense(NV50_DISP_MTHD_V1)
break; break;
); );
nv_debug(disp, "DAC%d sense: 0x%08x\n", outp->or, loadval); nvkm_debug(subdev, "DAC%d sense: %08x\n", outp->or, loadval);
if (!(loadval & 0x80000000)) if (!(loadval & 0x80000000))
return -ETIMEDOUT; return -ETIMEDOUT;
......
...@@ -95,7 +95,8 @@ gf110_disp_dmac_init(struct nvkm_object *object) ...@@ -95,7 +95,8 @@ gf110_disp_dmac_init(struct nvkm_object *object)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_dmac *dmac = (void *)object; struct nv50_disp_dmac *dmac = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int chid = dmac->base.chid; int chid = dmac->base.chid;
int ret; int ret;
...@@ -119,7 +120,7 @@ gf110_disp_dmac_init(struct nvkm_object *object) ...@@ -119,7 +120,7 @@ gf110_disp_dmac_init(struct nvkm_object *object)
if (!(nvkm_rd32(device, 0x610490 + (chid * 0x10)) & 0x80000000)) if (!(nvkm_rd32(device, 0x610490 + (chid * 0x10)) & 0x80000000))
break; break;
) < 0) { ) < 0) {
nv_error(dmac, "init: 0x%08x\n", nvkm_error(subdev, "ch %d init: %08x\n", chid,
nvkm_rd32(device, 0x610490 + (chid * 0x10))); nvkm_rd32(device, 0x610490 + (chid * 0x10)));
return -EBUSY; return -EBUSY;
} }
...@@ -132,7 +133,8 @@ gf110_disp_dmac_fini(struct nvkm_object *object, bool suspend) ...@@ -132,7 +133,8 @@ gf110_disp_dmac_fini(struct nvkm_object *object, bool suspend)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_dmac *dmac = (void *)object; struct nv50_disp_dmac *dmac = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int chid = dmac->base.chid; int chid = dmac->base.chid;
/* deactivate channel */ /* deactivate channel */
...@@ -142,7 +144,7 @@ gf110_disp_dmac_fini(struct nvkm_object *object, bool suspend) ...@@ -142,7 +144,7 @@ gf110_disp_dmac_fini(struct nvkm_object *object, bool suspend)
if (!(nvkm_rd32(device, 0x610490 + (chid * 0x10)) & 0x001e0000)) if (!(nvkm_rd32(device, 0x610490 + (chid * 0x10)) & 0x001e0000))
break; break;
) < 0) { ) < 0) {
nv_error(dmac, "fini: 0x%08x\n", nvkm_error(subdev, "ch %d fini: %08x\n", chid,
nvkm_rd32(device, 0x610490 + (chid * 0x10))); nvkm_rd32(device, 0x610490 + (chid * 0x10)));
if (suspend) if (suspend)
return -EBUSY; return -EBUSY;
...@@ -304,7 +306,8 @@ gf110_disp_core_init(struct nvkm_object *object) ...@@ -304,7 +306,8 @@ gf110_disp_core_init(struct nvkm_object *object)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_dmac *mast = (void *)object; struct nv50_disp_dmac *mast = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int ret; int ret;
ret = nv50_disp_chan_init(&mast->base); ret = nv50_disp_chan_init(&mast->base);
...@@ -327,7 +330,8 @@ gf110_disp_core_init(struct nvkm_object *object) ...@@ -327,7 +330,8 @@ gf110_disp_core_init(struct nvkm_object *object)
if (!(nvkm_rd32(device, 0x610490) & 0x80000000)) if (!(nvkm_rd32(device, 0x610490) & 0x80000000))
break; break;
) < 0) { ) < 0) {
nv_error(mast, "init: 0x%08x\n", nvkm_rd32(device, 0x610490)); nvkm_error(subdev, "core init: %08x\n",
nvkm_rd32(device, 0x610490));
return -EBUSY; return -EBUSY;
} }
...@@ -339,7 +343,8 @@ gf110_disp_core_fini(struct nvkm_object *object, bool suspend) ...@@ -339,7 +343,8 @@ gf110_disp_core_fini(struct nvkm_object *object, bool suspend)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_dmac *mast = (void *)object; struct nv50_disp_dmac *mast = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
/* deactivate channel */ /* deactivate channel */
nvkm_mask(device, 0x610490, 0x00000010, 0x00000000); nvkm_mask(device, 0x610490, 0x00000010, 0x00000000);
...@@ -348,7 +353,8 @@ gf110_disp_core_fini(struct nvkm_object *object, bool suspend) ...@@ -348,7 +353,8 @@ gf110_disp_core_fini(struct nvkm_object *object, bool suspend)
if (!(nvkm_rd32(device, 0x610490) & 0x001e0000)) if (!(nvkm_rd32(device, 0x610490) & 0x001e0000))
break; break;
) < 0) { ) < 0) {
nv_error(mast, "fini: 0x%08x\n", nvkm_rd32(device, 0x610490)); nvkm_error(subdev, "core fini: %08x\n",
nvkm_rd32(device, 0x610490));
if (suspend) if (suspend)
return -EBUSY; return -EBUSY;
} }
...@@ -559,7 +565,8 @@ gf110_disp_pioc_init(struct nvkm_object *object) ...@@ -559,7 +565,8 @@ gf110_disp_pioc_init(struct nvkm_object *object)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_pioc *pioc = (void *)object; struct nv50_disp_pioc *pioc = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int chid = pioc->base.chid; int chid = pioc->base.chid;
int ret; int ret;
...@@ -577,7 +584,7 @@ gf110_disp_pioc_init(struct nvkm_object *object) ...@@ -577,7 +584,7 @@ gf110_disp_pioc_init(struct nvkm_object *object)
if ((tmp & 0x00030000) == 0x00010000) if ((tmp & 0x00030000) == 0x00010000)
break; break;
) < 0) { ) < 0) {
nv_error(pioc, "init: 0x%08x\n", nvkm_error(subdev, "ch %d init: %08x\n", chid,
nvkm_rd32(device, 0x610490 + (chid * 0x10))); nvkm_rd32(device, 0x610490 + (chid * 0x10)));
return -EBUSY; return -EBUSY;
} }
...@@ -590,7 +597,8 @@ gf110_disp_pioc_fini(struct nvkm_object *object, bool suspend) ...@@ -590,7 +597,8 @@ gf110_disp_pioc_fini(struct nvkm_object *object, bool suspend)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_pioc *pioc = (void *)object; struct nv50_disp_pioc *pioc = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int chid = pioc->base.chid; int chid = pioc->base.chid;
nvkm_mask(device, 0x610490 + (chid * 0x10), 0x00000001, 0x00000000); nvkm_mask(device, 0x610490 + (chid * 0x10), 0x00000001, 0x00000000);
...@@ -598,7 +606,7 @@ gf110_disp_pioc_fini(struct nvkm_object *object, bool suspend) ...@@ -598,7 +606,7 @@ gf110_disp_pioc_fini(struct nvkm_object *object, bool suspend)
if (!(nvkm_rd32(device, 0x610490 + (chid * 0x10)) & 0x00030000)) if (!(nvkm_rd32(device, 0x610490 + (chid * 0x10)) & 0x00030000))
break; break;
) < 0) { ) < 0) {
nv_error(pioc, "timeout: 0x%08x\n", nvkm_error(subdev, "ch %d fini: %08x\n", chid,
nvkm_rd32(device, 0x610490 + (chid * 0x10))); nvkm_rd32(device, 0x610490 + (chid * 0x10)));
if (suspend) if (suspend)
return -EBUSY; return -EBUSY;
...@@ -824,7 +832,8 @@ exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl, ...@@ -824,7 +832,8 @@ exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl,
u32 *data, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u32 *data, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_outp *info) struct nvbios_outp *info)
{ {
struct nvkm_bios *bios = nvkm_bios(disp); struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_bios *bios = subdev->device->bios;
struct nvkm_output *outp; struct nvkm_output *outp;
u16 mask, type; u16 mask, type;
...@@ -841,7 +850,7 @@ exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl, ...@@ -841,7 +850,7 @@ exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl,
case 0x00000800: type = DCB_OUTPUT_DP; mask = 1; break; case 0x00000800: type = DCB_OUTPUT_DP; mask = 1; break;
case 0x00000900: type = DCB_OUTPUT_DP; mask = 2; break; case 0x00000900: type = DCB_OUTPUT_DP; mask = 2; break;
default: default:
nv_error(disp, "unknown SOR mc 0x%08x\n", ctrl); nvkm_error(subdev, "unknown SOR mc %08x\n", ctrl);
return NULL; return NULL;
} }
} }
...@@ -1136,14 +1145,15 @@ gf110_disp_intr_supervisor(struct work_struct *work) ...@@ -1136,14 +1145,15 @@ gf110_disp_intr_supervisor(struct work_struct *work)
struct nv50_disp *disp = struct nv50_disp *disp =
container_of(work, struct nv50_disp, supervisor); container_of(work, struct nv50_disp, supervisor);
struct nv50_disp_impl *impl = (void *)nv_object(disp)->oclass; struct nv50_disp_impl *impl = (void *)nv_object(disp)->oclass;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
u32 mask[4]; u32 mask[4];
int head; int head;
nv_debug(disp, "supervisor %d\n", ffs(disp->super)); nvkm_debug(subdev, "supervisor %d\n", ffs(disp->super));
for (head = 0; head < disp->head.nr; head++) { for (head = 0; head < disp->head.nr; head++) {
mask[head] = nvkm_rd32(device, 0x6101d4 + (head * 0x800)); mask[head] = nvkm_rd32(device, 0x6101d4 + (head * 0x800));
nv_debug(disp, "head %d: 0x%08x\n", head, mask[head]); nvkm_debug(subdev, "head %d: %08x\n", head, mask[head]);
} }
if (disp->super & 0x00000001) { if (disp->super & 0x00000001) {
...@@ -1151,7 +1161,7 @@ gf110_disp_intr_supervisor(struct work_struct *work) ...@@ -1151,7 +1161,7 @@ gf110_disp_intr_supervisor(struct work_struct *work)
for (head = 0; head < disp->head.nr; head++) { for (head = 0; head < disp->head.nr; head++) {
if (!(mask[head] & 0x00001000)) if (!(mask[head] & 0x00001000))
continue; continue;
nv_debug(disp, "supervisor 1.0 - head %d\n", head); nvkm_debug(subdev, "supervisor 1.0 - head %d\n", head);
gf110_disp_intr_unk1_0(disp, head); gf110_disp_intr_unk1_0(disp, head);
} }
} else } else
...@@ -1159,19 +1169,19 @@ gf110_disp_intr_supervisor(struct work_struct *work) ...@@ -1159,19 +1169,19 @@ gf110_disp_intr_supervisor(struct work_struct *work)
for (head = 0; head < disp->head.nr; head++) { for (head = 0; head < disp->head.nr; head++) {
if (!(mask[head] & 0x00001000)) if (!(mask[head] & 0x00001000))
continue; continue;
nv_debug(disp, "supervisor 2.0 - head %d\n", head); nvkm_debug(subdev, "supervisor 2.0 - head %d\n", head);
gf110_disp_intr_unk2_0(disp, head); gf110_disp_intr_unk2_0(disp, head);
} }
for (head = 0; head < disp->head.nr; head++) { for (head = 0; head < disp->head.nr; head++) {
if (!(mask[head] & 0x00010000)) if (!(mask[head] & 0x00010000))
continue; continue;
nv_debug(disp, "supervisor 2.1 - head %d\n", head); nvkm_debug(subdev, "supervisor 2.1 - head %d\n", head);
gf110_disp_intr_unk2_1(disp, head); gf110_disp_intr_unk2_1(disp, head);
} }
for (head = 0; head < disp->head.nr; head++) { for (head = 0; head < disp->head.nr; head++) {
if (!(mask[head] & 0x00001000)) if (!(mask[head] & 0x00001000))
continue; continue;
nv_debug(disp, "supervisor 2.2 - head %d\n", head); nvkm_debug(subdev, "supervisor 2.2 - head %d\n", head);
gf110_disp_intr_unk2_2(disp, head); gf110_disp_intr_unk2_2(disp, head);
} }
} else } else
...@@ -1179,7 +1189,7 @@ gf110_disp_intr_supervisor(struct work_struct *work) ...@@ -1179,7 +1189,7 @@ gf110_disp_intr_supervisor(struct work_struct *work)
for (head = 0; head < disp->head.nr; head++) { for (head = 0; head < disp->head.nr; head++) {
if (!(mask[head] & 0x00001000)) if (!(mask[head] & 0x00001000))
continue; continue;
nv_debug(disp, "supervisor 3.0 - head %d\n", head); nvkm_debug(subdev, "supervisor 3.0 - head %d\n", head);
gf110_disp_intr_unk4_0(disp, head); gf110_disp_intr_unk4_0(disp, head);
} }
} }
...@@ -1193,13 +1203,13 @@ static void ...@@ -1193,13 +1203,13 @@ static void
gf110_disp_intr_error(struct nv50_disp *disp, int chid) gf110_disp_intr_error(struct nv50_disp *disp, int chid)
{ {
const struct nv50_disp_impl *impl = (void *)nv_object(disp)->oclass; const struct nv50_disp_impl *impl = (void *)nv_object(disp)->oclass;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
u32 mthd = nvkm_rd32(device, 0x6101f0 + (chid * 12)); u32 mthd = nvkm_rd32(device, 0x6101f0 + (chid * 12));
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 unkn = nvkm_rd32(device, 0x6101f8 + (chid * 12));
nv_error(disp, "chid %d mthd 0x%04x data 0x%08x " nvkm_error(subdev, "chid %d mthd %04x data %08x %08x %08x\n",
"0x%08x 0x%08x\n",
chid, (mthd & 0x0000ffc), data, mthd, unkn); chid, (mthd & 0x0000ffc), data, mthd, unkn);
if (chid == 0) { if (chid == 0) {
...@@ -1241,7 +1251,7 @@ void ...@@ -1241,7 +1251,7 @@ void
gf110_disp_intr(struct nvkm_subdev *subdev) gf110_disp_intr(struct nvkm_subdev *subdev)
{ {
struct nv50_disp *disp = (void *)subdev; struct nv50_disp *disp = (void *)subdev;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_device *device = subdev->device;
u32 intr = nvkm_rd32(device, 0x610088); u32 intr = nvkm_rd32(device, 0x610088);
int i; int i;
...@@ -1273,7 +1283,7 @@ gf110_disp_intr(struct nvkm_subdev *subdev) ...@@ -1273,7 +1283,7 @@ gf110_disp_intr(struct nvkm_subdev *subdev)
} }
if (stat) { if (stat) {
nv_info(disp, "unknown intr24 0x%08x\n", stat); nvkm_warn(subdev, "intr24 %08x\n", stat);
nvkm_wr32(device, 0x6100ac, stat); nvkm_wr32(device, 0x6100ac, stat);
} }
......
...@@ -167,7 +167,7 @@ nv04_disp_intr(struct nvkm_subdev *subdev) ...@@ -167,7 +167,7 @@ nv04_disp_intr(struct nvkm_subdev *subdev)
nv_device(disp)->chipset <= 0x40) { nv_device(disp)->chipset <= 0x40) {
pvideo = nvkm_rd32(device, 0x8100); pvideo = nvkm_rd32(device, 0x8100);
if (pvideo & ~0x11) if (pvideo & ~0x11)
nv_info(disp, "PVIDEO intr: %08x\n", pvideo); nvkm_info(subdev, "PVIDEO intr: %08x\n", pvideo);
nvkm_wr32(device, 0x8100, pvideo); nvkm_wr32(device, 0x8100, pvideo);
} }
} }
......
...@@ -259,7 +259,8 @@ nv50_disp_dmac_init(struct nvkm_object *object) ...@@ -259,7 +259,8 @@ nv50_disp_dmac_init(struct nvkm_object *object)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_dmac *dmac = (void *)object; struct nv50_disp_dmac *dmac = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int chid = dmac->base.chid; int chid = dmac->base.chid;
int ret; int ret;
...@@ -283,7 +284,7 @@ nv50_disp_dmac_init(struct nvkm_object *object) ...@@ -283,7 +284,7 @@ nv50_disp_dmac_init(struct nvkm_object *object)
if (!(nvkm_rd32(device, 0x610200 + (chid * 0x10)) & 0x80000000)) if (!(nvkm_rd32(device, 0x610200 + (chid * 0x10)) & 0x80000000))
break; break;
) < 0) { ) < 0) {
nv_error(dmac, "init timeout, 0x%08x\n", nvkm_error(subdev, "ch %d init timeout, %08x\n", chid,
nvkm_rd32(device, 0x610200 + (chid * 0x10))); nvkm_rd32(device, 0x610200 + (chid * 0x10)));
return -EBUSY; return -EBUSY;
} }
...@@ -296,7 +297,8 @@ nv50_disp_dmac_fini(struct nvkm_object *object, bool suspend) ...@@ -296,7 +297,8 @@ nv50_disp_dmac_fini(struct nvkm_object *object, bool suspend)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_dmac *dmac = (void *)object; struct nv50_disp_dmac *dmac = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int chid = dmac->base.chid; int chid = dmac->base.chid;
/* deactivate channel */ /* deactivate channel */
...@@ -306,7 +308,7 @@ nv50_disp_dmac_fini(struct nvkm_object *object, bool suspend) ...@@ -306,7 +308,7 @@ nv50_disp_dmac_fini(struct nvkm_object *object, bool suspend)
if (!(nvkm_rd32(device, 0x610200 + (chid * 0x10)) & 0x001e0000)) if (!(nvkm_rd32(device, 0x610200 + (chid * 0x10)) & 0x001e0000))
break; break;
) < 0) { ) < 0) {
nv_error(dmac, "fini timeout, 0x%08x\n", nvkm_error(subdev, "ch %d fini timeout, %08x\n", chid,
nvkm_rd32(device, 0x610200 + (chid * 0x10))); nvkm_rd32(device, 0x610200 + (chid * 0x10)));
if (suspend) if (suspend)
return -EBUSY; return -EBUSY;
...@@ -326,8 +328,8 @@ static void ...@@ -326,8 +328,8 @@ static void
nv50_disp_mthd_list(struct nv50_disp *disp, int debug, u32 base, int c, nv50_disp_mthd_list(struct nv50_disp *disp, int debug, u32 base, int c,
const struct nv50_disp_mthd_list *list, int inst) const struct nv50_disp_mthd_list *list, int inst)
{ {
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_object *object = nv_object(disp); struct nvkm_device *device = subdev->device;
int i; int i;
for (i = 0; list->data[i].mthd; i++) { for (i = 0; list->data[i].mthd; i++) {
...@@ -339,11 +341,12 @@ nv50_disp_mthd_list(struct nv50_disp *disp, int debug, u32 base, int c, ...@@ -339,11 +341,12 @@ nv50_disp_mthd_list(struct nv50_disp *disp, int debug, u32 base, int c,
char mods[16]; char mods[16];
if (prev != next) if (prev != next)
snprintf(mods, sizeof(mods), "-> 0x%08x", next); snprintf(mods, sizeof(mods), "-> %08x", next);
else else
snprintf(mods, sizeof(mods), "%13c", ' '); snprintf(mods, sizeof(mods), "%13c", ' ');
nv_printk_(object, debug, "\t0x%04x: 0x%08x %s%s%s\n", nvkm_printk_(subdev, debug, info,
"\t%04x: %08x %s%s%s\n",
mthd, prev, mods, name ? " // " : "", mthd, prev, mods, name ? " // " : "",
name ? name : ""); name ? name : "");
} }
...@@ -357,6 +360,7 @@ nv50_disp_mthd_chan(struct nv50_disp *disp, int debug, int head, ...@@ -357,6 +360,7 @@ nv50_disp_mthd_chan(struct nv50_disp *disp, int debug, int head,
struct nvkm_object *object = nv_object(disp); struct nvkm_object *object = nv_object(disp);
const struct nv50_disp_impl *impl = (void *)object->oclass; const struct nv50_disp_impl *impl = (void *)object->oclass;
const struct nv50_disp_mthd_list *list; const struct nv50_disp_mthd_list *list;
struct nvkm_subdev *subdev = &disp->base.engine.subdev;
int i, j; int i, j;
if (debug > nv_subdev(disp)->debug) if (debug > nv_subdev(disp)->debug)
...@@ -381,7 +385,7 @@ nv50_disp_mthd_chan(struct nv50_disp *disp, int debug, int head, ...@@ -381,7 +385,7 @@ nv50_disp_mthd_chan(struct nv50_disp *disp, int debug, int head,
sname = sname_; sname = sname_;
} }
nv_printk_(object, debug, "%s%s:\n", cname, sname); nvkm_printk_(subdev, debug, info, "%s%s:\n", cname, sname);
nv50_disp_mthd_list(disp, debug, base, impl->mthd.prev, nv50_disp_mthd_list(disp, debug, base, impl->mthd.prev,
list, j); list, j);
} }
...@@ -528,7 +532,8 @@ nv50_disp_core_init(struct nvkm_object *object) ...@@ -528,7 +532,8 @@ nv50_disp_core_init(struct nvkm_object *object)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_dmac *mast = (void *)object; struct nv50_disp_dmac *mast = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int ret; int ret;
ret = nv50_disp_chan_init(&mast->base); ret = nv50_disp_chan_init(&mast->base);
...@@ -557,7 +562,8 @@ nv50_disp_core_init(struct nvkm_object *object) ...@@ -557,7 +562,8 @@ nv50_disp_core_init(struct nvkm_object *object)
if (!(nvkm_rd32(device, 0x610200) & 0x80000000)) if (!(nvkm_rd32(device, 0x610200) & 0x80000000))
break; break;
) < 0) { ) < 0) {
nv_error(mast, "init: 0x%08x\n", nvkm_rd32(device, 0x610200)); nvkm_error(subdev, "core init: %08x\n",
nvkm_rd32(device, 0x610200));
return -EBUSY; return -EBUSY;
} }
...@@ -569,7 +575,8 @@ nv50_disp_core_fini(struct nvkm_object *object, bool suspend) ...@@ -569,7 +575,8 @@ nv50_disp_core_fini(struct nvkm_object *object, bool suspend)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_dmac *mast = (void *)object; struct nv50_disp_dmac *mast = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
/* deactivate channel */ /* deactivate channel */
nvkm_mask(device, 0x610200, 0x00000010, 0x00000000); nvkm_mask(device, 0x610200, 0x00000010, 0x00000000);
...@@ -578,7 +585,8 @@ nv50_disp_core_fini(struct nvkm_object *object, bool suspend) ...@@ -578,7 +585,8 @@ nv50_disp_core_fini(struct nvkm_object *object, bool suspend)
if (!(nvkm_rd32(device, 0x610200) & 0x001e0000)) if (!(nvkm_rd32(device, 0x610200) & 0x001e0000))
break; break;
) < 0) { ) < 0) {
nv_error(mast, "fini: 0x%08x\n", nvkm_rd32(device, 0x610200)); nvkm_error(subdev, "core fini: %08x\n",
nvkm_rd32(device, 0x610200));
if (suspend) if (suspend)
return -EBUSY; return -EBUSY;
} }
...@@ -822,7 +830,8 @@ nv50_disp_pioc_init(struct nvkm_object *object) ...@@ -822,7 +830,8 @@ nv50_disp_pioc_init(struct nvkm_object *object)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_pioc *pioc = (void *)object; struct nv50_disp_pioc *pioc = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int chid = pioc->base.chid; int chid = pioc->base.chid;
int ret; int ret;
...@@ -835,7 +844,7 @@ nv50_disp_pioc_init(struct nvkm_object *object) ...@@ -835,7 +844,7 @@ nv50_disp_pioc_init(struct nvkm_object *object)
if (!(nvkm_rd32(device, 0x610200 + (chid * 0x10)) & 0x00030000)) if (!(nvkm_rd32(device, 0x610200 + (chid * 0x10)) & 0x00030000))
break; break;
) < 0) { ) < 0) {
nv_error(pioc, "timeout0: 0x%08x\n", nvkm_error(subdev, "ch %d timeout0: %08x\n", chid,
nvkm_rd32(device, 0x610200 + (chid * 0x10))); nvkm_rd32(device, 0x610200 + (chid * 0x10)));
return -EBUSY; return -EBUSY;
} }
...@@ -846,7 +855,7 @@ nv50_disp_pioc_init(struct nvkm_object *object) ...@@ -846,7 +855,7 @@ nv50_disp_pioc_init(struct nvkm_object *object)
if ((tmp & 0x00030000) == 0x00010000) if ((tmp & 0x00030000) == 0x00010000)
break; break;
) < 0) { ) < 0) {
nv_error(pioc, "timeout1: 0x%08x\n", nvkm_error(subdev, "ch %d timeout1: %08x\n", chid,
nvkm_rd32(device, 0x610200 + (chid * 0x10))); nvkm_rd32(device, 0x610200 + (chid * 0x10)));
return -EBUSY; return -EBUSY;
} }
...@@ -859,7 +868,8 @@ nv50_disp_pioc_fini(struct nvkm_object *object, bool suspend) ...@@ -859,7 +868,8 @@ nv50_disp_pioc_fini(struct nvkm_object *object, bool suspend)
{ {
struct nv50_disp *disp = (void *)object->engine; struct nv50_disp *disp = (void *)object->engine;
struct nv50_disp_pioc *pioc = (void *)object; struct nv50_disp_pioc *pioc = (void *)object;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int chid = pioc->base.chid; int chid = pioc->base.chid;
nvkm_mask(device, 0x610200 + (chid * 0x10), 0x00000001, 0x00000000); nvkm_mask(device, 0x610200 + (chid * 0x10), 0x00000001, 0x00000000);
...@@ -867,7 +877,7 @@ nv50_disp_pioc_fini(struct nvkm_object *object, bool suspend) ...@@ -867,7 +877,7 @@ nv50_disp_pioc_fini(struct nvkm_object *object, bool suspend)
if (!(nvkm_rd32(device, 0x610200 + (chid * 0x10)) & 0x00030000)) if (!(nvkm_rd32(device, 0x610200 + (chid * 0x10)) & 0x00030000))
break; break;
) < 0) { ) < 0) {
nv_error(pioc, "timeout: 0x%08x\n", nvkm_error(subdev, "ch %d timeout: %08x\n", chid,
nvkm_rd32(device, 0x610200 + (chid * 0x10))); nvkm_rd32(device, 0x610200 + (chid * 0x10)));
if (suspend) if (suspend)
return -EBUSY; return -EBUSY;
...@@ -1362,25 +1372,21 @@ static void ...@@ -1362,25 +1372,21 @@ static void
nv50_disp_intr_error(struct nv50_disp *disp, int chid) nv50_disp_intr_error(struct nv50_disp *disp, int chid)
{ {
struct nv50_disp_impl *impl = (void *)nv_object(disp)->oclass; struct nv50_disp_impl *impl = (void *)nv_object(disp)->oclass;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
u32 data = nvkm_rd32(device, 0x610084 + (chid * 0x08)); u32 data = nvkm_rd32(device, 0x610084 + (chid * 0x08));
u32 addr = nvkm_rd32(device, 0x610080 + (chid * 0x08)); u32 addr = nvkm_rd32(device, 0x610080 + (chid * 0x08));
u32 code = (addr & 0x00ff0000) >> 16; u32 code = (addr & 0x00ff0000) >> 16;
u32 type = (addr & 0x00007000) >> 12; u32 type = (addr & 0x00007000) >> 12;
u32 mthd = (addr & 0x00000ffc); u32 mthd = (addr & 0x00000ffc);
const struct nvkm_enum *ec, *et; const struct nvkm_enum *ec, *et;
char ecunk[6], etunk[6];
et = nvkm_enum_find(nv50_disp_intr_error_type, type); et = nvkm_enum_find(nv50_disp_intr_error_type, type);
if (!et)
snprintf(etunk, sizeof(etunk), "UNK%02X", type);
ec = nvkm_enum_find(nv50_disp_intr_error_code, code); ec = nvkm_enum_find(nv50_disp_intr_error_code, code);
if (!ec)
snprintf(ecunk, sizeof(ecunk), "UNK%02X", code);
nv_error(disp, "%s [%s] chid %d mthd 0x%04x data 0x%08x\n", nvkm_error(subdev,
et ? et->name : etunk, ec ? ec->name : ecunk, "ERROR %d [%s] %02x [%s] chid %d mthd %04x data %08x\n",
type, et ? et->name : "", code, ec ? ec->name : "",
chid, mthd, data); chid, mthd, data);
if (chid == 0) { if (chid == 0) {
...@@ -1423,7 +1429,8 @@ exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl, ...@@ -1423,7 +1429,8 @@ exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl,
u32 *data, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u32 *data, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_outp *info) struct nvbios_outp *info)
{ {
struct nvkm_bios *bios = nvkm_bios(disp); struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_bios *bios = subdev->device->bios;
struct nvkm_output *outp; struct nvkm_output *outp;
u16 mask, type; u16 mask, type;
...@@ -1440,7 +1447,7 @@ exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl, ...@@ -1440,7 +1447,7 @@ exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl,
case 0x00000800: type = DCB_OUTPUT_DP; mask = 1; break; case 0x00000800: type = DCB_OUTPUT_DP; mask = 1; break;
case 0x00000900: type = DCB_OUTPUT_DP; mask = 2; break; case 0x00000900: type = DCB_OUTPUT_DP; mask = 2; break;
default: default:
nv_error(disp, "unknown SOR mc 0x%08x\n", ctrl); nvkm_error(subdev, "unknown SOR mc %08x\n", ctrl);
return NULL; return NULL;
} }
or -= 4; or -= 4;
...@@ -1451,7 +1458,7 @@ exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl, ...@@ -1451,7 +1458,7 @@ exec_lookup(struct nv50_disp *disp, int head, int or, u32 ctrl,
switch (ctrl & 0x00000f00) { switch (ctrl & 0x00000f00) {
case 0x00000000: type |= disp->pior.type[or]; break; case 0x00000000: type |= disp->pior.type[or]; break;
default: default:
nv_error(disp, "unknown PIOR mc 0x%08x\n", ctrl); nvkm_error(subdev, "unknown PIOR mc %08x\n", ctrl);
return NULL; return NULL;
} }
} }
...@@ -1676,7 +1683,8 @@ static void ...@@ -1676,7 +1683,8 @@ static void
nv50_disp_intr_unk20_2_dp(struct nv50_disp *disp, int head, nv50_disp_intr_unk20_2_dp(struct nv50_disp *disp, int head,
struct dcb_output *outp, u32 pclk) struct dcb_output *outp, u32 pclk)
{ {
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
const int link = !(outp->sorconf.link & 1); const int link = !(outp->sorconf.link & 1);
const int or = ffs(outp->or) - 1; const int or = ffs(outp->or) - 1;
const u32 soff = ( or * 0x800); const u32 soff = ( or * 0x800);
...@@ -1775,7 +1783,7 @@ nv50_disp_intr_unk20_2_dp(struct nv50_disp *disp, int head, ...@@ -1775,7 +1783,7 @@ nv50_disp_intr_unk20_2_dp(struct nv50_disp *disp, int head,
} }
if (!bestTU) { if (!bestTU) {
nv_error(disp, "unable to find suitable dp config\n"); nvkm_error(subdev, "unable to find suitable dp config\n");
return; return;
} }
...@@ -1922,11 +1930,12 @@ nv50_disp_intr_supervisor(struct work_struct *work) ...@@ -1922,11 +1930,12 @@ nv50_disp_intr_supervisor(struct work_struct *work)
struct nv50_disp *disp = struct nv50_disp *disp =
container_of(work, struct nv50_disp, supervisor); container_of(work, struct nv50_disp, supervisor);
struct nv50_disp_impl *impl = (void *)nv_object(disp)->oclass; struct nv50_disp_impl *impl = (void *)nv_object(disp)->oclass;
struct nvkm_device *device = disp->base.engine.subdev.device; struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
u32 super = nvkm_rd32(device, 0x610030); u32 super = nvkm_rd32(device, 0x610030);
int head; int head;
nv_debug(disp, "supervisor 0x%08x 0x%08x\n", disp->super, super); nvkm_debug(subdev, "supervisor %08x %08x\n", disp->super, super);
if (disp->super & 0x00000010) { if (disp->super & 0x00000010) {
nv50_disp_mthd_chan(disp, NV_DBG_DEBUG, 0, impl->mthd.core); nv50_disp_mthd_chan(disp, NV_DBG_DEBUG, 0, impl->mthd.core);
......
...@@ -52,7 +52,7 @@ struct nvkm_output_impl { ...@@ -52,7 +52,7 @@ struct nvkm_output_impl {
#ifndef MSG #ifndef MSG
#define MSG(l,f,a...) do { \ #define MSG(l,f,a...) do { \
struct nvkm_output *_outp = (void *)outp; \ struct nvkm_output *_outp = (void *)outp; \
nv_##l(_outp, "%02x:%04x:%04x: "f, _outp->index, \ nvkm_##l(&nvkm_disp(_outp)->engine.subdev, "%02x:%04x:%04x: "f, _outp->index, \
_outp->info.hasht, _outp->info.hashm, ##a); \ _outp->info.hasht, _outp->info.hashm, ##a); \
} while(0) } while(0)
#define DBG(f,a...) MSG(debug, f, ##a) #define DBG(f,a...) MSG(debug, f, ##a)
......
...@@ -44,7 +44,6 @@ nv_rdport(void *obj, int head, u16 port) ...@@ -44,7 +44,6 @@ nv_rdport(void *obj, int head, u16 port)
return nvkm_rd08(device, 0x0c0000 + (head * 0x2000) + port); return nvkm_rd08(device, 0x0c0000 + (head * 0x2000) + port);
} }
nv_error(obj, "unknown vga port 0x%04x\n", port);
return 0x00; return 0x00;
} }
...@@ -67,8 +66,7 @@ nv_wrport(void *obj, int head, u16 port, u8 data) ...@@ -67,8 +66,7 @@ nv_wrport(void *obj, int head, u16 port, u8 data)
if (device->card_type < NV_40) if (device->card_type < NV_40)
head = 0; /* CR44 selects head */ head = 0; /* CR44 selects head */
nvkm_wr08(device, 0x0c0000 + (head * 0x2000) + port, data); nvkm_wr08(device, 0x0c0000 + (head * 0x2000) + port, data);
} else }
nv_error(obj, "unknown vga port 0x%04x\n", port);
} }
u8 u8
...@@ -119,7 +117,6 @@ nv_rdvgai(void *obj, int head, u16 port, u8 index) ...@@ -119,7 +117,6 @@ nv_rdvgai(void *obj, int head, u16 port, u8 index)
if (port == 0x03c4) return nv_rdvgas(obj, head, index); if (port == 0x03c4) return nv_rdvgas(obj, head, index);
if (port == 0x03ce) return nv_rdvgag(obj, head, index); if (port == 0x03ce) return nv_rdvgag(obj, head, index);
if (port == 0x03d4) return nv_rdvgac(obj, head, index); if (port == 0x03d4) return nv_rdvgac(obj, head, index);
nv_error(obj, "unknown indexed vga port 0x%04x\n", port);
return 0x00; return 0x00;
} }
...@@ -129,7 +126,6 @@ nv_wrvgai(void *obj, int head, u16 port, u8 index, u8 value) ...@@ -129,7 +126,6 @@ nv_wrvgai(void *obj, int head, u16 port, u8 index, u8 value)
if (port == 0x03c4) nv_wrvgas(obj, head, index, value); if (port == 0x03c4) nv_wrvgas(obj, head, index, value);
else if (port == 0x03ce) nv_wrvgag(obj, head, index, value); else if (port == 0x03ce) nv_wrvgag(obj, head, index, value);
else if (port == 0x03d4) nv_wrvgac(obj, head, index, value); else if (port == 0x03d4) nv_wrvgac(obj, head, index, value);
else nv_error(obj, "unknown indexed vga port 0x%04x\n", port);
} }
bool bool
...@@ -192,7 +188,6 @@ nv_rdvgaowner(void *obj) ...@@ -192,7 +188,6 @@ nv_rdvgaowner(void *obj)
return nv_rdvgac(obj, 0, 0x44); return nv_rdvgac(obj, 0, 0x44);
} }
nv_error(obj, "rdvgaowner after nv4x\n");
return 0x00; return 0x00;
} }
...@@ -213,6 +208,5 @@ nv_wrvgaowner(void *obj, u8 select) ...@@ -213,6 +208,5 @@ nv_wrvgaowner(void *obj, u8 select)
nv_wrvgac(obj, 0, 0x2e, owner); nv_wrvgac(obj, 0, 0x2e, owner);
nv_wrvgac(obj, 0, 0x2e, owner); nv_wrvgac(obj, 0, 0x2e, owner);
} }
} else }
nv_error(obj, "wrvgaowner after nv4x\n");
} }
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