[RFC,05/10] drm/i915/config: Add init-time configuration of DP max link rate.

Submitted by Bob Paauwe on April 13, 2015, 8:51 p.m.

Details

Message ID 1428958271-15653-6-git-send-email-bob.j.paauwe@intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Bob Paauwe April 13, 2015, 8:51 p.m.
If the sink does not provide a maximum link rate, then check the
connector configuration before defaulting to the lowest allowed
link rate.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b6944b9..b05ff6d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -129,6 +129,9 @@  static int
 intel_dp_max_link_bw(struct intel_dp  *intel_dp)
 {
 	int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE];
+	int cfg_max_link_bw = DP_LINK_BW_1_62;
+	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+	struct drm_device *dev = intel_dig_port->base.base.dev;
 
 	switch (max_link_bw) {
 	case DP_LINK_BW_1_62:
@@ -136,9 +139,15 @@  intel_dp_max_link_bw(struct intel_dp  *intel_dp)
 	case DP_LINK_BW_5_4:
 		break;
 	default:
-		WARN(1, "invalid max DP link bw val %x, using 1.62Gbps\n",
-		     max_link_bw);
-		max_link_bw = DP_LINK_BW_1_62;
+		intel_config_get_integer(to_i915(dev),
+					 CFG_CONNECTOR,
+					 intel_dp->attached_connector->base.name,
+					 "Maximum DPCD Rate",
+					 &cfg_max_link_bw);
+
+		WARN(1, "invalid max DP link bw val %x, using %x\n",
+		     max_link_bw, cfg_max_link_bw);
+		max_link_bw = cfg_max_link_bw;
 		break;
 	}
 	return max_link_bw;