aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_display.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-07-01 01:51:49 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-09-20 02:09:42 -0400
commit46959b7790e3609e795c3b5e70e58dcd22c9e207 (patch)
tree0f287b3800a232ce45684a84c2fadee21154a3d4 /drivers/gpu/drm/nouveau/nv50_display.c
parent43720133888f3713b534aec520783498f1bf5db3 (diff)
drm/nouveau/dp: remove reliance on vbios for native displayport
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_display.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c39
1 files changed, 7 insertions, 32 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index 8260303c2fca..d23ca00e7d62 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -702,37 +702,6 @@ ack:
702} 702}
703 703
704static void 704static void
705nv50_display_unk20_dp_hack(struct drm_device *dev, struct dcb_entry *dcb)
706{
707 int or = ffs(dcb->or) - 1, link = !(dcb->dpconf.sor.link & 1);
708 struct drm_encoder *encoder;
709 uint32_t tmp, unk0 = 0, unk1 = 0;
710
711 if (dcb->type != OUTPUT_DP)
712 return;
713
714 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
715 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
716
717 if (nv_encoder->dcb == dcb) {
718 unk0 = nv_encoder->dp.unk0;
719 unk1 = nv_encoder->dp.unk1;
720 break;
721 }
722 }
723
724 if (unk0 || unk1) {
725 tmp = nv_rd32(dev, NV50_SOR_DP_CTRL(or, link));
726 tmp &= 0xfffffe03;
727 nv_wr32(dev, NV50_SOR_DP_CTRL(or, link), tmp | unk0);
728
729 tmp = nv_rd32(dev, NV50_SOR_DP_UNK128(or, link));
730 tmp &= 0xfef080c0;
731 nv_wr32(dev, NV50_SOR_DP_UNK128(or, link), tmp | unk1);
732 }
733}
734
735static void
736nv50_display_unk20_handler(struct drm_device *dev) 705nv50_display_unk20_handler(struct drm_device *dev)
737{ 706{
738 struct drm_nouveau_private *dev_priv = dev->dev_private; 707 struct drm_nouveau_private *dev_priv = dev->dev_private;
@@ -830,7 +799,13 @@ nv50_display_unk20_handler(struct drm_device *dev)
830 script = nv50_display_script_select(dev, dcb, mc, pclk); 799 script = nv50_display_script_select(dev, dcb, mc, pclk);
831 nouveau_bios_run_display_table(dev, script, pclk, dcb, -1); 800 nouveau_bios_run_display_table(dev, script, pclk, dcb, -1);
832 801
833 nv50_display_unk20_dp_hack(dev, dcb); 802 if (type == OUTPUT_DP) {
803 int link = !(dcb->dpconf.sor.link & 1);
804 if ((mc & 0x000f0000) == 0x00020000)
805 nouveau_dp_tu_update(dev, or, link, pclk, 18);
806 else
807 nouveau_dp_tu_update(dev, or, link, pclk, 24);
808 }
834 809
835 if (dcb->type != OUTPUT_ANALOG) { 810 if (dcb->type != OUTPUT_ANALOG) {
836 tmp = nv_rd32(dev, NV50_PDISPLAY_SOR_CLK_CTRL2(or)); 811 tmp = nv_rd32(dev, NV50_PDISPLAY_SOR_CLK_CTRL2(or));