diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-11-20 23:49:54 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-11-28 18:57:59 -0500 |
commit | bf2c886a857dcf61f2354796a8858a230f2737fa (patch) | |
tree | a7911613780012ab863501d3a2ac633e9d81157e /drivers/gpu/drm/nouveau/core/engine | |
parent | e225f446a0808ce38b124df489d0568c05c3057a (diff) |
drm/nouveau/disp: add support for 10bpc over DisplayPort
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/engine')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/disp/nv50.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c | 9 |
2 files changed, 11 insertions, 5 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; |