drm/amd/display: Fixed the audio noise during mode switching with HDCP mode on
authorRoy Chan <roy.chan@amd.com>
Tue, 24 Nov 2020 23:20:13 +0000 (18:20 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Dec 2020 04:04:46 +0000 (23:04 -0500)
[Why]
When HDCP is on, some display would introduce audio noise during
HDCP handling.

[How]
Mute before HDCP handling when disabling core link. Unmute after
HDCP when enabling core link.

Signed-off-by: Roy Chan <roy.chan@amd.com>
Reviewed-by: Martin Leung <Martin.Leung@amd.com>
Acked-by: Eryk Brol <eryk.brol@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c

index 0052247..a901baf 100644 (file)
@@ -3270,8 +3270,6 @@ void core_link_enable_stream(
 #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
 #endif
 
-               dc->hwss.enable_audio_stream(pipe_ctx);
-
                /* turn off otg test pattern if enable */
                if (pipe_ctx->stream_res.tg->funcs->set_test_pattern)
                        pipe_ctx->stream_res.tg->funcs->set_test_pattern(pipe_ctx->stream_res.tg,
@@ -3310,6 +3308,9 @@ void core_link_enable_stream(
 #if defined(CONFIG_DRM_AMD_DC_HDCP)
                update_psp_stream_config(pipe_ctx, false);
 #endif
+
+               dc->hwss.enable_audio_stream(pipe_ctx);
+
        } else { // if (IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment))
                if (dc_is_dp_signal(pipe_ctx->stream->signal) ||
                                dc_is_virtual_signal(pipe_ctx->stream->signal))
@@ -3337,6 +3338,8 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx)
                        core_link_set_avmute(pipe_ctx, true);
        }
 
+       dc->hwss.disable_audio_stream(pipe_ctx);
+
 #if defined(CONFIG_DRM_AMD_DC_HDCP)
        update_psp_stream_config(pipe_ctx, true);
 #endif