Commit 7726e72b authored by Alex Deucher's avatar Alex Deucher

drm/radeon: rework audio modeset to handle non-audio hdmi features

Need to setup the deep color and avi packets regardless of
audio setup.
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d0ea397e
...@@ -2299,8 +2299,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, ...@@ -2299,8 +2299,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
encoder_mode = atombios_get_encoder_mode(encoder); encoder_mode = atombios_get_encoder_mode(encoder);
if (connector && (radeon_audio != 0) && if (connector && (radeon_audio != 0) &&
((encoder_mode == ATOM_ENCODER_MODE_HDMI) || ((encoder_mode == ATOM_ENCODER_MODE_HDMI) ||
(ENCODER_MODE_IS_DP(encoder_mode) && ENCODER_MODE_IS_DP(encoder_mode)))
drm_detect_monitor_audio(radeon_connector_edid(connector)))))
radeon_audio_mode_set(encoder, adjusted_mode); radeon_audio_mode_set(encoder, adjusted_mode);
} }
......
...@@ -696,10 +696,15 @@ static void radeon_audio_hdmi_mode_set(struct drm_encoder *encoder, ...@@ -696,10 +696,15 @@ static void radeon_audio_hdmi_mode_set(struct drm_encoder *encoder,
{ {
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
if (!dig || !dig->afmt) if (!dig || !dig->afmt)
return; return;
if (!connector)
return;
if (drm_detect_monitor_audio(radeon_connector_edid(connector))) {
radeon_audio_set_mute(encoder, true); radeon_audio_set_mute(encoder, true);
radeon_audio_write_speaker_allocation(encoder); radeon_audio_write_speaker_allocation(encoder);
...@@ -716,6 +721,12 @@ static void radeon_audio_hdmi_mode_set(struct drm_encoder *encoder, ...@@ -716,6 +721,12 @@ static void radeon_audio_hdmi_mode_set(struct drm_encoder *encoder,
return; return;
radeon_audio_set_mute(encoder, false); radeon_audio_set_mute(encoder, false);
} else {
radeon_hdmi_set_color_depth(encoder);
if (radeon_audio_set_avi_packet(encoder, mode) < 0)
return;
}
} }
static void radeon_audio_dp_mode_set(struct drm_encoder *encoder, static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
...@@ -730,12 +741,13 @@ static void radeon_audio_dp_mode_set(struct drm_encoder *encoder, ...@@ -730,12 +741,13 @@ static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
struct radeon_connector_atom_dig *dig_connector = struct radeon_connector_atom_dig *dig_connector =
radeon_connector->con_priv; radeon_connector->con_priv;
if (!connector) if (!dig || !dig->afmt)
return; return;
if (!dig || !dig->afmt) if (!connector)
return; return;
if (drm_detect_monitor_audio(radeon_connector_edid(connector))) {
radeon_audio_write_speaker_allocation(encoder); radeon_audio_write_speaker_allocation(encoder);
radeon_audio_write_sad_regs(encoder); radeon_audio_write_sad_regs(encoder);
radeon_audio_write_latency_fields(encoder, mode); radeon_audio_write_latency_fields(encoder, mode);
...@@ -748,6 +760,7 @@ static void radeon_audio_dp_mode_set(struct drm_encoder *encoder, ...@@ -748,6 +760,7 @@ static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
if (radeon_audio_set_avi_packet(encoder, mode) < 0) if (radeon_audio_set_avi_packet(encoder, mode) < 0)
return; return;
}
} }
void radeon_audio_mode_set(struct drm_encoder *encoder, void radeon_audio_mode_set(struct drm_encoder *encoder,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment