aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nv50.c7
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c9
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c6
3 files changed, 16 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
index c9cfd02f94a..c6f80055e98 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
@@ -973,7 +973,6 @@ nv50_disp_intr_unk20_dp(struct nv50_disp_priv *priv,
973 const u32 soff = ( or * 0x800); 973 const u32 soff = ( or * 0x800);
974 const u32 loff = (link * 0x080) + soff; 974 const u32 loff = (link * 0x080) + soff;
975 const u32 ctrl = nv_rd32(priv, 0x610794 + (or * 8)); 975 const u32 ctrl = nv_rd32(priv, 0x610794 + (or * 8));
976 const u32 bits = ((ctrl & 0x000f0000) == 0x00020000) ? 18 : 24;
977 const u32 symbol = 100000; 976 const u32 symbol = 100000;
978 u32 dpctrl = nv_rd32(priv, 0x61c10c + loff) & 0x0000f0000; 977 u32 dpctrl = nv_rd32(priv, 0x61c10c + loff) & 0x0000f0000;
979 u32 clksor = nv_rd32(priv, 0x614300 + soff); 978 u32 clksor = nv_rd32(priv, 0x614300 + soff);
@@ -981,7 +980,7 @@ nv50_disp_intr_unk20_dp(struct nv50_disp_priv *priv,
981 int TU, VTUi, VTUf, VTUa; 980 int TU, VTUi, VTUf, VTUa;
982 u64 link_data_rate, link_ratio, unk; 981 u64 link_data_rate, link_ratio, unk;
983 u32 best_diff = 64 * symbol; 982 u32 best_diff = 64 * symbol;
984 u32 link_nr, link_bw, r; 983 u32 link_nr, link_bw, bits, r;
985 984
986 /* calculate packed data rate for each lane */ 985 /* calculate packed data rate for each lane */
987 if (dpctrl > 0x00030000) link_nr = 4; 986 if (dpctrl > 0x00030000) link_nr = 4;
@@ -993,6 +992,10 @@ nv50_disp_intr_unk20_dp(struct nv50_disp_priv *priv,
993 else 992 else
994 link_bw = 162000; 993 link_bw = 162000;
995 994
995 if ((ctrl & 0xf0000) == 0x60000) bits = 30;
996 else if ((ctrl & 0xf0000) == 0x50000) bits = 24;
997 else bits = 18;
998
996 link_data_rate = (pclk * bits / 8) / link_nr; 999 link_data_rate = (pclk * bits / 8) / link_nr;
997 1000
998 /* calculate ratio of packed data rate to link symbol rate */ 1001 /* calculate ratio of packed data rate to link symbol rate */
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
index 24bcbc6a88b..9e38ebff5fb 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
@@ -711,7 +711,6 @@ nvd0_display_unk2_calc_tu(struct nv50_disp_priv *priv, int head, int or)
711 const u32 ctrl = nv_rd32(priv, 0x660200 + (or * 0x020)); 711 const u32 ctrl = nv_rd32(priv, 0x660200 + (or * 0x020));
712 const u32 conf = nv_rd32(priv, 0x660404 + (head * 0x300)); 712 const u32 conf = nv_rd32(priv, 0x660404 + (head * 0x300));
713 const u32 pclk = nv_rd32(priv, 0x660450 + (head * 0x300)) / 1000; 713 const u32 pclk = nv_rd32(priv, 0x660450 + (head * 0x300)) / 1000;
714 const u32 bits = ((conf & 0x3c0) == 0x080) ? 18 : 24;
715 const u32 link = ((ctrl & 0xf00) == 0x800) ? 0 : 1; 714 const u32 link = ((ctrl & 0xf00) == 0x800) ? 0 : 1;
716 const u32 hoff = (head * 0x800); 715 const u32 hoff = (head * 0x800);
717 const u32 soff = ( or * 0x800); 716 const u32 soff = ( or * 0x800);
@@ -720,10 +719,14 @@ nvd0_display_unk2_calc_tu(struct nv50_disp_priv *priv, int head, int or)
720 const u32 TU = 64; 719 const u32 TU = 64;
721 u32 dpctrl = nv_rd32(priv, 0x61c10c + loff) & 0x000f0000; 720 u32 dpctrl = nv_rd32(priv, 0x61c10c + loff) & 0x000f0000;
722 u32 clksor = nv_rd32(priv, 0x612300 + soff); 721 u32 clksor = nv_rd32(priv, 0x612300 + soff);
723 u32 datarate = (pclk * bits) / 8; 722 u32 datarate, link_nr, link_bw, bits;
724 u32 link_nr, link_bw;
725 u64 ratio, value; 723 u64 ratio, value;
726 724
725 if ((conf & 0x3c0) == 0x180) bits = 30;
726 else if ((conf & 0x3c0) == 0x140) bits = 24;
727 else bits = 18;
728 datarate = (pclk * bits) / 8;
729
727 if (dpctrl > 0x00030000) link_nr = 4; 730 if (dpctrl > 0x00030000) link_nr = 4;
728 else if (dpctrl > 0x00010000) link_nr = 2; 731 else if (dpctrl > 0x00010000) link_nr = 2;
729 else link_nr = 1; 732 else link_nr = 1;
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index 7c77b282d81..b252dbe0f4e 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -1791,9 +1791,13 @@ nv50_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
1791 if (nv_connector->base.display_info.bpc == 6) { 1791 if (nv_connector->base.display_info.bpc == 6) {
1792 nv_encoder->dp.datarate = mode->clock * 18 / 8; 1792 nv_encoder->dp.datarate = mode->clock * 18 / 8;
1793 depth = 0x2; 1793 depth = 0x2;
1794 } else { 1794 } else
1795 if (nv_connector->base.display_info.bpc == 8) {
1795 nv_encoder->dp.datarate = mode->clock * 24 / 8; 1796 nv_encoder->dp.datarate = mode->clock * 24 / 8;
1796 depth = 0x5; 1797 depth = 0x5;
1798 } else {
1799 nv_encoder->dp.datarate = mode->clock * 30 / 8;
1800 depth = 0x6;
1797 } 1801 }
1798 1802
1799 if (nv_encoder->dcb->sorconf.link & 1) 1803 if (nv_encoder->dcb->sorconf.link & 1)