diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2014-05-06 07:56:50 -0400 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2014-05-07 08:01:49 -0400 |
commit | eeb6324dd6668b05192708916f2a4bc463f382ca (patch) | |
tree | e2d2e8760f2af89a0e43febd29e11587b431ea5d | |
parent | 2a1235e53bed8fa111e1c1ee2e7d8d91efa71ebc (diff) |
drm/i915: consider the source max DP lane count too
Even if the panel claims it can support 4 lanes, there's the
possibility that the HW can't, so consider this while selecting the
max lane count.
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 5ca68aa9f237..115662c2f048 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -121,6 +121,22 @@ intel_dp_max_link_bw(struct intel_dp *intel_dp) | |||
121 | return max_link_bw; | 121 | return max_link_bw; |
122 | } | 122 | } |
123 | 123 | ||
124 | static u8 intel_dp_max_lane_count(struct intel_dp *intel_dp) | ||
125 | { | ||
126 | struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); | ||
127 | struct drm_device *dev = intel_dig_port->base.base.dev; | ||
128 | u8 source_max, sink_max; | ||
129 | |||
130 | source_max = 4; | ||
131 | if (HAS_DDI(dev) && intel_dig_port->port == PORT_A && | ||
132 | (intel_dig_port->saved_port_bits & DDI_A_4_LANES) == 0) | ||
133 | source_max = 2; | ||
134 | |||
135 | sink_max = drm_dp_max_lane_count(intel_dp->dpcd); | ||
136 | |||
137 | return min(source_max, sink_max); | ||
138 | } | ||
139 | |||
124 | /* | 140 | /* |
125 | * The units on the numbers in the next two are... bizarre. Examples will | 141 | * The units on the numbers in the next two are... bizarre. Examples will |
126 | * make it clearer; this one parallels an example in the eDP spec. | 142 | * make it clearer; this one parallels an example in the eDP spec. |
@@ -171,7 +187,7 @@ intel_dp_mode_valid(struct drm_connector *connector, | |||
171 | } | 187 | } |
172 | 188 | ||
173 | max_link_clock = drm_dp_bw_code_to_link_rate(intel_dp_max_link_bw(intel_dp)); | 189 | max_link_clock = drm_dp_bw_code_to_link_rate(intel_dp_max_link_bw(intel_dp)); |
174 | max_lanes = drm_dp_max_lane_count(intel_dp->dpcd); | 190 | max_lanes = intel_dp_max_lane_count(intel_dp); |
175 | 191 | ||
176 | max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes); | 192 | max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes); |
177 | mode_rate = intel_dp_link_required(target_clock, 18); | 193 | mode_rate = intel_dp_link_required(target_clock, 18); |
@@ -751,7 +767,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, | |||
751 | struct intel_crtc *intel_crtc = encoder->new_crtc; | 767 | struct intel_crtc *intel_crtc = encoder->new_crtc; |
752 | struct intel_connector *intel_connector = intel_dp->attached_connector; | 768 | struct intel_connector *intel_connector = intel_dp->attached_connector; |
753 | int lane_count, clock; | 769 | int lane_count, clock; |
754 | int max_lane_count = drm_dp_max_lane_count(intel_dp->dpcd); | 770 | int max_lane_count = intel_dp_max_lane_count(intel_dp); |
755 | /* Conveniently, the link BW constants become indices with a shift...*/ | 771 | /* Conveniently, the link BW constants become indices with a shift...*/ |
756 | int max_clock = intel_dp_max_link_bw(intel_dp) >> 3; | 772 | int max_clock = intel_dp_max_link_bw(intel_dp) >> 3; |
757 | int bpp, mode_rate; | 773 | int bpp, mode_rate; |