From eb60252c7886935b2fc170fbdbb1ac9c9e1916fd Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Mon, 14 Mar 2016 16:46:31 -0400 Subject: [PATCH 0896/1110] drm/amd/dal: zero out current context on suspend Since everything shuts down on S3, the states stored in current context are no longer valid and should be zeroed to make sure they don't confuse DC level optimization into incorrectly skipping hw programming. For the S3 issue on Tonga, the display clock was always hard coded, therefore not changing on resuming, so ended up not being programmed due to optimization. This change fixes S3 resume on Tonga. Signed-off-by: Eric Yang Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/dal/dc/core/dc.c | 7 +++++++ drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c index f8459a3..5d87597 100644 --- a/drivers/gpu/drm/amd/dal/dc/core/dc.c +++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c @@ -1081,6 +1081,13 @@ void dc_set_power_state( /* NULL means "reset/release all DC targets" */ dc_commit_targets(dc, NULL, 0); + /* Zero out the current context so that on resume we start with + * clean state, and dc hw programming optimizations will not + * cause any trouble. + */ + memset(&core_dc->current_context, 0, + sizeof(core_dc->current_context)); + core_dc->hwss.power_down(core_dc); break; } diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c index fae2f8a..3d4f8b7 100644 --- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c +++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c @@ -1637,7 +1637,6 @@ static void init_hw(struct core_dc *dc) if (dal_audio_power_up(audio) != AUDIO_RESULT_OK) dm_error("Failed audio power up!\n"); } - } static const struct hw_sequencer_funcs dce110_funcs = { -- 2.7.4