aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-06-30 20:54:52 -0400
committerBen Skeggs <bskeggs@redhat.com>2014-07-07 22:56:55 -0400
commit0713b4510e62411071b748d786043cdaada56ce5 (patch)
tree54c53a46d0e1ed592a2745564b0a1def6fb587b5 /drivers/gpu
parent028791bb7d662550c7435d38daeb1f0b88ed5b17 (diff)
drm/nouveau/dp: fix required link bandwidth calculations
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nv50.c6
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c6
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c8
3 files changed, 11 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
index 26e962b7e702..2283c442a10d 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
@@ -1516,11 +1516,11 @@ nv50_disp_intr_unk20_2(struct nv50_disp_priv *priv, int head)
1516 } 1516 }
1517 1517
1518 switch ((ctrl & 0x000f0000) >> 16) { 1518 switch ((ctrl & 0x000f0000) >> 16) {
1519 case 6: datarate = pclk * 30 / 8; break; 1519 case 6: datarate = pclk * 30; break;
1520 case 5: datarate = pclk * 24 / 8; break; 1520 case 5: datarate = pclk * 24; break;
1521 case 2: 1521 case 2:
1522 default: 1522 default:
1523 datarate = pclk * 18 / 8; 1523 datarate = pclk * 18;
1524 break; 1524 break;
1525 } 1525 }
1526 1526
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
index 48aa38a87e3f..fa30d8196f35 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
@@ -1159,11 +1159,11 @@ nvd0_disp_intr_unk2_2(struct nv50_disp_priv *priv, int head)
1159 if (outp->info.type == DCB_OUTPUT_DP) { 1159 if (outp->info.type == DCB_OUTPUT_DP) {
1160 u32 sync = nv_rd32(priv, 0x660404 + (head * 0x300)); 1160 u32 sync = nv_rd32(priv, 0x660404 + (head * 0x300));
1161 switch ((sync & 0x000003c0) >> 6) { 1161 switch ((sync & 0x000003c0) >> 6) {
1162 case 6: pclk = pclk * 30 / 8; break; 1162 case 6: pclk = pclk * 30; break;
1163 case 5: pclk = pclk * 24 / 8; break; 1163 case 5: pclk = pclk * 24; break;
1164 case 2: 1164 case 2:
1165 default: 1165 default:
1166 pclk = pclk * 18 / 8; 1166 pclk = pclk * 18;
1167 break; 1167 break;
1168 } 1168 }
1169 1169
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c b/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c
index 52c299c3d300..eb2d7789555d 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c
@@ -34,7 +34,7 @@ nvkm_output_dp_train(struct nvkm_output *base, u32 datarate, bool wait)
34 struct nvkm_output_dp *outp = (void *)base; 34 struct nvkm_output_dp *outp = (void *)base;
35 bool retrain = true; 35 bool retrain = true;
36 u8 link[2], stat[3]; 36 u8 link[2], stat[3];
37 u32 rate; 37 u32 linkrate;
38 int ret, i; 38 int ret, i;
39 39
40 /* check that the link is trained at a high enough rate */ 40 /* check that the link is trained at a high enough rate */
@@ -44,8 +44,10 @@ nvkm_output_dp_train(struct nvkm_output *base, u32 datarate, bool wait)
44 goto done; 44 goto done;
45 } 45 }
46 46
47 rate = link[0] * 27000 * (link[1] & DPCD_LC01_LANE_COUNT_SET); 47 linkrate = link[0] * 27000 * (link[1] & DPCD_LC01_LANE_COUNT_SET);
48 if (rate < ((datarate / 8) * 10)) { 48 linkrate = (linkrate * 8) / 10; /* 8B/10B coding overhead */
49 datarate = (datarate + 9) / 10; /* -> decakilobits */
50 if (linkrate < datarate) {
49 DBG("link not trained at sufficient rate\n"); 51 DBG("link not trained at sufficient rate\n");
50 goto done; 52 goto done;
51 } 53 }