aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0896-drm-amd-dal-zero-out-current-context-on-suspend.patch
blob: de625ffe954216ce9258461b18b6852301673778 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From eb60252c7886935b2fc170fbdbb1ac9c9e1916fd Mon Sep 17 00:00:00 2001
From: Eric Yang <eric.yang2@amd.com>
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 <eric.yang2@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 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