@@ -265,17 +265,26 @@ static int intel_dp_mst_update_slots(struct intel_encoder *encoder,
265
265
return 0 ;
266
266
}
267
267
268
+ static bool intel_dp_mst_has_audio (const struct drm_connector_state * conn_state )
269
+ {
270
+ const struct intel_digital_connector_state * intel_conn_state =
271
+ to_intel_digital_connector_state (conn_state );
272
+ struct intel_connector * connector =
273
+ to_intel_connector (conn_state -> connector );
274
+
275
+ if (intel_conn_state -> force_audio == HDMI_AUDIO_AUTO )
276
+ return connector -> port -> has_audio ;
277
+ else
278
+ return intel_conn_state -> force_audio == HDMI_AUDIO_ON ;
279
+ }
280
+
268
281
static int intel_dp_mst_compute_config (struct intel_encoder * encoder ,
269
282
struct intel_crtc_state * pipe_config ,
270
283
struct drm_connector_state * conn_state )
271
284
{
272
285
struct drm_i915_private * dev_priv = to_i915 (encoder -> base .dev );
273
286
struct intel_dp_mst_encoder * intel_mst = enc_to_mst (encoder );
274
287
struct intel_dp * intel_dp = & intel_mst -> primary -> dp ;
275
- struct intel_connector * connector =
276
- to_intel_connector (conn_state -> connector );
277
- struct intel_digital_connector_state * intel_conn_state =
278
- to_intel_digital_connector_state (conn_state );
279
288
const struct drm_display_mode * adjusted_mode =
280
289
& pipe_config -> hw .adjusted_mode ;
281
290
struct link_config_limits limits ;
@@ -287,11 +296,9 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
287
296
pipe_config -> output_format = INTEL_OUTPUT_FORMAT_RGB ;
288
297
pipe_config -> has_pch_encoder = false;
289
298
290
- if (intel_conn_state -> force_audio == HDMI_AUDIO_AUTO )
291
- pipe_config -> has_audio = connector -> port -> has_audio ;
292
- else
293
- pipe_config -> has_audio =
294
- intel_conn_state -> force_audio == HDMI_AUDIO_ON ;
299
+ pipe_config -> has_audio =
300
+ intel_dp_mst_has_audio (conn_state ) &&
301
+ intel_audio_compute_config (encoder , pipe_config , conn_state );
295
302
296
303
/*
297
304
* for MST we always configure max link bw - the spec doesn't
0 commit comments