diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-03-19 19:28:00 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-03-26 00:08:20 -0400 |
commit | fc243d7f92d95d961186126efaad36197f133ab1 (patch) | |
tree | 2dcd036eb24e5410d2f70686e533326397f0e55a /drivers/gpu | |
parent | 5ca929b9523bd4b4ce06812fb0d77cafc3043795 (diff) |
drm/nouveau/disp: limit dp capabilities as per dcb
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/disp/dport.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c | 29 |
2 files changed, 36 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/dport.c b/drivers/gpu/drm/nouveau/core/engine/disp/dport.c index 1bd4c63369c1..2aedb4e47d03 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/dport.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/dport.c | |||
@@ -312,6 +312,14 @@ nouveau_dp_train(struct nouveau_disp *disp, const struct nouveau_dp_func *func, | |||
312 | ERR("failed to read DPCD\n"); | 312 | ERR("failed to read DPCD\n"); |
313 | } | 313 | } |
314 | 314 | ||
315 | /* bring capabilities within encoder limits */ | ||
316 | if ((dp->dpcd[2] & 0x1f) > dp->outp->dpconf.link_nr) { | ||
317 | dp->dpcd[2] &= ~0x1f; | ||
318 | dp->dpcd[2] |= dp->outp->dpconf.link_nr; | ||
319 | } | ||
320 | if (dp->dpcd[1] > dp->outp->dpconf.link_bw) | ||
321 | dp->dpcd[1] = dp->outp->dpconf.link_bw; | ||
322 | |||
315 | /* adjust required bandwidth for 8B/10B coding overhead */ | 323 | /* adjust required bandwidth for 8B/10B coding overhead */ |
316 | datarate = (datarate / 8) * 10; | 324 | datarate = (datarate / 8) * 10; |
317 | 325 | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c b/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c index 2d9b9d7a7992..88606bfaf847 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c | |||
@@ -142,9 +142,36 @@ dcb_outp_parse(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len, | |||
142 | if (*ver >= 0x40) { | 142 | if (*ver >= 0x40) { |
143 | u32 conf = nv_ro32(bios, dcb + 0x04); | 143 | u32 conf = nv_ro32(bios, dcb + 0x04); |
144 | switch (outp->type) { | 144 | switch (outp->type) { |
145 | case DCB_OUTPUT_DP: | ||
146 | switch (conf & 0x00e00000) { | ||
147 | case 0x00000000: | ||
148 | outp->dpconf.link_bw = 0x06; | ||
149 | break; | ||
150 | case 0x00200000: | ||
151 | outp->dpconf.link_bw = 0x0a; | ||
152 | break; | ||
153 | case 0x00400000: | ||
154 | default: | ||
155 | outp->dpconf.link_bw = 0x14; | ||
156 | break; | ||
157 | } | ||
158 | |||
159 | switch (conf & 0x0f000000) { | ||
160 | case 0x0f000000: | ||
161 | outp->dpconf.link_nr = 4; | ||
162 | break; | ||
163 | case 0x03000000: | ||
164 | outp->dpconf.link_nr = 2; | ||
165 | break; | ||
166 | case 0x01000000: | ||
167 | default: | ||
168 | outp->dpconf.link_nr = 1; | ||
169 | break; | ||
170 | } | ||
171 | |||
172 | /* fall-through... */ | ||
145 | case DCB_OUTPUT_TMDS: | 173 | case DCB_OUTPUT_TMDS: |
146 | case DCB_OUTPUT_LVDS: | 174 | case DCB_OUTPUT_LVDS: |
147 | case DCB_OUTPUT_DP: | ||
148 | outp->link = (conf & 0x00000030) >> 4; | 175 | outp->link = (conf & 0x00000030) >> 4; |
149 | outp->sorconf.link = outp->link; /*XXX*/ | 176 | outp->sorconf.link = outp->link; /*XXX*/ |
150 | outp->extdev = 0x00; | 177 | outp->extdev = 0x00; |