@@ -172,10 +172,28 @@ int intel_dp_link_symbol_clock(int rate)
172
172
173
173
static int max_dprx_rate (struct intel_dp * intel_dp )
174
174
{
175
+ struct intel_display * display = to_intel_display (intel_dp );
176
+ struct intel_encoder * encoder = & dp_to_dig_port (intel_dp )-> base ;
177
+ int max_rate ;
178
+
175
179
if (intel_dp_tunnel_bw_alloc_is_enabled (intel_dp ))
176
- return drm_dp_tunnel_max_dprx_rate (intel_dp -> tunnel );
180
+ max_rate = drm_dp_tunnel_max_dprx_rate (intel_dp -> tunnel );
181
+ else
182
+ max_rate = drm_dp_bw_code_to_link_rate (intel_dp -> dpcd [DP_MAX_LINK_RATE ]);
177
183
178
- return drm_dp_bw_code_to_link_rate (intel_dp -> dpcd [DP_MAX_LINK_RATE ]);
184
+ /*
185
+ * Some broken eDP sinks illegally declare support for
186
+ * HBR3 without TPS4, and are unable to produce a stable
187
+ * output. Reject HBR3 when TPS4 is not available.
188
+ */
189
+ if (max_rate >= 810000 && !drm_dp_tps4_supported (intel_dp -> dpcd )) {
190
+ drm_dbg_kms (display -> drm ,
191
+ "[ENCODER:%d:%s] Rejecting HBR3 due to missing TPS4 support\n" ,
192
+ encoder -> base .base .id , encoder -> base .name );
193
+ max_rate = 540000 ;
194
+ }
195
+
196
+ return max_rate ;
179
197
}
180
198
181
199
static int max_dprx_lane_count (struct intel_dp * intel_dp )
@@ -4170,6 +4188,9 @@ static void intel_edp_mso_init(struct intel_dp *intel_dp)
4170
4188
static void
4171
4189
intel_edp_set_sink_rates (struct intel_dp * intel_dp )
4172
4190
{
4191
+ struct intel_display * display = to_intel_display (intel_dp );
4192
+ struct intel_encoder * encoder = & dp_to_dig_port (intel_dp )-> base ;
4193
+
4173
4194
intel_dp -> num_sink_rates = 0 ;
4174
4195
4175
4196
if (intel_dp -> edp_dpcd [0 ] >= DP_EDP_14 ) {
@@ -4180,18 +4201,32 @@ intel_edp_set_sink_rates(struct intel_dp *intel_dp)
4180
4201
sink_rates , sizeof (sink_rates ));
4181
4202
4182
4203
for (i = 0 ; i < ARRAY_SIZE (sink_rates ); i ++ ) {
4183
- int val = le16_to_cpu (sink_rates [i ]);
4184
-
4185
- if (val == 0 )
4186
- break ;
4204
+ int rate ;
4187
4205
4188
4206
/* Value read multiplied by 200kHz gives the per-lane
4189
4207
* link rate in kHz. The source rates are, however,
4190
4208
* stored in terms of LS_Clk kHz. The full conversion
4191
4209
* back to symbols is
4192
4210
* (val * 200kHz)*(8/10 ch. encoding)*(1/8 bit to Byte)
4193
4211
*/
4194
- intel_dp -> sink_rates [i ] = (val * 200 ) / 10 ;
4212
+ rate = le16_to_cpu (sink_rates [i ]) * 200 / 10 ;
4213
+
4214
+ if (rate == 0 )
4215
+ break ;
4216
+
4217
+ /*
4218
+ * Some broken eDP sinks illegally declare support for
4219
+ * HBR3 without TPS4, and are unable to produce a stable
4220
+ * output. Reject HBR3 when TPS4 is not available.
4221
+ */
4222
+ if (rate >= 810000 && !drm_dp_tps4_supported (intel_dp -> dpcd )) {
4223
+ drm_dbg_kms (display -> drm ,
4224
+ "[ENCODER:%d:%s] Rejecting HBR3 due to missing TPS4 support\n" ,
4225
+ encoder -> base .base .id , encoder -> base .name );
4226
+ break ;
4227
+ }
4228
+
4229
+ intel_dp -> sink_rates [i ] = rate ;
4195
4230
}
4196
4231
intel_dp -> num_sink_rates = i ;
4197
4232
}
0 commit comments