From ef1c26cf76b077029450a4a48d0608dc3bf786e7 Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Mon, 14 Mar 2016 16:46:31 -0400 Subject: [PATCH 1518/1565] 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. Change-Id: I6821e30cea37771a11d325c5a09676849125c05d Signed-off-by: Eric Yang Acked-by: Harry Wentland --- 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 = { -- 1.9.1