diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/atombios_encoders.c')
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_encoders.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 7c9df1eac065..7fe7b749e182 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c | |||
@@ -731,7 +731,9 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
731 | dig_connector = radeon_connector->con_priv; | 731 | dig_connector = radeon_connector->con_priv; |
732 | if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || | 732 | if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || |
733 | (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) { | 733 | (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) { |
734 | if (radeon_audio != 0 && ASIC_IS_DCE4(rdev) && !ASIC_IS_DCE5(rdev)) | 734 | if (radeon_audio != 0 && |
735 | drm_detect_monitor_audio(radeon_connector_edid(connector)) && | ||
736 | ASIC_IS_DCE4(rdev) && !ASIC_IS_DCE5(rdev)) | ||
735 | return ATOM_ENCODER_MODE_DP_AUDIO; | 737 | return ATOM_ENCODER_MODE_DP_AUDIO; |
736 | return ATOM_ENCODER_MODE_DP; | 738 | return ATOM_ENCODER_MODE_DP; |
737 | } else if (radeon_audio != 0) { | 739 | } else if (radeon_audio != 0) { |
@@ -747,7 +749,9 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
747 | } | 749 | } |
748 | break; | 750 | break; |
749 | case DRM_MODE_CONNECTOR_eDP: | 751 | case DRM_MODE_CONNECTOR_eDP: |
750 | if (radeon_audio != 0 && ASIC_IS_DCE4(rdev) && !ASIC_IS_DCE5(rdev)) | 752 | if (radeon_audio != 0 && |
753 | drm_detect_monitor_audio(radeon_connector_edid(connector)) && | ||
754 | ASIC_IS_DCE4(rdev) && !ASIC_IS_DCE5(rdev)) | ||
751 | return ATOM_ENCODER_MODE_DP_AUDIO; | 755 | return ATOM_ENCODER_MODE_DP_AUDIO; |
752 | return ATOM_ENCODER_MODE_DP; | 756 | return ATOM_ENCODER_MODE_DP; |
753 | case DRM_MODE_CONNECTOR_DVIA: | 757 | case DRM_MODE_CONNECTOR_DVIA: |
@@ -1720,8 +1724,10 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) | |||
1720 | } | 1724 | } |
1721 | 1725 | ||
1722 | encoder_mode = atombios_get_encoder_mode(encoder); | 1726 | encoder_mode = atombios_get_encoder_mode(encoder); |
1723 | if (radeon_audio != 0 && | 1727 | if (connector && (radeon_audio != 0) && |
1724 | (encoder_mode == ATOM_ENCODER_MODE_HDMI || ENCODER_MODE_IS_DP(encoder_mode))) | 1728 | ((encoder_mode == ATOM_ENCODER_MODE_HDMI) || |
1729 | (ENCODER_MODE_IS_DP(encoder_mode) && | ||
1730 | drm_detect_monitor_audio(radeon_connector_edid(connector))))) | ||
1725 | radeon_audio_dpms(encoder, mode); | 1731 | radeon_audio_dpms(encoder, mode); |
1726 | } | 1732 | } |
1727 | 1733 | ||
@@ -2136,6 +2142,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, | |||
2136 | struct drm_device *dev = encoder->dev; | 2142 | struct drm_device *dev = encoder->dev; |
2137 | struct radeon_device *rdev = dev->dev_private; | 2143 | struct radeon_device *rdev = dev->dev_private; |
2138 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 2144 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
2145 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); | ||
2139 | int encoder_mode; | 2146 | int encoder_mode; |
2140 | 2147 | ||
2141 | radeon_encoder->pixel_clock = adjusted_mode->clock; | 2148 | radeon_encoder->pixel_clock = adjusted_mode->clock; |
@@ -2164,8 +2171,10 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, | |||
2164 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA: | 2171 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA: |
2165 | /* handled in dpms */ | 2172 | /* handled in dpms */ |
2166 | encoder_mode = atombios_get_encoder_mode(encoder); | 2173 | encoder_mode = atombios_get_encoder_mode(encoder); |
2167 | if (radeon_audio != 0 && | 2174 | if (connector && (radeon_audio != 0) && |
2168 | (encoder_mode == ATOM_ENCODER_MODE_HDMI || ENCODER_MODE_IS_DP(encoder_mode))) | 2175 | ((encoder_mode == ATOM_ENCODER_MODE_HDMI) || |
2176 | (ENCODER_MODE_IS_DP(encoder_mode) && | ||
2177 | drm_detect_monitor_audio(radeon_connector_edid(connector))))) | ||
2169 | radeon_audio_mode_set(encoder, adjusted_mode); | 2178 | radeon_audio_mode_set(encoder, adjusted_mode); |
2170 | break; | 2179 | break; |
2171 | case ENCODER_OBJECT_ID_INTERNAL_DDI: | 2180 | case ENCODER_OBJECT_ID_INTERNAL_DDI: |