Commit 4adb34ef authored by Alex Deucher's avatar Alex Deucher

drm/radeon: disable audio when we disable hdmi (v2)

This should allow the audio driver to get a better
idea of whether the sink is connected or not.

v2: fix copy/paste typo noticed by David Henningsson
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d3d8c141
...@@ -501,6 +501,8 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode ...@@ -501,6 +501,8 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode
void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable)
{ {
struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private;
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;
...@@ -513,6 +515,14 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) ...@@ -513,6 +515,14 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable)
if (!enable && !dig->afmt->enabled) if (!enable && !dig->afmt->enabled)
return; return;
if (!enable && dig->afmt->pin) {
if (ASIC_IS_DCE6(rdev))
dce6_audio_enable(rdev, dig->afmt->pin, 0);
else
dce4_audio_enable(rdev, dig->afmt->pin, 0);
dig->afmt->pin = NULL;
}
dig->afmt->enabled = enable; dig->afmt->enabled = enable;
DRM_DEBUG("%sabling HDMI interface @ 0x%04X for encoder 0x%x\n", DRM_DEBUG("%sabling HDMI interface @ 0x%04X for encoder 0x%x\n",
......
...@@ -691,6 +691,11 @@ void r600_hdmi_enable(struct drm_encoder *encoder, bool enable) ...@@ -691,6 +691,11 @@ void r600_hdmi_enable(struct drm_encoder *encoder, bool enable)
if (!enable && !dig->afmt->enabled) if (!enable && !dig->afmt->enabled)
return; return;
if (!enable && dig->afmt->pin) {
r600_audio_enable(rdev, dig->afmt->pin, 0);
dig->afmt->pin = NULL;
}
/* Older chipsets require setting HDMI and routing manually */ /* Older chipsets require setting HDMI and routing manually */
if (!ASIC_IS_DCE3(rdev)) { if (!ASIC_IS_DCE3(rdev)) {
if (enable) if (enable)
......
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