aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_dp.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-08-03 19:55:44 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-09-20 02:10:24 -0400
commit75a1fccf92ac6703e7cd4d2a2d1d25b87102402b (patch)
treef93d61d0e3cf7c383085236232c43e5772318ba7 /drivers/gpu/drm/nouveau/nouveau_dp.c
parent27a4598737f8b315ba7827cb84578ba38c9b883c (diff)
drm/nouveau/dp: store unencoded link_bw everywhere
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_dp.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_dp.c28
1 files changed, 14 insertions, 14 deletions
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}