diff options
author | Slava Grigorev <slava.grigorev@amd.com> | 2014-12-02 19:20:48 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-01-22 18:42:06 +0300 |
commit | 87654f87af2a06f325cc1a1a6e6a6a27f8837bf3 (patch) | |
tree | d973cd687c2e120ea9ae55c7f9e765f8df0c17bf /drivers/gpu/drm/radeon/evergreen_hdmi.c | |
parent | 00a9d4bcf8983a5aefcabf5de26b3cb7f805121c (diff) | |
download | linux-87654f87af2a06f325cc1a1a6e6a6a27f8837bf3.tar.xz |
radeon/audio: consolidate write_latency_fields() functions
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/evergreen_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen_hdmi.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c index 58ff82b94f97..aa8a31b99c6e 100644 --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c @@ -34,8 +34,6 @@ #include "atom.h" extern void dce6_afmt_select_pin(struct drm_encoder *encoder); -extern void dce6_afmt_write_latency_fields(struct drm_encoder *encoder, - struct drm_display_mode *mode); /* enable the audio stream */ static void dce4_audio_enable(struct radeon_device *rdev, @@ -90,26 +88,12 @@ static void evergreen_hdmi_update_ACR(struct drm_encoder *encoder, uint32_t cloc WREG32(HDMI_ACR_48_1 + offset, acr.n_48khz); } -static void dce4_afmt_write_latency_fields(struct drm_encoder *encoder, - struct drm_display_mode *mode) +void dce4_afmt_write_latency_fields(struct drm_encoder *encoder, + struct drm_connector *connector, struct drm_display_mode *mode) { struct radeon_device *rdev = encoder->dev->dev_private; - struct drm_connector *connector; - struct radeon_connector *radeon_connector = NULL; u32 tmp = 0; - list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) { - if (connector->encoder == encoder) { - radeon_connector = to_radeon_connector(connector); - break; - } - } - - if (!radeon_connector) { - DRM_ERROR("Couldn't find encoder's connector\n"); - return; - } - if (mode->flags & DRM_MODE_FLAG_INTERLACE) { if (connector->latency_present[1]) tmp = VIDEO_LIPSYNC(connector->video_latency[1]) | @@ -123,7 +107,7 @@ static void dce4_afmt_write_latency_fields(struct drm_encoder *encoder, else tmp = VIDEO_LIPSYNC(255) | AUDIO_LIPSYNC(255); } - WREG32(AZ_F0_CODEC_PIN0_CONTROL_RESPONSE_LIPSYNC, tmp); + WREG32_ENDPOINT(0, AZ_F0_CODEC_PIN0_CONTROL_RESPONSE_LIPSYNC, tmp); } void dce4_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder, @@ -418,14 +402,11 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode /* fglrx sets 0x40 in 0x5f80 here */ - if (ASIC_IS_DCE6(rdev)) { + if (ASIC_IS_DCE6(rdev)) dce6_afmt_select_pin(encoder); - dce6_afmt_write_latency_fields(encoder, mode); - } else { - dce4_afmt_write_latency_fields(encoder, mode); - } radeon_audio_write_sad_regs(encoder); + radeon_audio_write_latency_fields(encoder, mode); err = drm_hdmi_avi_infoframe_from_display_mode(&frame, mode); if (err < 0) { |