drm/amdgpu: Clear HDMI audio descriptors for sinks without audio
Subsystems (2)
PATCH 1/1 drm/amdgpu: Clear HDMI audio descriptors for sinks without audio
From: Wang Jiang <[email protected]>
EDID without SAD left stale AZ descriptors; emulated ATI ELD faked audio capability. Clear them.
The legacy implementation refers to ce9778b7a027, "ALSA: hda/hdmi: Consider ELD invalid when no SAD is present".
Signed-off-by Wang Jiang <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 7 ++++++- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 7 ++++++- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 6 +++++- 3 files changed, 17 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +6 -1
@@ -1341,8 +1341,13 @@ static void dce_v10_0_audio_write_sad_regs(struct drm_encoder *encoder) sad_count =drm_edid_to_sad (drm_edid_raw (amdgpu_connector->edid), &sads);if (sad_count <0 )DRM_ERROR ("Couldn't read SADs: %d\n" , sad_count); -if (sad_count <=0 ) +if (sad_count <=0 ) { +/* sink has no audio capability: clear stale descriptors */ +for (i =0 ; i <ARRAY_SIZE (eld_reg_to_type); i++) +WREG32_AUDIO_ENDPT (dig->afmt->pin->offset, + eld_reg_to_type[i][0 ],0 );return ; + }BUG_ON (!sads);for (i =0 ; i <ARRAY_SIZE (eld_reg_to_type); i++) {
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +6 -1
@@ -1320,8 +1320,13 @@ static void dce_v6_0_audio_write_sad_regs(struct drm_encoder *encoder) sad_count =drm_edid_to_sad (drm_edid_raw (amdgpu_connector->edid), &sads);if (sad_count <0 )DRM_ERROR ("Couldn't read SADs: %d\n" , sad_count); -if (sad_count <=0 ) +if (sad_count <=0 ) { +/* sink has no audio capability: clear stale descriptors */ +for (i =0 ; i <ARRAY_SIZE (eld_reg_to_type); i++) +WREG32_AUDIO_ENDPT (dig->afmt->pin->offset, + eld_reg_to_type[i][0 ],0 );return ; + }for (i =0 ; i <ARRAY_SIZE (eld_reg_to_type); i++) {u32 value =0 ;
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +5 -1
@@ -1313,8 +1313,12 @@ static void dce_v8_0_audio_write_sad_regs(struct drm_encoder *encoder) sad_count =drm_edid_to_sad (drm_edid_raw (amdgpu_connector->edid), &sads);if (sad_count <0 )DRM_ERROR ("Couldn't read SADs: %d\n" , sad_count); -if (sad_count <=0 ) +if (sad_count <=0 ) { +/* sink has no audio capability: clear stale descriptors */ +for (i =0 ; i <ARRAY_SIZE (eld_reg_to_type); i++) +WREG32_AUDIO_ENDPT (offset, eld_reg_to_type[i][0 ],0 );return ; + }BUG_ON (!sads);for (i =0 ; i <ARRAY_SIZE (eld_reg_to_type); i++) {
Signature · 1 line
2.25.1