Commit 6544599249086ce50f216a6cedbea56514ffefc6

Authored by Ben Skeggs
1 parent e592c73b91

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

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

Showing 3 changed files with 19 additions and 1 deletions Side-by-side Diff

drivers/gpu/drm/nouveau/nouveau_bios.c
... ... @@ -1144,7 +1144,8 @@
1144 1144 break;
1145 1145 case 1:
1146 1146 case 2:
1147   - if (!(entry[5] & cond))
  1147 + if ((table[0] < 0x40 && !(entry[5] & cond)) ||
  1148 + (table[0] == 0x40 && !(entry[4] & cond)))
1148 1149 iexec->execute = false;
1149 1150 break;
1150 1151 case 5:
drivers/gpu/drm/nouveau/nouveau_dp.c
... ... @@ -188,6 +188,7 @@
188 188 case 0x20:
189 189 case 0x21:
190 190 case 0x30:
  191 + case 0x40:
191 192 break;
192 193 default:
193 194 NV_ERROR(dev, "displayport table 0x%02x unknown\n", table[0]);
... ... @@ -366,6 +367,10 @@
366 367 if (table[0] >= 0x20 && table[0] <= 0x30) {
367 368 if (enable) script = ROM16(entry[12]);
368 369 else script = ROM16(entry[14]);
  370 + } else
  371 + if (table[0] == 0x40) {
  372 + if (enable) script = ROM16(entry[11]);
  373 + else script = ROM16(entry[13]);
369 374 }
370 375 }
371 376  
... ... @@ -380,6 +385,9 @@
380 385 if (table) {
381 386 if (table[0] >= 0x20 && table[0] <= 0x30)
382 387 script = ROM16(entry[6]);
  388 + else
  389 + if (table[0] == 0x40)
  390 + script = ROM16(entry[5]);
383 391 }
384 392  
385 393 nouveau_bios_run_init_table(dev, script, dp->dcb, dp->crtc);
... ... @@ -393,6 +401,9 @@
393 401 if (table) {
394 402 if (table[0] >= 0x20 && table[0] <= 0x30)
395 403 script = ROM16(entry[8]);
  404 + else
  405 + if (table[0] == 0x40)
  406 + script = ROM16(entry[7]);
396 407 }
397 408  
398 409 nouveau_bios_run_init_table(dev, script, dp->dcb, dp->crtc);
drivers/gpu/drm/nouveau/nvd0_display.c
... ... @@ -1226,6 +1226,11 @@
1226 1226 if (table[0] == 0x30) {
1227 1227 config = entry + table[4];
1228 1228 config += table[5] * preem;
  1229 + } else
  1230 + if (table[0] == 0x40) {
  1231 + config = table + table[1];
  1232 + config += table[2] * table[3];
  1233 + config += table[6] * preem;
1229 1234 }
1230 1235 }
1231 1236  
... ... @@ -1258,6 +1263,7 @@
1258 1263 table = nouveau_dp_bios_data(dev, dcb, &entry);
1259 1264 if (table) {
1260 1265 if (table[0] == 0x30) entry = ROMPTR(dev, entry[10]);
  1266 + else if (table[0] == 0x40) entry = ROMPTR(dev, entry[9]);
1261 1267 else entry = NULL;
1262 1268  
1263 1269 while (entry) {