aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c9
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c7
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_dp.c28
3 files changed, 24 insertions, 20 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index b6efa8c7cdbf..bea5df7cf93c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -6199,7 +6199,14 @@ parse_dcb20_entry(struct drm_device *dev, struct dcb_table *dcb,
6199 } 6199 }
6200 case OUTPUT_DP: 6200 case OUTPUT_DP:
6201 entry->dpconf.sor.link = (conf & 0x00000030) >> 4; 6201 entry->dpconf.sor.link = (conf & 0x00000030) >> 4;
6202 entry->dpconf.link_bw = (conf & 0x00e00000) >> 21; 6202 switch ((conf & 0x00e00000) >> 21) {
6203 case 0:
6204 entry->dpconf.link_bw = 162000;
6205 break;
6206 default:
6207 entry->dpconf.link_bw = 270000;
6208 break;
6209 }
6203 switch ((conf & 0x0f000000) >> 24) { 6210 switch ((conf & 0x0f000000) >> 24) {
6204 case 0xf: 6211 case 0xf:
6205 entry->dpconf.link_nr = 4; 6212 entry->dpconf.link_nr = 4;
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 5308024ce56a..e0d275e1c96c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -708,11 +708,8 @@ nouveau_connector_mode_valid(struct drm_connector *connector,
708 case OUTPUT_TV: 708 case OUTPUT_TV:
709 return get_slave_funcs(encoder)->mode_valid(encoder, mode); 709 return get_slave_funcs(encoder)->mode_valid(encoder, mode);
710 case OUTPUT_DP: 710 case OUTPUT_DP:
711 if (nv_encoder->dp.link_bw == DP_LINK_BW_2_7) 711 max_clock = nv_encoder->dp.link_nr;
712 max_clock = nv_encoder->dp.link_nr * 270000; 712 max_clock *= nv_encoder->dp.link_bw;
713 else
714 max_clock = nv_encoder->dp.link_nr * 162000;
715
716 clock = clock * nouveau_connector_bpp(connector) / 8; 713 clock = clock * nouveau_connector_bpp(connector) / 8;
717 break; 714 break;
718 default: 715 default:
diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c b/drivers/gpu/drm/nouveau/nouveau_dp.c
index 726d0ac63b9b..47bd3ada6a3b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dp.c
+++ b/drivers/gpu/drm/nouveau/nouveau_dp.c
@@ -516,7 +516,7 @@ nouveau_dp_link_train(struct drm_encoder *encoder, u32 datarate)
516 nouveau_bios_run_init_table(dev, ROM16(bios[6]), dp.dcb, dp.crtc); 516 nouveau_bios_run_init_table(dev, ROM16(bios[6]), dp.dcb, dp.crtc);
517 517
518 /* start off at highest link rate supported by encoder and display */ 518 /* start off at highest link rate supported by encoder and display */
519 if (nv_encoder->dp.link_bw == DP_LINK_BW_1_62) 519 while (*link_bw > nv_encoder->dp.link_bw)
520 link_bw++; 520 link_bw++;
521 521
522 while (link_bw[0]) { 522 while (link_bw[0]) {
@@ -566,24 +566,24 @@ nouveau_dp_detect(struct drm_encoder *encoder)
566 if (ret) 566 if (ret)
567 return false; 567 return false;
568 568
569 NV_DEBUG_KMS(dev, "encoder: link_bw %d, link_nr %d\n"
570 "display: link_bw %d, link_nr %d version 0x%02x\n",
571 nv_encoder->dcb->dpconf.link_bw,
572 nv_encoder->dcb->dpconf.link_nr,
573 dpcd[1], dpcd[2] & 0x0f, dpcd[0]);
574
575 nv_encoder->dp.dpcd_version = dpcd[0]; 569 nv_encoder->dp.dpcd_version = dpcd[0];
570 nv_encoder->dp.link_bw = 27000 * dpcd[1];
571 nv_encoder->dp.link_nr = dpcd[2] & DP_MAX_LANE_COUNT_MASK;
572 nv_encoder->dp.enhanced_frame = dpcd[2] & DP_ENHANCED_FRAME_CAP;
576 573
577 nv_encoder->dp.link_bw = dpcd[1]; 574 NV_DEBUG_KMS(dev, "display: %dx%d dpcd 0x%02x\n",
578 if (nv_encoder->dp.link_bw != DP_LINK_BW_1_62 && 575 nv_encoder->dp.link_nr, nv_encoder->dp.link_bw, dpcd[0]);
579 !nv_encoder->dcb->dpconf.link_bw) 576 NV_DEBUG_KMS(dev, "encoder: %dx%d\n",
580 nv_encoder->dp.link_bw = DP_LINK_BW_1_62; 577 nv_encoder->dcb->dpconf.link_nr,
578 nv_encoder->dcb->dpconf.link_bw);
581 579
582 nv_encoder->dp.link_nr = dpcd[2] & DP_MAX_LANE_COUNT_MASK; 580 if (nv_encoder->dcb->dpconf.link_nr < nv_encoder->dp.link_nr)
583 if (nv_encoder->dp.link_nr > nv_encoder->dcb->dpconf.link_nr)
584 nv_encoder->dp.link_nr = nv_encoder->dcb->dpconf.link_nr; 581 nv_encoder->dp.link_nr = nv_encoder->dcb->dpconf.link_nr;
582 if (nv_encoder->dcb->dpconf.link_bw < nv_encoder->dp.link_bw)
583 nv_encoder->dp.link_bw = nv_encoder->dcb->dpconf.link_bw;
585 584
586 nv_encoder->dp.enhanced_frame = (dpcd[2] & DP_ENHANCED_FRAME_CAP); 585 NV_DEBUG_KMS(dev, "maximum: %dx%d\n",
586 nv_encoder->dp.link_nr, nv_encoder->dp.link_bw);
587 587
588 return true; 588 return true;
589} 589}