drm/radeon/hdmi: use separated file for DCE 3.1/3.2 code
Subsystems (2)
PATCH 1/4 drm/radeon/hdmi: use separated file for DCE 3.1/3.2 code
DCE 3.1 and 3.2 should be programmed in a different way than DCE 2 and DCE 3. The order of setting registers and sets of registers are different.
It's still unsure how we will handle DCE 3.1 vs. DCE 3.2, since they have few differences as well.
For now separate DCE 2 and DCE 3 path, so we can work on it without a risk of breaking DCE 3.1+.
This has been tested for possible regressions on DCE32 HD4550 (RV710).
--- drivers/gpu/drm/radeon/Makefile | 2 +- drivers/gpu/drm/radeon/dce3_1_afmt.c | 222 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/radeon/r600_hdmi.c | 149 ++--------------------- drivers/gpu/drm/radeon/radeon_asic.c | 2 +- drivers/gpu/drm/radeon/radeon_asic.h | 7 ++ 5 files changed, 241 insertions(+), 141 deletions(-) create mode 100644 drivers/gpu/drm/radeon/dce3_1_afmt.c
drivers/gpu/drm/radeon/Makefile +1 -1
@@ -72,7 +72,7 @@ radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \ radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \ rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \ r200.o radeon_legacy_tv.o r600_cs.o r600_blit_shaders.o \ - radeon_pm.o atombios_dp.o r600_audio.o r600_hdmi.o \ + radeon_pm.o atombios_dp.o r600_audio.o r600_hdmi.o dce3_1_afmt.o \ evergreen.o evergreen_cs.o evergreen_blit_shaders.o \ evergreen_hdmi.o radeon_trace_points.o ni.o cayman_blit_shaders.o \ atombios_encoders.o radeon_semaphore.o radeon_sa.o atombios_i2c.o si.o \
drivers/gpu/drm/radeon/dce3_1_afmt.c new file +222 -0
222 lines not on this page · raw message
drivers/gpu/drm/radeon/r600_hdmi.c +10 -139
185 lines not on this page · raw message
drivers/gpu/drm/radeon/radeon_asic.c +1 -1
@@ -1214,7 +1214,7 @@ static struct radeon_asic rv770_asic = { .set_backlight_level = &atombios_set_backlight_level, .get_backlight_level = &atombios_get_backlight_level, .hdmi_enable = &r600_hdmi_enable, - .hdmi_setmode = &r600_hdmi_setmode, + .hdmi_setmode = &dce3_1_hdmi_setmode, }, .copy = { .blit = &r600_copy_cpdma,
drivers/gpu/drm/radeon/radeon_asic.h +7 -0
@@ -391,6 +391,11 @@ void r600_rlc_stop(struct radeon_device *rdev);int r600_audio_init (struct radeon_device *rdev);struct r600_audio_pin r600_audio_status (struct radeon_device *rdev);void r600_audio_fini (struct radeon_device *rdev); +void r600_audio_set_dto (struct drm_encoder *encoder,u32 clock); +void r600_hdmi_update_avi_infoframe (struct drm_encoder *encoder,void *buffer, +size_t size); +void r600_hdmi_update_ACR (struct drm_encoder *encoder,uint32_t clock); +void r600_hdmi_audio_workaround (struct drm_encoder *encoder);int r600_hdmi_buffer_status_changed (struct drm_encoder *encoder);void r600_hdmi_update_audio_settings (struct drm_encoder *encoder);void r600_hdmi_enable (struct drm_encoder *encoder,bool enable);
@@ -463,6 +468,8 @@ int rv770_copy_dma(struct radeon_device *rdev,u32 rv770_get_xclk (struct radeon_device *rdev);int rv770_set_uvd_clocks (struct radeon_device *rdev,u32 vclk,u32 dclk);int rv770_get_temp (struct radeon_device *rdev); +/* hdmi */ +void dce3_1_hdmi_setmode (struct drm_encoder *encoder,struct drm_display_mode *mode);/* rv7xx pm */ int rv770_dpm_init (struct radeon_device *rdev);int rv770_dpm_enable (struct radeon_device *rdev);
Signature · 6 lines
1.8.4.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/4 drm/radeon/hdmi: DCE3: clean ACR control
What initially seemed to be a typo in fglrx (using register 0x740c instead of 74dc) appeared to be a correct behavior. Without this 0x740c reg operation DCE 3 doesn't work and it seems we got code for that already in place.
Recent RE effors allowed to finally understand this magic:WREG32(HDMI0_AUDIO_CRC_CONTROL + offset, 0x1000);
This has been tested for possible regressions on DCE3 HD3470 (RV620).
--- drivers/gpu/drm/radeon/r600_hdmi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/r600_hdmi.c +4 -3
@@ -332,6 +332,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *modu8 buffer[HDMI_INFOFRAME_HEADER_SIZE +HDMI_AVI_INFOFRAME_SIZE ];struct hdmi_avi_infoframe frame;uint32_t offset; +uint32_t acr_ctl;ssize_t err;if (!dig || !dig->afmt)
@@ -351,15 +352,15 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *modWREG32 (HDMI0_VBI_PACKET_CONTROL + offset,HDMI0_NULL_SEND );/* send null packets when required */ -WREG32 (HDMI0_AUDIO_CRC_CONTROL + offset,0x1000 ); -WREG32 (HDMI0_AUDIO_PACKET_CONTROL + offset,HDMI0_AUDIO_SAMPLE_SEND |/* send audio packets */ HDMI0_AUDIO_DELAY_EN (1 ) |/* default audio delay */ HDMI0_AUDIO_PACKETS_PER_LINE (3 ) |/* should be suffient for all audio modes and small enough for all hblanks */ HDMI0_60958_CS_UPDATE );/* allow 60958 channel status fields to be updated */ -WREG32 (HDMI0_ACR_PACKET_CONTROL + offset, +/* DCE 3.0 uses register that's normally for CRC_CONTROL */ + acr_ctl =ASIC_IS_DCE3 (rdev) ?0x740c :HDMI0_ACR_PACKET_CONTROL ; +WREG32 (acr_ctl + offset,HDMI0_ACR_SOURCE |/* select SW CTS value - XXX verify that hw CTS works on all families */ HDMI0_ACR_AUTO_SEND );/* allow hw to sent ACR packets when required */
Signature · 6 lines
1.8.4.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [deathsimple/drm-next-3.16][2/4] drm/radeon/hdmi: DCE3: clean ACR control
Quoted 31 lines · Rafał Miłecki
What initially seemed to be a typo in fglrx (using register
0x740cinstead of 74dc) appeared to be a correct behavior. Without this0x740creg operation DCE 3 doesn't work and it seems we got code for that already in place.
Recent RE effors allowed to finally understand this magic:WREG32(HDMI0_AUDIO_CRC_CONTROL + offset, 0x1000);This has been tested for possible regressions on DCE3 HD3470 (RV620).
Signed-off-by Rafał Miłecki <[email protected]>--- drivers/gpu/drm/radeon/r600_hdmi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/gpu/drm/radeon/r600_hdmi.c +1
-1@@ -332,6 +332,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *modu8 buffer[HDMI_INFOFRAME_HEADER_SIZE +HDMI_AVI_INFOFRAME_SIZE ];struct hdmi_avi_infoframe frame;uint32_t offset; +uint32_t acr_ctl;ssize_t err;if (!dig || !dig->afmt)@@ -351,15 +352,15 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *modWREG32 (HDMI0_VBI_PACKET_CONTROL + offset,HDMI0_NULL_SEND );/* send null packets when required */ -WREG32 (HDMI0_AUDIO_CRC_CONTROL + offset,0x1000 );
drivers/gpu/drm/radeon/r600_hdmi.c void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod · line 362
Quoted 10 lines
drivers/gpu/drm/radeon/r600_hdmi.c +2
-2-WREG32 (HDMI0_AUDIO_PACKET_CONTROL + offset,HDMI0_AUDIO_SAMPLE_SEND |/* send audio packets */ HDMI0_AUDIO_DELAY_EN (1 ) |/* default audio delay */ HDMI0_AUDIO_PACKETS_PER_LINE (3 ) |/* should be suffient for all audio modes and small enough for all hblanks */ HDMI0_60958_CS_UPDATE );/* allow 60958 channel status fields to be updated */ - WREG32(HDMI0_ACR_PACKET_CONTROL + offset, +/* DCE 3.0 uses register that's normally for CRC_CONTROL */ + acr_ctl =ASIC_IS_DCE3 (rdev) ?0x740c :HDMI0_ACR_PACKET_CONTROL ;
The register offsets for these registers seems to be swapped. On DCE3, they should be:
#define HDMI0_AUDIO_CRC_CONTROL 0x74dc
#define HDMI0_ACR_PACKET_CONTROL 0x740c
Quoted 7 lines
drivers/gpu/drm/radeon/r600_hdmi.c +1
-1+WREG32 (acr_ctl + offset,HDMI0_ACR_SOURCE |/* select SW CTS value - XXX verify that hw CTS works on all families */ HDMI0_ACR_AUTO_SEND );/* allow hw to sent ACR packets when required */ --1.8.4.5
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/4 drm/radeon/hdmi: DCE2: update setmode
In reply to Rafał MiłeckiRecent RE efforts revealed ops performed by fglrx during HDMI setup. This mostly adds masks to r/w ops plus few single missing bits.
This has been tested for possible regressions on:
1) DCE2 D2400 (RV610)
2) DCE3 HD3470 (RV620)
For a reference and details see:
https://bugzilla.kernel.org/show_bug.cgi?id=76231
--- drivers/gpu/drm/radeon/r600_hdmi.c | 113 ++++++++++++++++++++++++------------- 1 file changed, 75 insertions(+), 38 deletions(-)
drivers/gpu/drm/radeon/r600_hdmi.c +75 -38
@@ -142,14 +142,26 @@ void r600_hdmi_update_ACR(struct drm_encoder *encoder, uint32_t clock)struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;uint32_t offset = dig->afmt->offset; -WREG32 (HDMI0_ACR_32_0 + offset,HDMI0_ACR_CTS_32 (acr.cts_32khz)); -WREG32 (HDMI0_ACR_32_1 + offset, acr.n_32khz); - -WREG32 (HDMI0_ACR_44_0 + offset,HDMI0_ACR_CTS_44 (acr.cts_44_1khz)); -WREG32 (HDMI0_ACR_44_1 + offset, acr.n_44_1khz); - -WREG32 (HDMI0_ACR_48_0 + offset,HDMI0_ACR_CTS_48 (acr.cts_48khz)); -WREG32 (HDMI0_ACR_48_1 + offset, acr.n_48khz); +WREG32_P (HDMI0_ACR_32_0 + offset, +HDMI0_ACR_CTS_32 (acr.cts_32khz), + ~HDMI0_ACR_CTS_32_MASK ); +WREG32_P (HDMI0_ACR_32_1 + offset, +HDMI0_ACR_N_32 (acr.n_32khz), + ~HDMI0_ACR_N_32_MASK ); + +WREG32_P (HDMI0_ACR_44_0 + offset, +HDMI0_ACR_CTS_44 (acr.cts_44_1khz), + ~HDMI0_ACR_CTS_44_MASK ); +WREG32_P (HDMI0_ACR_44_1 + offset, +HDMI0_ACR_N_44 (acr.n_44_1khz), + ~HDMI0_ACR_N_44_MASK ); + +WREG32_P (HDMI0_ACR_48_0 + offset, +HDMI0_ACR_CTS_48 (acr.cts_48khz), + ~HDMI0_ACR_CTS_48_MASK ); +WREG32_P (HDMI0_ACR_48_1 + offset, +HDMI0_ACR_N_48 (acr.n_48khz), + ~HDMI0_ACR_N_48_MASK ); }/*
@@ -349,38 +361,42 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *modr600_audio_set_dto (encoder, mode->clock); -WREG32 (HDMI0_VBI_PACKET_CONTROL + offset, -HDMI0_NULL_SEND );/* send null packets when required */ - -WREG32 (HDMI0_AUDIO_PACKET_CONTROL + offset, -HDMI0_AUDIO_SAMPLE_SEND |/* send audio packets */ -HDMI0_AUDIO_DELAY_EN (1 ) |/* default audio delay */ -HDMI0_AUDIO_PACKETS_PER_LINE (3 ) |/* should be suffient for all audio modes and small enough for all hblanks */ -HDMI0_60958_CS_UPDATE );/* allow 60958 channel status fields to be updated */ +WREG32_P (HDMI0_AUDIO_PACKET_CONTROL + offset, +HDMI0_AUDIO_SAMPLE_SEND |/* send audio packets */ +HDMI0_AUDIO_DELAY_EN (1 ) |/* default audio delay */ +HDMI0_AUDIO_PACKETS_PER_LINE (3 ) |/* should be suffient for all audio modes and small enough for all hblanks */ +HDMI0_60958_CS_UPDATE ,/* allow 60958 channel status fields to be updated */ + ~(HDMI0_AUDIO_SAMPLE_SEND | +HDMI0_AUDIO_DELAY_EN_MASK | +HDMI0_AUDIO_PACKETS_PER_LINE_MASK | +HDMI0_60958_CS_UPDATE )); -/* DCE 3.0 uses register that's normally for CRC_CONTROL */ acr_ctl =ASIC_IS_DCE3 (rdev) ?0x740c :HDMI0_ACR_PACKET_CONTROL ; -WREG32 (acr_ctl + offset, -HDMI0_ACR_SOURCE |/* select SW CTS value - XXX verify that hw CTS works on all families */ -HDMI0_ACR_AUTO_SEND );/* allow hw to sent ACR packets when required */ - -WREG32 (HDMI0_VBI_PACKET_CONTROL + offset, -HDMI0_NULL_SEND |/* send null packets when required */ -HDMI0_GC_SEND |/* send general control packets */ -HDMI0_GC_CONT );/* send general control packets every frame */ - -/* TODO: HDMI0_AUDIO_INFO_UPDATE */ -WREG32 (HDMI0_INFOFRAME_CONTROL0 + offset, -HDMI0_AVI_INFO_SEND |/* enable AVI info frames */ -HDMI0_AVI_INFO_CONT |/* send AVI info frames every frame/field */ -HDMI0_AUDIO_INFO_SEND |/* enable audio info frames (frames won't be set until audio is enabled) */ -HDMI0_AUDIO_INFO_CONT );/* send audio info frames every frame/field */ - -WREG32 (HDMI0_INFOFRAME_CONTROL1 + offset, -HDMI0_AVI_INFO_LINE (2 ) |/* anything other than 0 */ -HDMI0_AUDIO_INFO_LINE (2 ));/* anything other than 0 */ - -WREG32 (HDMI0_GC + offset,0 );/* unset HDMI0_GC_AVMUTE */ +WREG32_P (acr_ctl + offset, +HDMI0_ACR_SOURCE |/* select SW CTS value - XXX verify that hw CTS works on all families */ +HDMI0_ACR_AUTO_SEND ,/* allow hw to sent ACR packets when required */ + ~(HDMI0_ACR_SOURCE | +HDMI0_ACR_AUTO_SEND )); + +WREG32_OR (HDMI0_VBI_PACKET_CONTROL + offset, +HDMI0_NULL_SEND |/* send null packets when required */ +HDMI0_GC_SEND |/* send general control packets */ +HDMI0_GC_CONT );/* send general control packets every frame */ + +WREG32_OR (HDMI0_INFOFRAME_CONTROL0 + offset, +HDMI0_AVI_INFO_SEND |/* enable AVI info frames */ +HDMI0_AVI_INFO_CONT |/* send AVI info frames every frame/field */ +HDMI0_AUDIO_INFO_SEND |/* enable audio info frames (frames won't be set until audio is enabled) */ +HDMI0_AUDIO_INFO_UPDATE );/* required for audio info values to be updated */ + +WREG32_P (HDMI0_INFOFRAME_CONTROL1 + offset, +HDMI0_AVI_INFO_LINE (2 ) |/* anything other than 0 */ +HDMI0_AUDIO_INFO_LINE (2 ),/* anything other than 0 */ + ~(HDMI0_AVI_INFO_LINE_MASK | +HDMI0_AUDIO_INFO_LINE_MASK )); + +WREG32_AND (HDMI0_GC + offset, + ~HDMI0_GC_AVMUTE );/* unset HDMI0_GC_AVMUTE */ err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode);if (err <0 ) {
@@ -395,8 +411,29 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod }r600_hdmi_update_avi_infoframe (encoder, buffer,sizeof (buffer)); + +/* fglrx duplicates INFOFRAME_CONTROL0 & INFOFRAME_CONTROL1 ops here */ + +WREG32_AND (HDMI0_GENERIC_PACKET_CONTROL + offset, + ~(HDMI0_GENERIC0_SEND | +HDMI0_GENERIC0_CONT | +HDMI0_GENERIC0_UPDATE | +HDMI0_GENERIC1_SEND | +HDMI0_GENERIC1_CONT | +HDMI0_GENERIC0_LINE_MASK | +HDMI0_GENERIC1_LINE_MASK )); +r600_hdmi_update_ACR (encoder, mode->clock); +WREG32_P (HDMI0_60958_0 + offset, +HDMI0_60958_CS_CHANNEL_NUMBER_L (1 ), + ~(HDMI0_60958_CS_CHANNEL_NUMBER_L_MASK | +HDMI0_60958_CS_CLOCK_ACCURACY_MASK )); + +WREG32_P (HDMI0_60958_1 + offset, +HDMI0_60958_CS_CHANNEL_NUMBER_R (2 ), + ~HDMI0_60958_CS_CHANNEL_NUMBER_R_MASK ); +/* it's unknown what these bits do excatly, but it's indeed quite useful for debugging */ WREG32 (HDMI0_RAMP_CONTROL0 + offset,0x00FFFFFF );WREG32 (HDMI0_RAMP_CONTROL1 + offset,0x007FFFFF );
Signature · 6 lines
1.8.4.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 3/4 drm/radeon/hdmi: DCE2: update setmode
Recent RE efforts revealed ops performed by fglrx during HDMI setup. This mostly adds masks to r/w ops plus few single missing bits.
This has been tested for possible regressions on:
1) DCE2 HD2400 (RV610)
2) DCE3 HD3470 (RV620)
For a reference and details see:
https://bugzilla.kernel.org/show_bug.cgi?id=76231
---
V2: Move r600d.h changes to 0003 (from 0004) to don't break compilation
Fix typo in commit message
Leave comment about DCE 3.0 and ACR control
--- drivers/gpu/drm/radeon/r600_hdmi.c | 112 +++++++++++++++++++++++++------------ drivers/gpu/drm/radeon/r600d.h | 15 +++++ 2 files changed, 90 insertions(+), 37 deletions(-)
drivers/gpu/drm/radeon/r600_hdmi.c +75 -37
@@ -142,14 +142,26 @@ void r600_hdmi_update_ACR(struct drm_encoder *encoder, uint32_t clock)struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;uint32_t offset = dig->afmt->offset; -WREG32 (HDMI0_ACR_32_0 + offset,HDMI0_ACR_CTS_32 (acr.cts_32khz)); -WREG32 (HDMI0_ACR_32_1 + offset, acr.n_32khz); - -WREG32 (HDMI0_ACR_44_0 + offset,HDMI0_ACR_CTS_44 (acr.cts_44_1khz)); -WREG32 (HDMI0_ACR_44_1 + offset, acr.n_44_1khz); - -WREG32 (HDMI0_ACR_48_0 + offset,HDMI0_ACR_CTS_48 (acr.cts_48khz)); -WREG32 (HDMI0_ACR_48_1 + offset, acr.n_48khz); +WREG32_P (HDMI0_ACR_32_0 + offset, +HDMI0_ACR_CTS_32 (acr.cts_32khz), + ~HDMI0_ACR_CTS_32_MASK ); +WREG32_P (HDMI0_ACR_32_1 + offset, +HDMI0_ACR_N_32 (acr.n_32khz), + ~HDMI0_ACR_N_32_MASK ); + +WREG32_P (HDMI0_ACR_44_0 + offset, +HDMI0_ACR_CTS_44 (acr.cts_44_1khz), + ~HDMI0_ACR_CTS_44_MASK ); +WREG32_P (HDMI0_ACR_44_1 + offset, +HDMI0_ACR_N_44 (acr.n_44_1khz), + ~HDMI0_ACR_N_44_MASK ); + +WREG32_P (HDMI0_ACR_48_0 + offset, +HDMI0_ACR_CTS_48 (acr.cts_48khz), + ~HDMI0_ACR_CTS_48_MASK ); +WREG32_P (HDMI0_ACR_48_1 + offset, +HDMI0_ACR_N_48 (acr.n_48khz), + ~HDMI0_ACR_N_48_MASK ); }/*
@@ -349,38 +361,43 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *modr600_audio_set_dto (encoder, mode->clock); -WREG32 (HDMI0_VBI_PACKET_CONTROL + offset, -HDMI0_NULL_SEND );/* send null packets when required */ - -WREG32 (HDMI0_AUDIO_PACKET_CONTROL + offset, -HDMI0_AUDIO_SAMPLE_SEND |/* send audio packets */ -HDMI0_AUDIO_DELAY_EN (1 ) |/* default audio delay */ -HDMI0_AUDIO_PACKETS_PER_LINE (3 ) |/* should be suffient for all audio modes and small enough for all hblanks */ -HDMI0_60958_CS_UPDATE );/* allow 60958 channel status fields to be updated */ +WREG32_P (HDMI0_AUDIO_PACKET_CONTROL + offset, +HDMI0_AUDIO_SAMPLE_SEND |/* send audio packets */ +HDMI0_AUDIO_DELAY_EN (1 ) |/* default audio delay */ +HDMI0_AUDIO_PACKETS_PER_LINE (3 ) |/* should be suffient for all audio modes and small enough for all hblanks */ +HDMI0_60958_CS_UPDATE ,/* allow 60958 channel status fields to be updated */ + ~(HDMI0_AUDIO_SAMPLE_SEND | +HDMI0_AUDIO_DELAY_EN_MASK | +HDMI0_AUDIO_PACKETS_PER_LINE_MASK | +HDMI0_60958_CS_UPDATE ));/* DCE 3.0 uses register that's normally for CRC_CONTROL */ acr_ctl =ASIC_IS_DCE3 (rdev) ?0x740c :HDMI0_ACR_PACKET_CONTROL ; -WREG32 (acr_ctl + offset, -HDMI0_ACR_SOURCE |/* select SW CTS value - XXX verify that hw CTS works on all families */ -HDMI0_ACR_AUTO_SEND );/* allow hw to sent ACR packets when required */ - -WREG32 (HDMI0_VBI_PACKET_CONTROL + offset, -HDMI0_NULL_SEND |/* send null packets when required */ -HDMI0_GC_SEND |/* send general control packets */ -HDMI0_GC_CONT );/* send general control packets every frame */ - -/* TODO: HDMI0_AUDIO_INFO_UPDATE */ -WREG32 (HDMI0_INFOFRAME_CONTROL0 + offset, -HDMI0_AVI_INFO_SEND |/* enable AVI info frames */ -HDMI0_AVI_INFO_CONT |/* send AVI info frames every frame/field */ -HDMI0_AUDIO_INFO_SEND |/* enable audio info frames (frames won't be set until audio is enabled) */ -HDMI0_AUDIO_INFO_CONT );/* send audio info frames every frame/field */ - -WREG32 (HDMI0_INFOFRAME_CONTROL1 + offset, -HDMI0_AVI_INFO_LINE (2 ) |/* anything other than 0 */ -HDMI0_AUDIO_INFO_LINE (2 ));/* anything other than 0 */ - -WREG32 (HDMI0_GC + offset,0 );/* unset HDMI0_GC_AVMUTE */ +WREG32_P (acr_ctl + offset, +HDMI0_ACR_SOURCE |/* select SW CTS value - XXX verify that hw CTS works on all families */ +HDMI0_ACR_AUTO_SEND ,/* allow hw to sent ACR packets when required */ + ~(HDMI0_ACR_SOURCE | +HDMI0_ACR_AUTO_SEND )); + +WREG32_OR (HDMI0_VBI_PACKET_CONTROL + offset, +HDMI0_NULL_SEND |/* send null packets when required */ +HDMI0_GC_SEND |/* send general control packets */ +HDMI0_GC_CONT );/* send general control packets every frame */ + +WREG32_OR (HDMI0_INFOFRAME_CONTROL0 + offset, +HDMI0_AVI_INFO_SEND |/* enable AVI info frames */ +HDMI0_AVI_INFO_CONT |/* send AVI info frames every frame/field */ +HDMI0_AUDIO_INFO_SEND |/* enable audio info frames (frames won't be set until audio is enabled) */ +HDMI0_AUDIO_INFO_UPDATE );/* required for audio info values to be updated */ + +WREG32_P (HDMI0_INFOFRAME_CONTROL1 + offset, +HDMI0_AVI_INFO_LINE (2 ) |/* anything other than 0 */ +HDMI0_AUDIO_INFO_LINE (2 ),/* anything other than 0 */ + ~(HDMI0_AVI_INFO_LINE_MASK | +HDMI0_AUDIO_INFO_LINE_MASK )); + +WREG32_AND (HDMI0_GC + offset, + ~HDMI0_GC_AVMUTE );/* unset HDMI0_GC_AVMUTE */ err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode);if (err <0 ) {
@@ -395,8 +412,29 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod }r600_hdmi_update_avi_infoframe (encoder, buffer,sizeof (buffer)); + +/* fglrx duplicates INFOFRAME_CONTROL0 & INFOFRAME_CONTROL1 ops here */ + +WREG32_AND (HDMI0_GENERIC_PACKET_CONTROL + offset, + ~(HDMI0_GENERIC0_SEND | +HDMI0_GENERIC0_CONT | +HDMI0_GENERIC0_UPDATE | +HDMI0_GENERIC1_SEND | +HDMI0_GENERIC1_CONT | +HDMI0_GENERIC0_LINE_MASK | +HDMI0_GENERIC1_LINE_MASK )); +r600_hdmi_update_ACR (encoder, mode->clock); +WREG32_P (HDMI0_60958_0 + offset, +HDMI0_60958_CS_CHANNEL_NUMBER_L (1 ), + ~(HDMI0_60958_CS_CHANNEL_NUMBER_L_MASK | +HDMI0_60958_CS_CLOCK_ACCURACY_MASK )); + +WREG32_P (HDMI0_60958_1 + offset, +HDMI0_60958_CS_CHANNEL_NUMBER_R (2 ), + ~HDMI0_60958_CS_CHANNEL_NUMBER_R_MASK ); +/* it's unknown what these bits do excatly, but it's indeed quite useful for debugging */ WREG32 (HDMI0_RAMP_CONTROL0 + offset,0x00FFFFFF );WREG32 (HDMI0_RAMP_CONTROL1 + offset,0x007FFFFF );
drivers/gpu/drm/radeon/r600d.h +15 -0
@@ -1029,9 +1029,11 @@#define HDMI0_AUDIO_PACKET_CONTROL 0x7408# define HDMI0_AUDIO_SAMPLE_SEND (1 << 0)# define HDMI0_AUDIO_DELAY_EN (x) (((x) & 3) << 4) +# define HDMI0_AUDIO_DELAY_EN_MASK (3 << 4)# define HDMI0_AUDIO_SEND_MAX_PACKETS (1 << 8)# define HDMI0_AUDIO_TEST_EN (1 << 12)# define HDMI0_AUDIO_PACKETS_PER_LINE (x) (((x) & 0x1f) << 16) +# define HDMI0_AUDIO_PACKETS_PER_LINE_MASK (0x1f << 16)# define HDMI0_AUDIO_CHANNEL_SWAP (1 << 24)# define HDMI0_60958_CS_UPDATE (1 << 26)# define HDMI0_AZ_FORMAT_WTRIG_MASK (1 << 28)
@@ -1054,7 +1056,9 @@# define HDMI0_MPEG_INFO_UPDATE (1 << 10)#define HDMI0_INFOFRAME_CONTROL1 0x7418# define HDMI0_AVI_INFO_LINE (x) (((x) & 0x3f) << 0) +# define HDMI0_AVI_INFO_LINE_MASK (0x3f << 0)# define HDMI0_AUDIO_INFO_LINE (x) (((x) & 0x3f) << 8) +# define HDMI0_AUDIO_INFO_LINE_MASK (0x3f << 8)# define HDMI0_MPEG_INFO_LINE (x) (((x) & 0x3f) << 16)#define HDMI0_GENERIC_PACKET_CONTROL 0x741c# define HDMI0_GENERIC0_SEND (1 << 0)
@@ -1063,7 +1067,9 @@# define HDMI0_GENERIC1_SEND (1 << 4)# define HDMI0_GENERIC1_CONT (1 << 5)# define HDMI0_GENERIC0_LINE (x) (((x) & 0x3f) << 16) +# define HDMI0_GENERIC0_LINE_MASK (0x3f << 16)# define HDMI0_GENERIC1_LINE (x) (((x) & 0x3f) << 24) +# define HDMI0_GENERIC1_LINE_MASK (0x3f << 24)#define HDMI0_GC 0x7428# define HDMI0_GC_AVMUTE (1 << 0)#define HDMI0_AVI_INFO0 0x7454
@@ -1119,16 +1125,22 @@#define HDMI0_GENERIC1_6 0x74a8#define HDMI0_ACR_32_0 0x74ac# define HDMI0_ACR_CTS_32 (x) (((x) & 0xfffff) << 12) +# define HDMI0_ACR_CTS_32_MASK (0xfffff << 12)#define HDMI0_ACR_32_1 0x74b0# define HDMI0_ACR_N_32 (x) (((x) & 0xfffff) << 0) +# define HDMI0_ACR_N_32_MASK (0xfffff << 0)#define HDMI0_ACR_44_0 0x74b4# define HDMI0_ACR_CTS_44 (x) (((x) & 0xfffff) << 12) +# define HDMI0_ACR_CTS_44_MASK (0xfffff << 12)#define HDMI0_ACR_44_1 0x74b8# define HDMI0_ACR_N_44 (x) (((x) & 0xfffff) << 0) +# define HDMI0_ACR_N_44_MASK (0xfffff << 0)#define HDMI0_ACR_48_0 0x74bc# define HDMI0_ACR_CTS_48 (x) (((x) & 0xfffff) << 12) +# define HDMI0_ACR_CTS_48_MASK (0xfffff << 12)#define HDMI0_ACR_48_1 0x74c0# define HDMI0_ACR_N_48 (x) (((x) & 0xfffff) << 0) +# define HDMI0_ACR_N_48_MASK (0xfffff << 0)#define HDMI0_ACR_STATUS_0 0x74c4#define HDMI0_ACR_STATUS_1 0x74c8#define HDMI0_AUDIO_INFO0 0x74cc
@@ -1148,14 +1160,17 @@# define HDMI0_60958_CS_CATEGORY_CODE (x) (((x) & 0xff) << 8)# define HDMI0_60958_CS_SOURCE_NUMBER (x) (((x) & 0xf) << 16)# define HDMI0_60958_CS_CHANNEL_NUMBER_L (x) (((x) & 0xf) << 20) +# define HDMI0_60958_CS_CHANNEL_NUMBER_L_MASK (0xf << 20)# define HDMI0_60958_CS_SAMPLING_FREQUENCY (x) (((x) & 0xf) << 24)# define HDMI0_60958_CS_CLOCK_ACCURACY (x) (((x) & 3) << 28) +# define HDMI0_60958_CS_CLOCK_ACCURACY_MASK (3 << 28)#define HDMI0_60958_1 0x74d8# define HDMI0_60958_CS_WORD_LENGTH (x) (((x) & 0xf) << 0)# define HDMI0_60958_CS_ORIGINAL_SAMPLING_FREQUENCY (x) (((x) & 0xf) << 4)# define HDMI0_60958_CS_VALID_L (x) (((x) & 1) << 16)# define HDMI0_60958_CS_VALID_R (x) (((x) & 1) << 18)# define HDMI0_60958_CS_CHANNEL_NUMBER_R (x) (((x) & 0xf) << 20) +# define HDMI0_60958_CS_CHANNEL_NUMBER_R_MASK (0xf << 20)#define HDMI0_ACR_PACKET_CONTROL 0x74dc# define HDMI0_ACR_SEND (1 << 0)# define HDMI0_ACR_CONT (1 << 1)
Signature · 6 lines
1.8.4.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/4 drm/radeon/hdmi: DCE2: simplify audio workaround
In reply to Rafał MiłeckiThanks to advanced RE of fglrx we finally know what exactly needs to be handled of AFMT change.
This has been tested for possible regressions on:
1) DCE2 D2400 (RV610)
2) DCE3 HD3470 (RV620)
For a reference and details see:
https://bugzilla.kernel.org/show_bug.cgi?id=76231
--- drivers/gpu/drm/radeon/r600_hdmi.c | 82 ++++++++++---------------------------- drivers/gpu/drm/radeon/r600d.h | 15 +++++++ 2 files changed, 37 insertions(+), 60 deletions(-)
drivers/gpu/drm/radeon/r600_hdmi.c +22 -60
@@ -440,14 +440,16 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *modWREG32 (HDMI0_RAMP_CONTROL2 + offset,0x00000001 );WREG32 (HDMI0_RAMP_CONTROL3 + offset,0x00000001 ); -r600_hdmi_audio_workaround (encoder); -/* enable audio after to setting up hw */ r600_audio_enable (rdev, dig->afmt->pin, true); } -/* -* update settings with current parameters from audio engine +/** +* r600_hdmi_update_audio_settings - Update audio infoframe +* +* @encoder: drm encoder +* +* Gets info about current audio stream and updates audio infoframe. */ void r600_hdmi_update_audio_settings (struct drm_encoder *encoder) {
@@ -459,7 +461,7 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder)uint8_t buffer[HDMI_INFOFRAME_HEADER_SIZE +HDMI_AUDIO_INFOFRAME_SIZE ];struct hdmi_audio_infoframe frame;uint32_t offset; -uint32_t iec; +uint32_t value;ssize_t err;if (!dig->afmt || !dig->afmt->enabled)
@@ -472,60 +474,6 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder)DRM_DEBUG ("0x%02X IEC60958 status bits and 0x%02X category code\n" , (int )audio.status_bits, (int )audio.category_code); - iec =0 ; -if (audio.status_bits &AUDIO_STATUS_PROFESSIONAL ) - iec |=1 <<0 ; -if (audio.status_bits &AUDIO_STATUS_NONAUDIO ) - iec |=1 <<1 ; -if (audio.status_bits &AUDIO_STATUS_COPYRIGHT ) - iec |=1 <<2 ; -if (audio.status_bits &AUDIO_STATUS_EMPHASIS ) - iec |=1 <<3 ; - - iec |=HDMI0_60958_CS_CATEGORY_CODE (audio.category_code); - -switch (audio.rate) { -case 32000 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0x3 ); -break ; -case 44100 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0x0 ); -break ; -case 48000 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0x2 ); -break ; -case 88200 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0x8 ); -break ; -case 96000 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0xa ); -break ; -case 176400 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0xc ); -break ; -case 192000 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0xe ); -break ; - } - -WREG32 (HDMI0_60958_0 + offset, iec); - - iec =0 ; -switch (audio.bits_per_sample) { -case 16 : - iec |=HDMI0_60958_CS_WORD_LENGTH (0x2 ); -break ; -case 20 : - iec |=HDMI0_60958_CS_WORD_LENGTH (0x3 ); -break ; -case 24 : - iec |=HDMI0_60958_CS_WORD_LENGTH (0xb ); -break ; - } -if (audio.status_bits &AUDIO_STATUS_V ) - iec |=0x5 <<16 ; -WREG32_P (HDMI0_60958_1 + offset, iec, ~0x5000f ); - err =hdmi_audio_infoframe_init (&frame);if (err <0 ) {DRM_ERROR ("failed to setup audio infoframe\n" );
@@ -540,8 +488,22 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder)return ; } + value =RREG32 (HDMI0_AUDIO_PACKET_CONTROL + offset); +if (value &HDMI0_AUDIO_TEST_EN ) +WREG32 (HDMI0_AUDIO_PACKET_CONTROL + offset, + value & ~HDMI0_AUDIO_TEST_EN ); + +WREG32_OR (HDMI0_CONTROL + offset, +HDMI0_ERROR_ACK ); + +WREG32_AND (HDMI0_INFOFRAME_CONTROL0 + offset, + ~HDMI0_AUDIO_INFO_SOURCE ); +r600_hdmi_update_audio_infoframe (encoder, buffer,sizeof (buffer)); -r600_hdmi_audio_workaround (encoder); + +WREG32_OR (HDMI0_INFOFRAME_CONTROL0 + offset, +HDMI0_AUDIO_INFO_CONT | +HDMI0_AUDIO_INFO_UPDATE ); }/*
drivers/gpu/drm/radeon/r600d.h +15 -0
@@ -1029,9 +1029,11 @@#define HDMI0_AUDIO_PACKET_CONTROL 0x7408# define HDMI0_AUDIO_SAMPLE_SEND (1 << 0)# define HDMI0_AUDIO_DELAY_EN (x) (((x) & 3) << 4) +# define HDMI0_AUDIO_DELAY_EN_MASK (3 << 4)# define HDMI0_AUDIO_SEND_MAX_PACKETS (1 << 8)# define HDMI0_AUDIO_TEST_EN (1 << 12)# define HDMI0_AUDIO_PACKETS_PER_LINE (x) (((x) & 0x1f) << 16) +# define HDMI0_AUDIO_PACKETS_PER_LINE_MASK (0x1f << 16)# define HDMI0_AUDIO_CHANNEL_SWAP (1 << 24)# define HDMI0_60958_CS_UPDATE (1 << 26)# define HDMI0_AZ_FORMAT_WTRIG_MASK (1 << 28)
@@ -1054,7 +1056,9 @@# define HDMI0_MPEG_INFO_UPDATE (1 << 10)#define HDMI0_INFOFRAME_CONTROL1 0x7418# define HDMI0_AVI_INFO_LINE (x) (((x) & 0x3f) << 0) +# define HDMI0_AVI_INFO_LINE_MASK (0x3f << 0)# define HDMI0_AUDIO_INFO_LINE (x) (((x) & 0x3f) << 8) +# define HDMI0_AUDIO_INFO_LINE_MASK (0x3f << 8)# define HDMI0_MPEG_INFO_LINE (x) (((x) & 0x3f) << 16)#define HDMI0_GENERIC_PACKET_CONTROL 0x741c# define HDMI0_GENERIC0_SEND (1 << 0)
@@ -1063,7 +1067,9 @@# define HDMI0_GENERIC1_SEND (1 << 4)# define HDMI0_GENERIC1_CONT (1 << 5)# define HDMI0_GENERIC0_LINE (x) (((x) & 0x3f) << 16) +# define HDMI0_GENERIC0_LINE_MASK (0x3f << 16)# define HDMI0_GENERIC1_LINE (x) (((x) & 0x3f) << 24) +# define HDMI0_GENERIC1_LINE_MASK (0x3f << 24)#define HDMI0_GC 0x7428# define HDMI0_GC_AVMUTE (1 << 0)#define HDMI0_AVI_INFO0 0x7454
@@ -1119,16 +1125,22 @@#define HDMI0_GENERIC1_6 0x74a8#define HDMI0_ACR_32_0 0x74ac# define HDMI0_ACR_CTS_32 (x) (((x) & 0xfffff) << 12) +# define HDMI0_ACR_CTS_32_MASK (0xfffff << 12)#define HDMI0_ACR_32_1 0x74b0# define HDMI0_ACR_N_32 (x) (((x) & 0xfffff) << 0) +# define HDMI0_ACR_N_32_MASK (0xfffff << 0)#define HDMI0_ACR_44_0 0x74b4# define HDMI0_ACR_CTS_44 (x) (((x) & 0xfffff) << 12) +# define HDMI0_ACR_CTS_44_MASK (0xfffff << 12)#define HDMI0_ACR_44_1 0x74b8# define HDMI0_ACR_N_44 (x) (((x) & 0xfffff) << 0) +# define HDMI0_ACR_N_44_MASK (0xfffff << 0)#define HDMI0_ACR_48_0 0x74bc# define HDMI0_ACR_CTS_48 (x) (((x) & 0xfffff) << 12) +# define HDMI0_ACR_CTS_48_MASK (0xfffff << 12)#define HDMI0_ACR_48_1 0x74c0# define HDMI0_ACR_N_48 (x) (((x) & 0xfffff) << 0) +# define HDMI0_ACR_N_48_MASK (0xfffff << 0)#define HDMI0_ACR_STATUS_0 0x74c4#define HDMI0_ACR_STATUS_1 0x74c8#define HDMI0_AUDIO_INFO0 0x74cc
@@ -1148,14 +1160,17 @@# define HDMI0_60958_CS_CATEGORY_CODE (x) (((x) & 0xff) << 8)# define HDMI0_60958_CS_SOURCE_NUMBER (x) (((x) & 0xf) << 16)# define HDMI0_60958_CS_CHANNEL_NUMBER_L (x) (((x) & 0xf) << 20) +# define HDMI0_60958_CS_CHANNEL_NUMBER_L_MASK (0xf << 20)# define HDMI0_60958_CS_SAMPLING_FREQUENCY (x) (((x) & 0xf) << 24)# define HDMI0_60958_CS_CLOCK_ACCURACY (x) (((x) & 3) << 28) +# define HDMI0_60958_CS_CLOCK_ACCURACY_MASK (3 << 28)#define HDMI0_60958_1 0x74d8# define HDMI0_60958_CS_WORD_LENGTH (x) (((x) & 0xf) << 0)# define HDMI0_60958_CS_ORIGINAL_SAMPLING_FREQUENCY (x) (((x) & 0xf) << 4)# define HDMI0_60958_CS_VALID_L (x) (((x) & 1) << 16)# define HDMI0_60958_CS_VALID_R (x) (((x) & 1) << 18)# define HDMI0_60958_CS_CHANNEL_NUMBER_R (x) (((x) & 0xf) << 20) +# define HDMI0_60958_CS_CHANNEL_NUMBER_R_MASK (0xf << 20)#define HDMI0_ACR_PACKET_CONTROL 0x74dc# define HDMI0_ACR_SEND (1 << 0)# define HDMI0_ACR_CONT (1 << 1)
Signature · 6 lines
1.8.4.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 4/4 drm/radeon/hdmi: DCE2: simplify audio workaround
Thanks to advanced RE of fglrx we finally know what exactly needs to be handled of AFMT change.
This has been tested for possible regressions on:
1) DCE2 HD2400 (RV610)
2) DCE3 HD3470 (RV620)
For a reference and details see:
https://bugzilla.kernel.org/show_bug.cgi?id=76231
---
V2: Move r600d.h changes to 0003 (from 0004) to don't break compilation
Fix typo in commit message
--- drivers/gpu/drm/radeon/r600_hdmi.c | 82 ++++++++++---------------------------- 1 file changed, 22 insertions(+), 60 deletions(-)
drivers/gpu/drm/radeon/r600_hdmi.c +22 -60
@@ -441,14 +441,16 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *modWREG32 (HDMI0_RAMP_CONTROL2 + offset,0x00000001 );WREG32 (HDMI0_RAMP_CONTROL3 + offset,0x00000001 ); -r600_hdmi_audio_workaround (encoder); -/* enable audio after to setting up hw */ r600_audio_enable (rdev, dig->afmt->pin, true); } -/* -* update settings with current parameters from audio engine +/** +* r600_hdmi_update_audio_settings - Update audio infoframe +* +* @encoder: drm encoder +* +* Gets info about current audio stream and updates audio infoframe. */ void r600_hdmi_update_audio_settings (struct drm_encoder *encoder) {
@@ -460,7 +462,7 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder)uint8_t buffer[HDMI_INFOFRAME_HEADER_SIZE +HDMI_AUDIO_INFOFRAME_SIZE ];struct hdmi_audio_infoframe frame;uint32_t offset; -uint32_t iec; +uint32_t value;ssize_t err;if (!dig->afmt || !dig->afmt->enabled)
@@ -473,60 +475,6 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder)DRM_DEBUG ("0x%02X IEC60958 status bits and 0x%02X category code\n" , (int )audio.status_bits, (int )audio.category_code); - iec =0 ; -if (audio.status_bits &AUDIO_STATUS_PROFESSIONAL ) - iec |=1 <<0 ; -if (audio.status_bits &AUDIO_STATUS_NONAUDIO ) - iec |=1 <<1 ; -if (audio.status_bits &AUDIO_STATUS_COPYRIGHT ) - iec |=1 <<2 ; -if (audio.status_bits &AUDIO_STATUS_EMPHASIS ) - iec |=1 <<3 ; - - iec |=HDMI0_60958_CS_CATEGORY_CODE (audio.category_code); - -switch (audio.rate) { -case 32000 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0x3 ); -break ; -case 44100 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0x0 ); -break ; -case 48000 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0x2 ); -break ; -case 88200 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0x8 ); -break ; -case 96000 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0xa ); -break ; -case 176400 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0xc ); -break ; -case 192000 : - iec |=HDMI0_60958_CS_SAMPLING_FREQUENCY (0xe ); -break ; - } - -WREG32 (HDMI0_60958_0 + offset, iec); - - iec =0 ; -switch (audio.bits_per_sample) { -case 16 : - iec |=HDMI0_60958_CS_WORD_LENGTH (0x2 ); -break ; -case 20 : - iec |=HDMI0_60958_CS_WORD_LENGTH (0x3 ); -break ; -case 24 : - iec |=HDMI0_60958_CS_WORD_LENGTH (0xb ); -break ; - } -if (audio.status_bits &AUDIO_STATUS_V ) - iec |=0x5 <<16 ; -WREG32_P (HDMI0_60958_1 + offset, iec, ~0x5000f ); - err =hdmi_audio_infoframe_init (&frame);if (err <0 ) {DRM_ERROR ("failed to setup audio infoframe\n" );
@@ -541,8 +489,22 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder)return ; } + value =RREG32 (HDMI0_AUDIO_PACKET_CONTROL + offset); +if (value &HDMI0_AUDIO_TEST_EN ) +WREG32 (HDMI0_AUDIO_PACKET_CONTROL + offset, + value & ~HDMI0_AUDIO_TEST_EN ); + +WREG32_OR (HDMI0_CONTROL + offset, +HDMI0_ERROR_ACK ); + +WREG32_AND (HDMI0_INFOFRAME_CONTROL0 + offset, + ~HDMI0_AUDIO_INFO_SOURCE ); +r600_hdmi_update_audio_infoframe (encoder, buffer,sizeof (buffer)); -r600_hdmi_audio_workaround (encoder); + +WREG32_OR (HDMI0_INFOFRAME_CONTROL0 + offset, +HDMI0_AUDIO_INFO_CONT | +HDMI0_AUDIO_INFO_UPDATE ); }/*
Signature · 6 lines
1.8.4.5 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel