@@ -1297,13 +1297,28 @@ static bool intel_sdvo_limited_color_range(struct intel_encoder *encoder,
1297
1297
return intel_hdmi_limited_color_range (crtc_state , conn_state );
1298
1298
}
1299
1299
1300
+ static bool intel_sdvo_has_audio (struct intel_encoder * encoder ,
1301
+ const struct intel_crtc_state * crtc_state ,
1302
+ const struct drm_connector_state * conn_state )
1303
+ {
1304
+ struct intel_sdvo * intel_sdvo = to_sdvo (encoder );
1305
+ const struct intel_digital_connector_state * intel_conn_state =
1306
+ to_intel_digital_connector_state (conn_state );
1307
+
1308
+ if (!crtc_state -> has_hdmi_sink )
1309
+ return false;
1310
+
1311
+ if (intel_conn_state -> force_audio == HDMI_AUDIO_AUTO )
1312
+ return intel_sdvo -> has_hdmi_audio ;
1313
+ else
1314
+ return intel_conn_state -> force_audio == HDMI_AUDIO_ON ;
1315
+ }
1316
+
1300
1317
static int intel_sdvo_compute_config (struct intel_encoder * encoder ,
1301
1318
struct intel_crtc_state * pipe_config ,
1302
1319
struct drm_connector_state * conn_state )
1303
1320
{
1304
1321
struct intel_sdvo * intel_sdvo = to_sdvo (encoder );
1305
- struct intel_sdvo_connector_state * intel_sdvo_state =
1306
- to_intel_sdvo_connector_state (conn_state );
1307
1322
struct intel_sdvo_connector * intel_sdvo_connector =
1308
1323
to_intel_sdvo_connector (conn_state -> connector );
1309
1324
struct drm_display_mode * adjusted_mode = & pipe_config -> hw .adjusted_mode ;
@@ -1362,13 +1377,7 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
1362
1377
1363
1378
pipe_config -> has_hdmi_sink = intel_has_hdmi_sink (intel_sdvo , conn_state );
1364
1379
1365
- if (pipe_config -> has_hdmi_sink ) {
1366
- if (intel_sdvo_state -> base .force_audio == HDMI_AUDIO_AUTO )
1367
- pipe_config -> has_audio = intel_sdvo -> has_hdmi_audio ;
1368
- else
1369
- pipe_config -> has_audio =
1370
- intel_sdvo_state -> base .force_audio == HDMI_AUDIO_ON ;
1371
- }
1380
+ pipe_config -> has_audio = intel_sdvo_has_audio (encoder , pipe_config , conn_state );
1372
1381
1373
1382
pipe_config -> limited_color_range =
1374
1383
intel_sdvo_limited_color_range (encoder , pipe_config ,
0 commit comments