diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/evergreen_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen_hdmi.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c index 0c6d5cef4cf1..05b0c95813fd 100644 --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c | |||
@@ -306,6 +306,15 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode | |||
306 | return; | 306 | return; |
307 | offset = dig->afmt->offset; | 307 | offset = dig->afmt->offset; |
308 | 308 | ||
309 | /* disable audio prior to setting up hw */ | ||
310 | if (ASIC_IS_DCE6(rdev)) { | ||
311 | dig->afmt->pin = dce6_audio_get_pin(rdev); | ||
312 | dce6_audio_enable(rdev, dig->afmt->pin, false); | ||
313 | } else { | ||
314 | dig->afmt->pin = r600_audio_get_pin(rdev); | ||
315 | r600_audio_enable(rdev, dig->afmt->pin, false); | ||
316 | } | ||
317 | |||
309 | evergreen_audio_set_dto(encoder, mode->clock); | 318 | evergreen_audio_set_dto(encoder, mode->clock); |
310 | 319 | ||
311 | WREG32(HDMI_VBI_PACKET_CONTROL + offset, | 320 | WREG32(HDMI_VBI_PACKET_CONTROL + offset, |
@@ -409,12 +418,16 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode | |||
409 | WREG32(AFMT_RAMP_CONTROL1 + offset, 0x007FFFFF); | 418 | WREG32(AFMT_RAMP_CONTROL1 + offset, 0x007FFFFF); |
410 | WREG32(AFMT_RAMP_CONTROL2 + offset, 0x00000001); | 419 | WREG32(AFMT_RAMP_CONTROL2 + offset, 0x00000001); |
411 | WREG32(AFMT_RAMP_CONTROL3 + offset, 0x00000001); | 420 | WREG32(AFMT_RAMP_CONTROL3 + offset, 0x00000001); |
421 | |||
422 | /* enable audio after to setting up hw */ | ||
423 | if (ASIC_IS_DCE6(rdev)) | ||
424 | dce6_audio_enable(rdev, dig->afmt->pin, true); | ||
425 | else | ||
426 | r600_audio_enable(rdev, dig->afmt->pin, true); | ||
412 | } | 427 | } |
413 | 428 | ||
414 | void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) | 429 | void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) |
415 | { | 430 | { |
416 | struct drm_device *dev = encoder->dev; | ||
417 | struct radeon_device *rdev = dev->dev_private; | ||
418 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 431 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
419 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | 432 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; |
420 | 433 | ||
@@ -427,15 +440,6 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) | |||
427 | if (!enable && !dig->afmt->enabled) | 440 | if (!enable && !dig->afmt->enabled) |
428 | return; | 441 | return; |
429 | 442 | ||
430 | if (enable) { | ||
431 | if (ASIC_IS_DCE6(rdev)) | ||
432 | dig->afmt->pin = dce6_audio_get_pin(rdev); | ||
433 | else | ||
434 | dig->afmt->pin = r600_audio_get_pin(rdev); | ||
435 | } else { | ||
436 | dig->afmt->pin = NULL; | ||
437 | } | ||
438 | |||
439 | dig->afmt->enabled = enable; | 443 | dig->afmt->enabled = enable; |
440 | 444 | ||
441 | DRM_DEBUG("%sabling HDMI interface @ 0x%04X for encoder 0x%x\n", | 445 | DRM_DEBUG("%sabling HDMI interface @ 0x%04X for encoder 0x%x\n", |