diff options
author | Slava Grigorev <slava.grigorev@amd.com> | 2014-12-05 17:59:56 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-01-22 10:42:10 -0500 |
commit | 96ea7afbc256ce7e2b2446909f52dab357942c3c (patch) | |
tree | 5fb9182a64808b71c271d99dfec4a622a8ee2508 /drivers/gpu/drm/radeon/evergreen_hdmi.c | |
parent | a85d682a6578a3bd02c95afb4ef527fa0897bb69 (diff) |
radeon/audio: consolidate update_avi_infoframe() functions
Reviewed-by: Christian König <christian.koenig@amd.com>
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 | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c index 38b1c51cce4d..f2896e5ff055 100644 --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c | |||
@@ -195,18 +195,12 @@ void evergreen_hdmi_write_sad_regs(struct drm_encoder *encoder, | |||
195 | } | 195 | } |
196 | 196 | ||
197 | /* | 197 | /* |
198 | * build a HDMI Video Info Frame | 198 | * build a AVI Info Frame |
199 | */ | 199 | */ |
200 | static void evergreen_hdmi_update_avi_infoframe(struct drm_encoder *encoder, | 200 | void evergreen_update_avi_infoframe(struct radeon_device *rdev, u32 offset, |
201 | void *buffer, size_t size) | 201 | unsigned char *buffer, size_t size) |
202 | { | 202 | { |
203 | struct drm_device *dev = encoder->dev; | ||
204 | struct radeon_device *rdev = dev->dev_private; | ||
205 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
206 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | ||
207 | uint32_t offset = dig->afmt->offset; | ||
208 | uint8_t *frame = buffer + 3; | 203 | uint8_t *frame = buffer + 3; |
209 | uint8_t *header = buffer; | ||
210 | 204 | ||
211 | WREG32(AFMT_AVI_INFO0 + offset, | 205 | WREG32(AFMT_AVI_INFO0 + offset, |
212 | frame[0x0] | (frame[0x1] << 8) | (frame[0x2] << 16) | (frame[0x3] << 24)); | 206 | frame[0x0] | (frame[0x1] << 8) | (frame[0x2] << 16) | (frame[0x3] << 24)); |
@@ -215,7 +209,7 @@ static void evergreen_hdmi_update_avi_infoframe(struct drm_encoder *encoder, | |||
215 | WREG32(AFMT_AVI_INFO2 + offset, | 209 | WREG32(AFMT_AVI_INFO2 + offset, |
216 | frame[0x8] | (frame[0x9] << 8) | (frame[0xA] << 16) | (frame[0xB] << 24)); | 210 | frame[0x8] | (frame[0x9] << 8) | (frame[0xA] << 16) | (frame[0xB] << 24)); |
217 | WREG32(AFMT_AVI_INFO3 + offset, | 211 | WREG32(AFMT_AVI_INFO3 + offset, |
218 | frame[0xC] | (frame[0xD] << 8) | (header[1] << 24)); | 212 | frame[0xC] | (frame[0xD] << 8) | (buffer[1] << 24)); |
219 | } | 213 | } |
220 | 214 | ||
221 | void dce4_hdmi_audio_set_dto(struct radeon_device *rdev, | 215 | void dce4_hdmi_audio_set_dto(struct radeon_device *rdev, |
@@ -431,7 +425,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode | |||
431 | return; | 425 | return; |
432 | } | 426 | } |
433 | 427 | ||
434 | evergreen_hdmi_update_avi_infoframe(encoder, buffer, sizeof(buffer)); | 428 | radeon_update_avi_infoframe(encoder, buffer, sizeof(buffer)); |
435 | 429 | ||
436 | WREG32_OR(HDMI_INFOFRAME_CONTROL0 + offset, | 430 | WREG32_OR(HDMI_INFOFRAME_CONTROL0 + offset, |
437 | HDMI_AVI_INFO_SEND | /* enable AVI info frames */ | 431 | HDMI_AVI_INFO_SEND | /* enable AVI info frames */ |