drm/nouveau/mxm: switch to subdev printk macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
85ae830f5a
commit
27cc60a175
@ -78,7 +78,8 @@ mxm_shadow_rom(struct nvkm_mxm *mxm, u8 version)
|
|||||||
static bool
|
static bool
|
||||||
mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version)
|
mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version)
|
||||||
{
|
{
|
||||||
struct nvkm_device *device = nv_device(mxm);
|
struct nvkm_subdev *subdev = &mxm->subdev;
|
||||||
|
struct nvkm_device *device = subdev->device;
|
||||||
static char muid[] = {
|
static char muid[] = {
|
||||||
0x00, 0xA4, 0x04, 0x40, 0x7D, 0x91, 0xF2, 0x4C,
|
0x00, 0xA4, 0x04, 0x40, 0x7D, 0x91, 0xF2, 0x4C,
|
||||||
0xB8, 0x9C, 0x79, 0xB6, 0x2F, 0xD5, 0x56, 0x65
|
0xB8, 0x9C, 0x79, 0xB6, 0x2F, 0xD5, 0x56, 0x65
|
||||||
@ -105,7 +106,7 @@ mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version)
|
|||||||
rev = (version & 0xf0) << 4 | (version & 0x0f);
|
rev = (version & 0xf0) << 4 | (version & 0x0f);
|
||||||
obj = acpi_evaluate_dsm(handle, muid, rev, 0x00000010, &argv4);
|
obj = acpi_evaluate_dsm(handle, muid, rev, 0x00000010, &argv4);
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
nv_debug(mxm, "DSM MXMS failed\n");
|
nvkm_debug(subdev, "DSM MXMS failed\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +114,8 @@ mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version)
|
|||||||
mxm->mxms = kmemdup(obj->buffer.pointer,
|
mxm->mxms = kmemdup(obj->buffer.pointer,
|
||||||
obj->buffer.length, GFP_KERNEL);
|
obj->buffer.length, GFP_KERNEL);
|
||||||
} else if (obj->type == ACPI_TYPE_INTEGER) {
|
} else if (obj->type == ACPI_TYPE_INTEGER) {
|
||||||
nv_debug(mxm, "DSM MXMS returned 0x%llx\n", obj->integer.value);
|
nvkm_debug(subdev, "DSM MXMS returned 0x%llx\n",
|
||||||
|
obj->integer.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
ACPI_FREE(obj);
|
ACPI_FREE(obj);
|
||||||
@ -128,6 +130,7 @@ mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version)
|
|||||||
static u8
|
static u8
|
||||||
wmi_wmmx_mxmi(struct nvkm_mxm *mxm, u8 version)
|
wmi_wmmx_mxmi(struct nvkm_mxm *mxm, u8 version)
|
||||||
{
|
{
|
||||||
|
struct nvkm_subdev *subdev = &mxm->subdev;
|
||||||
u32 mxmi_args[] = { 0x494D584D /* MXMI */, version, 0 };
|
u32 mxmi_args[] = { 0x494D584D /* MXMI */, version, 0 };
|
||||||
struct acpi_buffer args = { sizeof(mxmi_args), mxmi_args };
|
struct acpi_buffer args = { sizeof(mxmi_args), mxmi_args };
|
||||||
struct acpi_buffer retn = { ACPI_ALLOCATE_BUFFER, NULL };
|
struct acpi_buffer retn = { ACPI_ALLOCATE_BUFFER, NULL };
|
||||||
@ -136,18 +139,18 @@ wmi_wmmx_mxmi(struct nvkm_mxm *mxm, u8 version)
|
|||||||
|
|
||||||
status = wmi_evaluate_method(WMI_WMMX_GUID, 0, 0, &args, &retn);
|
status = wmi_evaluate_method(WMI_WMMX_GUID, 0, 0, &args, &retn);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
nv_debug(mxm, "WMMX MXMI returned %d\n", status);
|
nvkm_debug(subdev, "WMMX MXMI returned %d\n", status);
|
||||||
return 0x00;
|
return 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
obj = retn.pointer;
|
obj = retn.pointer;
|
||||||
if (obj->type == ACPI_TYPE_INTEGER) {
|
if (obj->type == ACPI_TYPE_INTEGER) {
|
||||||
version = obj->integer.value;
|
version = obj->integer.value;
|
||||||
nv_debug(mxm, "WMMX MXMI version %d.%d\n",
|
nvkm_debug(subdev, "WMMX MXMI version %d.%d\n",
|
||||||
(version >> 4), version & 0x0f);
|
(version >> 4), version & 0x0f);
|
||||||
} else {
|
} else {
|
||||||
version = 0;
|
version = 0;
|
||||||
nv_debug(mxm, "WMMX MXMI returned non-integer\n");
|
nvkm_debug(subdev, "WMMX MXMI returned non-integer\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
@ -157,6 +160,7 @@ wmi_wmmx_mxmi(struct nvkm_mxm *mxm, u8 version)
|
|||||||
static bool
|
static bool
|
||||||
mxm_shadow_wmi(struct nvkm_mxm *mxm, u8 version)
|
mxm_shadow_wmi(struct nvkm_mxm *mxm, u8 version)
|
||||||
{
|
{
|
||||||
|
struct nvkm_subdev *subdev = &mxm->subdev;
|
||||||
u32 mxms_args[] = { 0x534D584D /* MXMS */, version, 0 };
|
u32 mxms_args[] = { 0x534D584D /* MXMS */, version, 0 };
|
||||||
struct acpi_buffer args = { sizeof(mxms_args), mxms_args };
|
struct acpi_buffer args = { sizeof(mxms_args), mxms_args };
|
||||||
struct acpi_buffer retn = { ACPI_ALLOCATE_BUFFER, NULL };
|
struct acpi_buffer retn = { ACPI_ALLOCATE_BUFFER, NULL };
|
||||||
@ -164,7 +168,7 @@ mxm_shadow_wmi(struct nvkm_mxm *mxm, u8 version)
|
|||||||
acpi_status status;
|
acpi_status status;
|
||||||
|
|
||||||
if (!wmi_has_guid(WMI_WMMX_GUID)) {
|
if (!wmi_has_guid(WMI_WMMX_GUID)) {
|
||||||
nv_debug(mxm, "WMMX GUID not found\n");
|
nvkm_debug(subdev, "WMMX GUID not found\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +180,7 @@ mxm_shadow_wmi(struct nvkm_mxm *mxm, u8 version)
|
|||||||
|
|
||||||
status = wmi_evaluate_method(WMI_WMMX_GUID, 0, 0, &args, &retn);
|
status = wmi_evaluate_method(WMI_WMMX_GUID, 0, 0, &args, &retn);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
nv_debug(mxm, "WMMX MXMS returned %d\n", status);
|
nvkm_debug(subdev, "WMMX MXMS returned %d\n", status);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,7 +214,7 @@ mxm_shadow(struct nvkm_mxm *mxm, u8 version)
|
|||||||
{
|
{
|
||||||
struct mxm_shadow_h *shadow = _mxm_shadow;
|
struct mxm_shadow_h *shadow = _mxm_shadow;
|
||||||
do {
|
do {
|
||||||
nv_debug(mxm, "checking %s\n", shadow->name);
|
nvkm_debug(&mxm->subdev, "checking %s\n", shadow->name);
|
||||||
if (shadow->exec(mxm, version)) {
|
if (shadow->exec(mxm, version)) {
|
||||||
if (mxms_valid(mxm))
|
if (mxms_valid(mxm))
|
||||||
return 0;
|
return 0;
|
||||||
@ -240,14 +244,14 @@ nvkm_mxm_create_(struct nvkm_object *parent, struct nvkm_object *engine,
|
|||||||
|
|
||||||
data = mxm_table(bios, &ver, &len);
|
data = mxm_table(bios, &ver, &len);
|
||||||
if (!data || !(ver = nv_ro08(bios, data))) {
|
if (!data || !(ver = nv_ro08(bios, data))) {
|
||||||
nv_debug(mxm, "no VBIOS data, nothing to do\n");
|
nvkm_debug(&mxm->subdev, "no VBIOS data, nothing to do\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nv_info(mxm, "BIOS version %d.%d\n", ver >> 4, ver & 0x0f);
|
nvkm_info(&mxm->subdev, "BIOS version %d.%d\n", ver >> 4, ver & 0x0f);
|
||||||
|
|
||||||
if (mxm_shadow(mxm, ver)) {
|
if (mxm_shadow(mxm, ver)) {
|
||||||
nv_info(mxm, "failed to locate valid SIS\n");
|
nvkm_warn(&mxm->subdev, "failed to locate valid SIS\n");
|
||||||
#if 0
|
#if 0
|
||||||
/* we should, perhaps, fall back to some kind of limited
|
/* we should, perhaps, fall back to some kind of limited
|
||||||
* mode here if the x86 vbios hasn't already done the
|
* mode here if the x86 vbios hasn't already done the
|
||||||
@ -260,8 +264,8 @@ nvkm_mxm_create_(struct nvkm_object *parent, struct nvkm_object *engine,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
nv_info(mxm, "MXMS Version %d.%d\n",
|
nvkm_debug(&mxm->subdev, "MXMS Version %d.%d\n",
|
||||||
mxms_version(mxm) >> 8, mxms_version(mxm) & 0xff);
|
mxms_version(mxm) >> 8, mxms_version(mxm) & 0xff);
|
||||||
mxms_foreach(mxm, 0, NULL, NULL);
|
mxms_foreach(mxm, 0, NULL, NULL);
|
||||||
|
|
||||||
if (nvkm_boolopt(device->cfgopt, "NvMXMDCB", true))
|
if (nvkm_boolopt(device->cfgopt, "NvMXMDCB", true))
|
||||||
|
@ -47,7 +47,7 @@ mxms_version(struct nvkm_mxm *mxm)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nv_debug(mxm, "unknown version %d.%d\n", mxms[4], mxms[5]);
|
nvkm_debug(&mxm->subdev, "unknown version %d.%d\n", mxms[4], mxms[5]);
|
||||||
return 0x0000;
|
return 0x0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ mxms_checksum(struct nvkm_mxm *mxm)
|
|||||||
while (size--)
|
while (size--)
|
||||||
sum += *mxms++;
|
sum += *mxms++;
|
||||||
if (sum) {
|
if (sum) {
|
||||||
nv_debug(mxm, "checksum invalid\n");
|
nvkm_debug(&mxm->subdev, "checksum invalid\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -82,7 +82,7 @@ mxms_valid(struct nvkm_mxm *mxm)
|
|||||||
{
|
{
|
||||||
u8 *mxms = mxms_data(mxm);
|
u8 *mxms = mxms_data(mxm);
|
||||||
if (*(u32 *)mxms != 0x5f4d584d) {
|
if (*(u32 *)mxms != 0x5f4d584d) {
|
||||||
nv_debug(mxm, "signature invalid\n");
|
nvkm_debug(&mxm->subdev, "signature invalid\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,6 +96,7 @@ bool
|
|||||||
mxms_foreach(struct nvkm_mxm *mxm, u8 types,
|
mxms_foreach(struct nvkm_mxm *mxm, u8 types,
|
||||||
bool (*exec)(struct nvkm_mxm *, u8 *, void *), void *info)
|
bool (*exec)(struct nvkm_mxm *, u8 *, void *), void *info)
|
||||||
{
|
{
|
||||||
|
struct nvkm_subdev *subdev = &mxm->subdev;
|
||||||
u8 *mxms = mxms_data(mxm);
|
u8 *mxms = mxms_data(mxm);
|
||||||
u8 *desc = mxms + mxms_headerlen(mxm);
|
u8 *desc = mxms + mxms_headerlen(mxm);
|
||||||
u8 *fini = desc + mxms_structlen(mxm) - 1;
|
u8 *fini = desc + mxms_structlen(mxm) - 1;
|
||||||
@ -140,29 +141,28 @@ mxms_foreach(struct nvkm_mxm *mxm, u8 types,
|
|||||||
entries = desc[1] & 0x07;
|
entries = desc[1] & 0x07;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
nv_debug(mxm, "unknown descriptor type %d\n", type);
|
nvkm_debug(subdev, "unknown descriptor type %d\n", type);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nv_subdev(mxm)->debug >= NV_DBG_DEBUG && (exec == NULL)) {
|
if (nv_subdev(mxm)->debug >= NV_DBG_DEBUG && (exec == NULL)) {
|
||||||
static const char * mxms_desc_name[] = {
|
static const char * mxms_desc[] = {
|
||||||
"ODS", "SCCS", "TS", "IPS",
|
"ODS", "SCCS", "TS", "IPS",
|
||||||
"GSD", "VSS", "BCS", "FCS",
|
"GSD", "VSS", "BCS", "FCS",
|
||||||
};
|
};
|
||||||
u8 *dump = desc;
|
u8 *dump = desc;
|
||||||
|
char data[32], *ptr;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
nv_debug(mxm, "%4s: ", mxms_desc_name[type]);
|
for (j = headerlen - 1, ptr = data; j >= 0; j--)
|
||||||
for (j = headerlen - 1; j >= 0; j--)
|
ptr += sprintf(ptr, "%02x", dump[j]);
|
||||||
pr_cont("%02x", dump[j]);
|
|
||||||
pr_cont("\n");
|
|
||||||
dump += headerlen;
|
dump += headerlen;
|
||||||
|
|
||||||
|
nvkm_debug(subdev, "%4s: %s\n", mxms_desc[type], data);
|
||||||
for (i = 0; i < entries; i++, dump += recordlen) {
|
for (i = 0; i < entries; i++, dump += recordlen) {
|
||||||
nv_debug(mxm, " ");
|
for (j = recordlen - 1, ptr = data; j >= 0; j--)
|
||||||
for (j = recordlen - 1; j >= 0; j--)
|
ptr += sprintf(ptr, "%02x", dump[j]);
|
||||||
pr_cont("%02x", dump[j]);
|
nvkm_debug(subdev, " %s\n", data);
|
||||||
pr_cont("\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,8 +103,8 @@ mxm_dcb_sanitise_entry(struct nvkm_bios *bios, void *data, int idx, u16 pdcb)
|
|||||||
* if one isn't found, disable it.
|
* if one isn't found, disable it.
|
||||||
*/
|
*/
|
||||||
if (mxms_foreach(mxm, 0x01, mxm_match_dcb, &ctx)) {
|
if (mxms_foreach(mxm, 0x01, mxm_match_dcb, &ctx)) {
|
||||||
nv_debug(mxm, "disable %d: 0x%08x 0x%08x\n",
|
nvkm_debug(&mxm->subdev, "disable %d: %08x %08x\n",
|
||||||
idx, ctx.outp[0], ctx.outp[1]);
|
idx, ctx.outp[0], ctx.outp[1]);
|
||||||
ctx.outp[0] |= 0x0000000f;
|
ctx.outp[0] |= 0x0000000f;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -176,20 +176,22 @@ mxm_dcb_sanitise_entry(struct nvkm_bios *bios, void *data, int idx, u16 pdcb)
|
|||||||
static bool
|
static bool
|
||||||
mxm_show_unmatched(struct nvkm_mxm *mxm, u8 *data, void *info)
|
mxm_show_unmatched(struct nvkm_mxm *mxm, u8 *data, void *info)
|
||||||
{
|
{
|
||||||
|
struct nvkm_subdev *subdev = &mxm->subdev;
|
||||||
u64 desc = *(u64 *)data;
|
u64 desc = *(u64 *)data;
|
||||||
if ((desc & 0xf0) != 0xf0)
|
if ((desc & 0xf0) != 0xf0)
|
||||||
nv_info(mxm, "unmatched output device 0x%016llx\n", desc);
|
nvkm_info(subdev, "unmatched output device %016llx\n", desc);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mxm_dcb_sanitise(struct nvkm_mxm *mxm)
|
mxm_dcb_sanitise(struct nvkm_mxm *mxm)
|
||||||
{
|
{
|
||||||
struct nvkm_bios *bios = nvkm_bios(mxm);
|
struct nvkm_subdev *subdev = &mxm->subdev;
|
||||||
|
struct nvkm_bios *bios = subdev->device->bios;
|
||||||
u8 ver, hdr, cnt, len;
|
u8 ver, hdr, cnt, len;
|
||||||
u16 dcb = dcb_table(bios, &ver, &hdr, &cnt, &len);
|
u16 dcb = dcb_table(bios, &ver, &hdr, &cnt, &len);
|
||||||
if (dcb == 0x0000 || ver != 0x40) {
|
if (dcb == 0x0000 || ver != 0x40) {
|
||||||
nv_debug(mxm, "unsupported DCB version\n");
|
nvkm_debug(subdev, "unsupported DCB version\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user