diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2014-05-16 05:10:29 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-06-02 10:25:04 -0400 |
commit | 2e93cac90c4b063c8732deb727a192dea1119640 (patch) | |
tree | d693edcb5a2ae13673e194f2985bf8b417f1d2d3 | |
parent | 8f33a156c2adeddb5b5755b277b2c0b68da56ae2 (diff) |
drm/radeon/hdmi: DCE3: clean ACR control
What initially seemed to be a typo in fglrx (using register 0x740c
instead of 0x74dc) appeared to be a correct behavior. DCE3 has ACR and
CRC registers swapped which explains why we needed
WREG32(HDMI0_AUDIO_CRC_CONTROL + offset, 0x1000);
This has been tested for possible regressions on DCE3 HD3470 (RV620).
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/r600_hdmi.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600d.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index b8b2efac2dbe..a828222e816c 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c | |||
@@ -332,6 +332,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod | |||
332 | u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE]; | 332 | u8 buffer[HDMI_INFOFRAME_HEADER_SIZE + HDMI_AVI_INFOFRAME_SIZE]; |
333 | struct hdmi_avi_infoframe frame; | 333 | struct hdmi_avi_infoframe frame; |
334 | uint32_t offset; | 334 | uint32_t offset; |
335 | uint32_t acr_ctl; | ||
335 | ssize_t err; | 336 | ssize_t err; |
336 | 337 | ||
337 | if (!dig || !dig->afmt) | 338 | if (!dig || !dig->afmt) |
@@ -351,15 +352,16 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod | |||
351 | WREG32(HDMI0_VBI_PACKET_CONTROL + offset, | 352 | WREG32(HDMI0_VBI_PACKET_CONTROL + offset, |
352 | HDMI0_NULL_SEND); /* send null packets when required */ | 353 | HDMI0_NULL_SEND); /* send null packets when required */ |
353 | 354 | ||
354 | WREG32(HDMI0_AUDIO_CRC_CONTROL + offset, 0x1000); | ||
355 | |||
356 | WREG32(HDMI0_AUDIO_PACKET_CONTROL + offset, | 355 | WREG32(HDMI0_AUDIO_PACKET_CONTROL + offset, |
357 | HDMI0_AUDIO_SAMPLE_SEND | /* send audio packets */ | 356 | HDMI0_AUDIO_SAMPLE_SEND | /* send audio packets */ |
358 | HDMI0_AUDIO_DELAY_EN(1) | /* default audio delay */ | 357 | HDMI0_AUDIO_DELAY_EN(1) | /* default audio delay */ |
359 | HDMI0_AUDIO_PACKETS_PER_LINE(3) | /* should be suffient for all audio modes and small enough for all hblanks */ | 358 | HDMI0_AUDIO_PACKETS_PER_LINE(3) | /* should be suffient for all audio modes and small enough for all hblanks */ |
360 | HDMI0_60958_CS_UPDATE); /* allow 60958 channel status fields to be updated */ | 359 | HDMI0_60958_CS_UPDATE); /* allow 60958 channel status fields to be updated */ |
361 | 360 | ||
362 | WREG32(HDMI0_ACR_PACKET_CONTROL + offset, | 361 | /* DCE 3.0 uses register that's normally for CRC_CONTROL */ |
362 | acr_ctl = ASIC_IS_DCE3(rdev) ? DCE3_HDMI0_ACR_PACKET_CONTROL : | ||
363 | HDMI0_ACR_PACKET_CONTROL; | ||
364 | WREG32(acr_ctl + offset, | ||
363 | HDMI0_ACR_SOURCE | /* select SW CTS value - XXX verify that hw CTS works on all families */ | 365 | HDMI0_ACR_SOURCE | /* select SW CTS value - XXX verify that hw CTS works on all families */ |
364 | HDMI0_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */ | 366 | HDMI0_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */ |
365 | 367 | ||
diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h index 37455f65107f..10380c5322a3 100644 --- a/drivers/gpu/drm/radeon/r600d.h +++ b/drivers/gpu/drm/radeon/r600d.h | |||
@@ -1038,6 +1038,7 @@ | |||
1038 | # define HDMI0_AZ_FORMAT_WTRIG_ACK (1 << 29) | 1038 | # define HDMI0_AZ_FORMAT_WTRIG_ACK (1 << 29) |
1039 | #define HDMI0_AUDIO_CRC_CONTROL 0x740c | 1039 | #define HDMI0_AUDIO_CRC_CONTROL 0x740c |
1040 | # define HDMI0_AUDIO_CRC_EN (1 << 0) | 1040 | # define HDMI0_AUDIO_CRC_EN (1 << 0) |
1041 | #define DCE3_HDMI0_ACR_PACKET_CONTROL 0x740c | ||
1041 | #define HDMI0_VBI_PACKET_CONTROL 0x7410 | 1042 | #define HDMI0_VBI_PACKET_CONTROL 0x7410 |
1042 | # define HDMI0_NULL_SEND (1 << 0) | 1043 | # define HDMI0_NULL_SEND (1 << 0) |
1043 | # define HDMI0_GC_SEND (1 << 4) | 1044 | # define HDMI0_GC_SEND (1 << 4) |
@@ -1166,6 +1167,7 @@ | |||
1166 | # define HDMI0_ACR_48 3 | 1167 | # define HDMI0_ACR_48 3 |
1167 | # define HDMI0_ACR_SOURCE (1 << 8) /* 0 - hw; 1 - cts value */ | 1168 | # define HDMI0_ACR_SOURCE (1 << 8) /* 0 - hw; 1 - cts value */ |
1168 | # define HDMI0_ACR_AUTO_SEND (1 << 12) | 1169 | # define HDMI0_ACR_AUTO_SEND (1 << 12) |
1170 | #define DCE3_HDMI0_AUDIO_CRC_CONTROL 0x74dc | ||
1169 | #define HDMI0_RAMP_CONTROL0 0x74e0 | 1171 | #define HDMI0_RAMP_CONTROL0 0x74e0 |
1170 | # define HDMI0_RAMP_MAX_COUNT(x) (((x) & 0xffffff) << 0) | 1172 | # define HDMI0_RAMP_MAX_COUNT(x) (((x) & 0xffffff) << 0) |
1171 | #define HDMI0_RAMP_CONTROL1 0x74e4 | 1173 | #define HDMI0_RAMP_CONTROL1 0x74e4 |