aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2019-05-09 21:57:04 -0400
committerBen Skeggs <bskeggs@redhat.com>2019-05-14 02:58:06 -0400
commit13d03e9daf70dab032c03dc172e75bb98ad899c4 (patch)
treeea35f753043200870bd8a1b5065d737e7020bb41
parente15b682aad77f158e4af51d258ed7398036fdf8d (diff)
drm/nouveau/disp/dp: respect sink limits when selecting failsafe link configuration
Where possible, we want the failsafe link configuration (one which won't hang the OR during modeset because of not enough bandwidth for the mode) to also be supported by the sink. This prevents "link rate unsupported by sink" messages when link training fails. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
index 5f301e632599..818d21bd28d3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
@@ -365,8 +365,15 @@ nvkm_dp_train(struct nvkm_dp *dp, u32 dataKBps)
365 * and it's better to have a failed modeset than that. 365 * and it's better to have a failed modeset than that.
366 */ 366 */
367 for (cfg = nvkm_dp_rates; cfg->rate; cfg++) { 367 for (cfg = nvkm_dp_rates; cfg->rate; cfg++) {
368 if (cfg->nr <= outp_nr && cfg->nr <= outp_bw) 368 if (cfg->nr <= outp_nr && cfg->nr <= outp_bw) {
369 failsafe = cfg; 369 /* Try to respect sink limits too when selecting
370 * lowest link configuration.
371 */
372 if (!failsafe ||
373 (cfg->nr <= sink_nr && cfg->bw <= sink_bw))
374 failsafe = cfg;
375 }
376
370 if (failsafe && cfg[1].rate < dataKBps) 377 if (failsafe && cfg[1].rate < dataKBps)
371 break; 378 break;
372 } 379 }