OSDN Git Service

drm/amd/display: Disable Audio on reinitialize hardware
authorAlvin Lee <alvin.lee2@amd.com>
Thu, 20 Jun 2019 17:03:25 +0000 (13:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Jul 2019 19:17:19 +0000 (14:17 -0500)
[Why]
When we recover from hang, we do not want to skip the audio enable call.

[How]
Disable audio in dc_reinitialize_hardware

Signed-off-by: Alvin Lee <alvin.lee2@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c

index 740f5db..50bfb59 100644 (file)
@@ -333,6 +333,7 @@ void dcn20_clk_mgr_construct(
                struct dccg *dccg)
 {
        clk_mgr->base.ctx = ctx;
+       clk_mgr->pp_smu = pp_smu;
        clk_mgr->base.funcs = &dcn2_funcs;
        clk_mgr->regs = &clk_mgr_regs;
        clk_mgr->clk_mgr_shift = &clk_mgr_shift;
index 858a588..8005989 100644 (file)
@@ -965,11 +965,17 @@ void hwss_edp_backlight_control(
 void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx)
 {
        /* notify audio driver for audio modes of monitor */
-       struct dc *core_dc = pipe_ctx->stream->ctx->dc;
+       struct dc *core_dc;
        struct pp_smu_funcs *pp_smu = NULL;
-       struct clk_mgr *clk_mgr = core_dc->clk_mgr;
+       struct clk_mgr *clk_mgr;
        unsigned int i, num_audio = 1;
 
+       if (!pipe_ctx->stream)
+               return;
+
+       core_dc = pipe_ctx->stream->ctx->dc;
+       clk_mgr = core_dc->clk_mgr;
+
        if (pipe_ctx->stream_res.audio && pipe_ctx->stream_res.audio->enabled == true)
                return;
 
@@ -999,9 +1005,15 @@ void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx)
 
 void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx, int option)
 {
-       struct dc *dc = pipe_ctx->stream->ctx->dc;
+       struct dc *dc;
        struct pp_smu_funcs *pp_smu = NULL;
-       struct clk_mgr *clk_mgr = dc->clk_mgr;
+       struct clk_mgr *clk_mgr;
+
+       if (!pipe_ctx || !pipe_ctx->stream)
+               return;
+
+       dc = pipe_ctx->stream->ctx->dc;
+       clk_mgr = dc->clk_mgr;
 
        if (pipe_ctx->stream_res.audio && pipe_ctx->stream_res.audio->enabled == false)
                return;