Commit 65445992 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/dp: support version 4.0 of DP table

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent e592c73b
...@@ -1144,7 +1144,8 @@ init_dp_condition(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) ...@@ -1144,7 +1144,8 @@ init_dp_condition(struct nvbios *bios, uint16_t offset, struct init_exec *iexec)
break; break;
case 1: case 1:
case 2: case 2:
if (!(entry[5] & cond)) if ((table[0] < 0x40 && !(entry[5] & cond)) ||
(table[0] == 0x40 && !(entry[4] & cond)))
iexec->execute = false; iexec->execute = false;
break; break;
case 5: case 5:
......
...@@ -188,6 +188,7 @@ nouveau_dp_bios_data(struct drm_device *dev, struct dcb_entry *dcb, u8 **entry) ...@@ -188,6 +188,7 @@ nouveau_dp_bios_data(struct drm_device *dev, struct dcb_entry *dcb, u8 **entry)
case 0x20: case 0x20:
case 0x21: case 0x21:
case 0x30: case 0x30:
case 0x40:
break; break;
default: default:
NV_ERROR(dev, "displayport table 0x%02x unknown\n", table[0]); NV_ERROR(dev, "displayport table 0x%02x unknown\n", table[0]);
...@@ -366,6 +367,10 @@ dp_set_downspread(struct drm_device *dev, struct dp_state *dp, bool enable) ...@@ -366,6 +367,10 @@ dp_set_downspread(struct drm_device *dev, struct dp_state *dp, bool enable)
if (table[0] >= 0x20 && table[0] <= 0x30) { if (table[0] >= 0x20 && table[0] <= 0x30) {
if (enable) script = ROM16(entry[12]); if (enable) script = ROM16(entry[12]);
else script = ROM16(entry[14]); else script = ROM16(entry[14]);
} else
if (table[0] == 0x40) {
if (enable) script = ROM16(entry[11]);
else script = ROM16(entry[13]);
} }
} }
...@@ -380,6 +385,9 @@ dp_link_train_init(struct drm_device *dev, struct dp_state *dp) ...@@ -380,6 +385,9 @@ dp_link_train_init(struct drm_device *dev, struct dp_state *dp)
if (table) { if (table) {
if (table[0] >= 0x20 && table[0] <= 0x30) if (table[0] >= 0x20 && table[0] <= 0x30)
script = ROM16(entry[6]); script = ROM16(entry[6]);
else
if (table[0] == 0x40)
script = ROM16(entry[5]);
} }
nouveau_bios_run_init_table(dev, script, dp->dcb, dp->crtc); nouveau_bios_run_init_table(dev, script, dp->dcb, dp->crtc);
...@@ -393,6 +401,9 @@ dp_link_train_fini(struct drm_device *dev, struct dp_state *dp) ...@@ -393,6 +401,9 @@ dp_link_train_fini(struct drm_device *dev, struct dp_state *dp)
if (table) { if (table) {
if (table[0] >= 0x20 && table[0] <= 0x30) if (table[0] >= 0x20 && table[0] <= 0x30)
script = ROM16(entry[8]); script = ROM16(entry[8]);
else
if (table[0] == 0x40)
script = ROM16(entry[7]);
} }
nouveau_bios_run_init_table(dev, script, dp->dcb, dp->crtc); nouveau_bios_run_init_table(dev, script, dp->dcb, dp->crtc);
......
...@@ -1226,6 +1226,11 @@ nvd0_sor_dp_train_adj(struct drm_device *dev, struct dcb_entry *dcb, ...@@ -1226,6 +1226,11 @@ nvd0_sor_dp_train_adj(struct drm_device *dev, struct dcb_entry *dcb,
if (table[0] == 0x30) { if (table[0] == 0x30) {
config = entry + table[4]; config = entry + table[4];
config += table[5] * preem; config += table[5] * preem;
} else
if (table[0] == 0x40) {
config = table + table[1];
config += table[2] * table[3];
config += table[6] * preem;
} }
} }
...@@ -1258,6 +1263,7 @@ nvd0_sor_dp_link_set(struct drm_device *dev, struct dcb_entry *dcb, int crtc, ...@@ -1258,6 +1263,7 @@ nvd0_sor_dp_link_set(struct drm_device *dev, struct dcb_entry *dcb, int crtc,
table = nouveau_dp_bios_data(dev, dcb, &entry); table = nouveau_dp_bios_data(dev, dcb, &entry);
if (table) { if (table) {
if (table[0] == 0x30) entry = ROMPTR(dev, entry[10]); if (table[0] == 0x30) entry = ROMPTR(dev, entry[10]);
else if (table[0] == 0x40) entry = ROMPTR(dev, entry[9]);
else entry = NULL; else entry = NULL;
while (entry) { while (entry) {
......
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